This document provides an introduction to linear programming, including:
1. The objectives are to introduce the components of linear programming models including formulation, graphical solution methods, and solving in Excel/Lingo/Python.
2. Example 1 presents a woodcarving business problem and formulates it as a linear program to maximize weekly profit with constraints on resources.
3. Example 2 formulates an advertising problem for Dorian Auto to determine the minimum cost mix of comedy and football commercials to reach audience targets.
Why linear programming is a very important topic?
• A lot of problems can be formulated as linear
programmes
• There exist efficient methods to solve them
• or at least give good approximations.
• Solve difficult problems: e.g. original example given
by the inventor of the theory, Dantzig. Best
assignment of 70 people to 70 tasks.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Why linear programming is a very important topic?
• A lot of problems can be formulated as linear
programmes
• There exist efficient methods to solve them
• or at least give good approximations.
• Solve difficult problems: e.g. original example given
by the inventor of the theory, Dantzig. Best
assignment of 70 people to 70 tasks.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
The Indian economy is classified into different sectors to simplify the analysis and understanding of economic activities. For Class 10, it's essential to grasp the sectors of the Indian economy, understand their characteristics, and recognize their importance. This guide will provide detailed notes on the Sectors of the Indian Economy Class 10, using specific long-tail keywords to enhance comprehension.
For more information, visit-www.vavaclasses.com
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
2. Objectives
! Introduce modeling components in Linear
Programs
! Solve smaller-size linear programs manually by
graphic methods
! Formulate and solve LP in Excel
! Introduce Lingo and Python for optimization
2
4. 2
What Is a Linear Programming
Problem?
„ Linear Programming (LP) is a tool for solving
optimization problems.
„ Linear programming problems involve
important terms that are used to describe
linear programming.
5. 3
E 1:
Woodcarving
„ , .,
and trains.
† Each soldier built:
„ Sell for $27 and uses $19 worth of raw materials.
„ /
$14.
„ Requires 2 hours of finishing labor.
„ Requires 1 hour of carpentry labor.
† Each train built:
„ Sell for $21 and used $9 worth of raw materials.
„ /
by $10.
„ Requires 1 hour of finishing labor.
„ Requires 1 hour of carpentry labor.
0
6. 4
Ex. 1 - continued
„ Each week Giapetto can obtain:
† All needed raw material.
† Only 100 finishing hours.
† Only 80 carpentry hours.
„ Demand for the trains is unlimited.
„ At most 40 soldiers are bought each week.
„ Giapetto wants to maximize weekly profit
(revenues costs).
„ F
situation that can be used maximize weekly
profit.
7. 5
Example 1: Solution
„ The Giapetto solution model incorporates the
characteristics shared by all linear
programming problems.
† Decision variables should completely describe the
decisions to be made.
„ x1 = number of soldiers produced each week
„ x2 = number of trains produced each week
† The decision maker wants to maximize (usually
revenue or profit) or minimize (usually costs) some
function of the decision variables. This function to
maximized or minimized is called the objective
function.
„ For the Giapetto problem, fixed costs do not depend
upon the the values of x1 or x2.
8. 6
Ex. 1 - Solution continued
„
terms of the decision variables x1 and x2:
Weekly profit =
weekly revenue weekly raw material costs the
weekly variable costs = 3x1 + 2x2
„ , x1 and x2
to maximize weekly profit. The variable z
denotes the objective function value of any LP.
„
Maximize z = 3x1 + 2x2
„ The coefficient of an objective function variable
is called an objective function coefficient.
9. 7
Ex. 1 - Solution continued
„ As x1 and x2 ,
function grows larger.
„ For Giapetto, the values of x1 and x2 are
limited by the following three restrictions
(often called constraints):
† Each week, no more than 100 hours of finishing time
may be used. (2 x1 + x2 100)
† Each week, no more than 80 hours of carpentry time
may be used. (x1 + x2 80)
† Because of limited demand, at most 40 soldiers
should be produced. (x1 40)
10. 8
„ The coefficients of the decision variables in the
constraints are called the technological coefficients.
The number on the right-hand side of each constraint is
-hand side (or rhs).
„ To complete the formulation of a linear programming
problem, the following question must be answered for
each decision variable.
† Can the decision variable only assume nonnegative values,
or is the decision variable allowed to assume both positive
and negative values?
„ If the decision variable can assume only nonnegative
values, the sign restriction xi 0 .
„ If the variable can assume both positive and negative
values, the decision variable xi is unrestricted in sign
(often abbreviated urs).
11. 9
Ex. 1 - Solution continued
„ For the Giapetto problem model, combining the
sign restrictions x1 0 x2 0
objective function and constraints yields the
following optimization model:
Max z = 3x1 + 2x2 (objective function)
Subject to (s.t.)
2 x1 + x2 ≤ 100 (finishing constraint)
x1 + x2 ≤ 80 (carpentry constraint)
x1 ≤ 40 (constraint on demand for soldiers)
x1 ≥ 0 (sign restriction)
x2 ≥ 0 (sign restriction)
12. 10
„ A function f(x1, x2, , xn of x1, x2, , xn is a
linear function if and only if for some set of
constants, c1, c2, , cn, f(x1, x2, , xn) = c1x1
+ c2x2 + + cnxn.
„ For any linear function f(x1, x2, , xn) and any
number b, the inequalities f(x1, x2, , xn) b
and f(x1, x2, , xn) linear
inequalities.
13. 11
„ A linear programming problem (LP) is an
optimization problem for which we do the
following:
† Attempt to maximize (or minimize) a linear function
(called the objective function) of the decision
variables.
† The values of the decision variables must satisfy a set
of constraints. Each constraint must be a linear
equation or inequality.
† A sign restriction is associated with each variable.
For any variable xi, the sign restriction specifies
either that xi must be nonnegative (xi 0) xi
may be unrestricted in sign.
14. 12
„ The fact that the objective function for an LP
must be a linear function of the decision
variables has two implications:
1. The contribution of the objective function from each
decision variable is proportional to the value of the
decision variable. For example, the contribution to
the objective function for 4 soldiers is exactly fours
times the contribution of 1 soldier.
2. The contribution to the objective function for any
variable is independent of the other decision
variables. For example, no matter what the value of
x2, the manufacture of x1 soldiers will always
contribute 3x1 dollars to the objective function.
15. 13
„ Analogously, the fact that each LP constraint
must be a linear inequality or linear equation
has two implications:
1. The contribution of each variable to the left-hand side
of each constraint is proportional to the value of the
variable. For example, it takes exactly 3 times as
many finishing hours to manufacture 3 soldiers as it
does 1 soldier.
2. The contribution of a variable to the left-hand side of
each constraint is independent of the values of the
variable. For example, no matter what the value of
x1, the manufacture of x2 trains uses x2 finishing
hours and x2 carpentry hours
16. 14
„ The first item in each list is called the
Proportionality Assumption of Linear
Programming.
„ The second item in each list is called the
Additivity Assumption of Linear
Programming.
„ The divisibility assumption requires that
each decision variable be permitted to assume
fractional values.
17. 15
„ The certainty assumption is that each
parameter (objective function coefficients,
right-hand side, and technological coefficients)
are known with certainty.
„ The feasible region of an LP is the set of all
sign restrictions.
„ For a maximization problem, an optimal
solution to an LP is a point in the feasible
region with the largest objective function
value.
† Similarly, for a minimization problem, an optimal
solution is a point in the feasible region with the
smallest objective function value.
18. 16
The Graphical Solution to a Two-
Variable LP Problem
„ Any LP with only two variables can be solved
graphically.
† The variables are always labeled x1 and x2 and the
coordinate axes the x1 and x2 axes.
Satisfies 2x1 + 3x2 ≥ 6
Satisfies 2x1 + 3x2 ≤ 6 X1
1 2 3 4
1
2
3
4
X2
-1
-1
19. 17
„ Since the Giapetto LP has two variables, it may
be solved graphically.
„ The feasible region is the set of all points
satisfying the constraints
2 x1 + x2 100 ( )
x1 + x2 80 ( )
x1 40 ( )
x1 0 ( )
x2 0 ( )
20. 18
„ The set of points satisfying the Giapetto LP is
bounded by the five sided polygon DGFEH.
Any point on or in the interior of this polygon
(the shade area) is in the feasible region.
X1
X2
10 20 40 50 60 80
20
40
60
80
100
finishing constraint
carpentry constraint
demand constraint
z = 60
z = 100
z = 180
Feasible Region
G
A
B
C
D
E
F
H
21. 19
„ Having identified the feasible region for the
Giapetto LP, a search can begin for the optimal
solution which will be the point in the feasible
region with the largest z-value.
„ To find the optimal solution, graph a line on
which the points have the same z-value. In a
max problem, such a line is called an isoprofit
line while in a min problem, this is called the
isocost line. The figure shows the isoprofit
lines for z = 60, z = 100, and z = 180
22. 20
„ A constraint is binding if the left-hand and
right-hand side of the constraint are equal
when the optimal values of the decision
variables are substituted into the constraint.
† In the Giapetto LP, the finishing and carpentry
constraints are binding.
„ A constraint is nonbinding if the left-hand side
and the right-hand side of the constraint are
unequal when the optimal values of the
decision variables are substituted into the
constraint.
† In the Giapetto LP, the demand constraint for
wooden soldiers is nonbinding since at the optimal
solution (x1 = 20), x1 < 40.
23. 21
„ A set of points S is a convex set if the line
segment jointing any two pairs of points in S is
wholly contained in S.
„ For any convex set S, a point p in S is an
extreme point if each line segment that lines
completely in S and contains the point P has P
as an endpoint of the line segment.
„ Extreme points are sometimes called corner
points, because if the set S is a polygon, the
extreme points will be the vertices, or corners,
of the polygon.
† The feasible region for the Giapetto LP will be a
convex set.
24. 22
Example 2 : Dorian Auto
„ Dorian Auto manufactures luxury cars and
trucks.
„ The company believes that its most likely
customers are high-income women and men.
„ To reach these groups, Dorian Auto has
embarked on an ambitious TV advertising
campaign and will purchase 1-mimute
commercial spots on two type of programs:
comedy shows and football games.
25. 23
Ex. 2: continued
„ Each comedy commercial is seen by 7 million
high income women and 2 million high-income
men and costs $50,000.
„ Each football game is seen by 2 million high-
income women and 12 million high-income
men and costs $100,000.
„ Dorian Auto would like for commercials to be
seen by at least 28 million high-income women
and 24 million high-income men.
„ Use LP to determine how Dorian Auto can meet
its advertising requirements at minimum cost.
26. 24
Example 2: Solution
„ Dorian must decide how many comedy and football ads
should be purchased, so the decision variables are
† x1 = number of 1-minute comedy ads
† x2 = number of 1-minute football ads
„ Dorian wants to minimize total advertising cost.
„ D
min z = 50 x1 + 100x2
„ Dorian faces the following the constraints
† Commercials must reach at least 28 million high-income
women. (7x1 + 2x2 28)
† Commercials must reach at least 24 million high-income
men. (2x1 + 12x2 24)
† The sign restrictions are necessary, so x1, x2 0.
27. 25
Ex. 2 Solution continued
„ Like the Giapetto LP, The Dorian LP has a
convex feasible region.
„ The feasible region for the Dorian problem,
however, contains points for which the value of
at least one variable can assume arbitrarily
large values.
„ Such a feasible region is called an unbounded
feasible region.
28. 26
Ex. 2 Solution continued
„ To solve this LP graphically begin by graphing
the feasible region.
X1
X2
2
4
6
8
10
12
14
2 4 6 8 10 12 14
z = 600
z = 320
A C
D
E
B
Feasible
Region
(unbounded)
High-income women constraint
High-income men constraint
29. 27
Ex. 2 Solution continued
„ Since Dorian wants to minimize total
advertising costs, the optimal solution to the
problem is the point in the feasible region with
the smallest z value.
„ An isocost line with the smallest z value passes
through point E and is the optimal solution at
x1 = 3.4 and x2 = 1.4.
„ Both the high-income women and high-income
men constraints are satisfied, both constraints
are binding.
30. 28
Does the Dorian model meet the four
assumptions of linear programming in reality?
The Proportionality Assumption is violated because at
a certain point advertising yields diminishing returns.
Even though the Additivity Assumption was used in
writing: (Total viewers) = (Comedy viewer ads) +
(Football ad viewers) many of the same people might
view both ads, double-counting of such people would
occur thereby violating the assumption.
The Divisibility Assumption is violated if only 1-
minute commercials are available. Dorian is unable to
purchase 3.6 comedy and 1.4 football commercials.
The Certainty assumption is also violated because
there is no way to know with certainty how many
viewers are added by each type of commercial.
31. 29
Special Cases
„ The Giapetto and Dorian LPs each had a unique
optimal solution.
„ Some types of LPs do not have unique
solutions.
† Some LPs have an infinite number of solutions
(alternative or multiple optimal solutions).
† Some LPs have no feasible solutions (infeasible LPs).
† Some LPs are unbounded: There are points in the
feasible region with arbitrarily large (in a
maximization problem) z-values.
„ The technique of goal programming is often
used to choose among alternative optimal
solutions.
32. 30
„
empty, resulting in an infeasible LP.
„ Because the optimal solution to an LP is the
best point in the feasible region, an infeasible
LP has no optimal solution.
„ For a max problem, an unbounded LP occurs if
it is possible to find points in the feasible
region with arbitrarily large z-values, which
corresponds to a decision maker earning
arbitrarily large revenues or profits.
33. 31
„ For a minimization problem, an LP is unbounded if there
are points in the feasible region with arbitrarily small z-
values.
„ Every LP with two variables must fall into one of the
following four cases.
† The LP has a unique optimal solution.
† The LP has alternative or multiple optimal solutions: Two or
more extreme points are optimal, and the LP will have an
infinite number of optimal solutions.
† The LP is infeasible: The feasible region contains no points.
† The LP unbounded: There are points in the feasible region
with arbitrarily large z-values (max problem) or arbitrarily
small z-values (min problem).
36. Capacitated Plant Location Model
qDecide in which regions to locate facilities and
how to allocate plant capacity across regions
qTrade-off reduced transportation times and
tariffs from more regional facilities vs. reduced
facilities cost for fewer centralized facilities
38. Capacitated Plant Location Model
qInput data:
qm customer sites, with annual demand Dj
qn possible plant location sites, with annual capacity Ki
qfi = annualized fixed cost of opening facility i
qcij = cost to produce at i and ship to j
qDecision variables:
qyi = 1 if a plant is located at site i, 0 otherwise
qxij = quantity shipped from plant site i to customer j
39. Capacitated Plant Location Model
Example:
qThere are two potential plant locations, in
Boston and Los Angeles
qAnnualized cost of opening plant in Boston is
$150K, in Los Angeles is $100K
qThere are three customers, located in
Albany, Chicago and San Diego
40. Capacitated Plant Location Model
qLet XBA, XBC, XBS, XLA, XLC, XLS be amounts shipped
from each plant to each customer
qLet YB and YL indicate whether or not open plant
in Boston and Los Angeles
qFind these values to minimize total cost:
42. Capacitated Plant Location Model
qTotal shipments out of plant must not exceed
available capacity at plant:
43. Capacitated Plant Location Model
qShipment amounts cannot be negative:
qPlant location decision variables must be
either 0 or 1:
44. Capacitated Plant Location Model
qHint for building these models in solver:
qThese models must be linear programs
qDo not use “if” function in Excel
• Example: If we build a plant at i then the capacity is Ki, otherwise
the capacity is 0
qSolver may not work with these “if” statements
• Instead should use binary variables:
– Capacity at i = Ki yi, where yi = 1 if build plant,
yi = 0 if do not build plant
45. Capacitated Plant Location Model
qA more complex example:
qSunOil is a manufacturer of petrochemical products
with worldwide sales
qDivides the world into five regions:
• N. America, S. America, Europe, Asia and Africa
qMust satisfy all demand in each region
46. Capacitated Plant Location Model
• Need to decide where to locate facilities, how
many facilities to have, and how large facilities
should be (capacity)
• Could potentially locate a facility in each region,
regions have different production, transportation
and facility costs
• Facilities may be small (capacity of 10 million units)
or large (capacity of 20 million units)
47. Capacitated Plant Location Model
qUsing solver in Excel to solve SunOil’s
capacitated plant location model:
qDownload the capacitated plant location
spreadsheet from the Canvas
qContains all required input data:
• Unit production and transportation costs, fixed costs,
capacities and demands
48. Capacitated Plant Location Model
qStep 1:
qCreate a table for the decision variables
• Shipment quantities (in 1,000,000s) from each supply
region to each demand region
– Same format as production & transportation cost table
• Two sets of binary variables
– 1= open a small facility at each location, 0 = do not open
– 1 = open a large facility at each location, 0 = do not open
49. Capacitated Plant Location Model
qStep 2:
qCalculate quantities need for the constraints
• Quantity shipped into demand region must equal demand in
that region
– Excess demand = Demand in region – Shipments into region = 0
• Quantity shipped out of supply region must be less than or
equal to capacity in that region
– Excess capacity = Actual capacity from plants in region
– Shipments out of region >=0
50. Capacitated Plant Location Model
qStep 3:
qCalculate the total costs (use sumproduct
function)
• Production and transportation costs
• Costs from opening small plants
• Costs from opening large plants
• Add these three to get total costs
51. Capacitated Plant Location Model
qStep 4:
qSet up model in Solver
• Minimize total costs
• By changing the decision variables
• Subject to the constraints:
– Excess demand = 0
– Excess capacity >= 0
– Shipment quantities must be non-negative
– Plant size decision variables must be binary
52. Capacitated Plant Location Model
qOften, we are working within an existing
supply chain
qHave set of facilities with given capacities
qConsidering adding new facilities
qHow can we use and / or modify basic model to
accommodate this?
53. Capacitated Plant Location Model
qUsing solver in Excel to solve SunOil’s
capacitated plant location model, now assume
that we already have a large capacity plant in
North America and that we plan to continue
to operate this plant
qAdd the appropriate constraint and resolve
qHow does the solution change?
54. Capacitated Plant Location Model
qSuppose we would like to limit # of facilities
qMotivation?
qForm of additional constraint?
qLet k = maximum number of facilities
qSensitivity analysis on number of facilities can
be useful for decision-maker
55. Capacitated Plant Location Model
qUsing solver in Excel to solve SunOil’s
capacitated plant location model, with
additional constraint that can open at most
one large plant
qAdd the appropriate constraint and resolve
qHow does the solution change?
qProblems with solution?
56. Capacitated Plant Location Model
qUsing solver in Excel to solve SunOil’s
capacitated plant location model, with
additional constraint that can open at most
one large plant and can open at most one
plant at each location
qAdd the appropriate constraint and resolve
qHow does the solution change?
57. Plant Location Model with Single
Sourcing
qCould require each market to be served by just a single
plant
qMotivation for this constraint?
qyi = 1 if plant is located at site i, 0 otherwise
qxij = 1 if market j supplied by factory i, 0 otherwise
qIf xij = 1, ship quantity Dj from factory i to market j
58. Capacitated Plant Location Model
qSuppose we would like the option of not
satisfying all demands
qWhat do we lose if we do not satisfy some
demands?
qHow do we incorporate this loss in model?
qOther modifications to model required?
60. Overview
qGraphical approach is intuitive but limited to very
small size problems (2 variables and a few
constraints)
qScale up to solve any size of problem
qExplicit mode is useful for small size problems where the
user enters the equations as they are read, combining the
coefficients of the variables with the variables themselves
qFor medium & large size problems, a modeling language
aids the user by entering a general form of each type of
constraint. Data of the model parameters are separated
from the equations & they may even be located in a
separate database or spreadsheet file.
5