SlideShare a Scribd company logo
Deterministic Operations Research
OR 6205
Module 2: Introduction
to Linear Programming
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
Lesson 01: LP formulation
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.
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
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.
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.
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.
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)
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).
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)
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.
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.
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.
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
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.
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.
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
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 ( )
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
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
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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).
Example: Solve problem by graphic method
Lesson 2: Formulating and
solving LP models on a
spreadsheet
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
Potential
Sources Destinations
Limited production capacity Demand to be satisfied
K1
K2
K3
K4
D1
D2
D3
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
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
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:
Capacitated Plant Location Model
qMust satisfy all demand at each customer:
Capacitated Plant Location Model
qTotal shipments out of plant must not exceed
available capacity at plant:
Capacitated Plant Location Model
qShipment amounts cannot be negative:
qPlant location decision variables must be
either 0 or 1:
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
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
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)
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
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
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
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
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
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?
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?
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
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?
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?
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
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?
Lesson 3: Formulating and
solving LP models using
Lingo and/or AMPL
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
LINGO
qGo to www.lindo.com
qDownloads
qDownload LINGO
2
LINGO in Explicit Mode
Simple example:
Max: Z= 20*x +31*y;
2*x+5*y <= 16;
4*x -3*y = 6;
And x >=0, y>= 0.
3
LINGO
4
Sets-based Model
5
LINGO
6
set
Data
LINGO
7
model
Optimal
Results:
Importing and exporting
Spreadsheet data in LINGO
8

More Related Content

Similar to 02_Intro to LP.pdf

LP.pptx
LP.pptxLP.pptx
Linear Programming
Linear ProgrammingLinear Programming
Linear Programming
Pulchowk Campus
 
Chapter 6-INTEGER PROGRAMMING note.pdf
Chapter 6-INTEGER PROGRAMMING  note.pdfChapter 6-INTEGER PROGRAMMING  note.pdf
Chapter 6-INTEGER PROGRAMMING note.pdf
Tsegay Berhe
 
LPP.pptx
LPP.pptxLPP.pptx
LPP, Duality and Game Theory
LPP, Duality and Game TheoryLPP, Duality and Game Theory
LPP, Duality and Game Theory
Purnima Pandit
 
OI.ppt
OI.pptOI.ppt
OI.ppt
raj20072
 
NON LINEAR PROGRAMMING
NON LINEAR PROGRAMMING NON LINEAR PROGRAMMING
NON LINEAR PROGRAMMING
karishma gupta
 
qmb12ch08.pptx
qmb12ch08.pptxqmb12ch08.pptx
qmb12ch08.pptx
RidwanGunawan22
 
Chapter 03
Chapter 03Chapter 03
Chapter 03
ernestomuozorenday
 
Integer programming
Integer programmingInteger programming
Integer programming
Hakeem-Ur- Rehman
 
Simplex method material for operation .pptx
Simplex method material for operation .pptxSimplex method material for operation .pptx
Simplex method material for operation .pptx
bizuayehuadmasu1
 
Linear Programming 1
Linear Programming 1Linear Programming 1
Linear Programming 1irsa javed
 
Quantitativetechniqueformanagerialdecisionlinearprogramming 090725035417-phpa...
Quantitativetechniqueformanagerialdecisionlinearprogramming 090725035417-phpa...Quantitativetechniqueformanagerialdecisionlinearprogramming 090725035417-phpa...
Quantitativetechniqueformanagerialdecisionlinearprogramming 090725035417-phpa...
kongara
 
linear programming
linear programming linear programming
linear programming
DagnaygebawGoshme
 
Unit.2. linear programming
Unit.2. linear programmingUnit.2. linear programming
Unit.2. linear programming
DagnaygebawGoshme
 
Partial Derivatives.pdf
Partial Derivatives.pdfPartial Derivatives.pdf
Partial Derivatives.pdf
HrushikeshDandu
 
aaoczc2252
aaoczc2252aaoczc2252
aaoczc2252
Perumal_Gopi42
 
Chapter 2 Linear Programming for business (1).pptx
Chapter 2 Linear Programming for business (1).pptxChapter 2 Linear Programming for business (1).pptx
Chapter 2 Linear Programming for business (1).pptx
animutsileshe1
 
Lecture - Linear Programming.pdf
Lecture - Linear Programming.pdfLecture - Linear Programming.pdf
Lecture - Linear Programming.pdf
lucky141651
 
Mathematics For Management CHAPTER THREE PART I.PPT
Mathematics For Management  CHAPTER THREE PART I.PPTMathematics For Management  CHAPTER THREE PART I.PPT
Mathematics For Management CHAPTER THREE PART I.PPT
AYNETUTEREFE1
 

Similar to 02_Intro to LP.pdf (20)

LP.pptx
LP.pptxLP.pptx
LP.pptx
 
Linear Programming
Linear ProgrammingLinear Programming
Linear Programming
 
Chapter 6-INTEGER PROGRAMMING note.pdf
Chapter 6-INTEGER PROGRAMMING  note.pdfChapter 6-INTEGER PROGRAMMING  note.pdf
Chapter 6-INTEGER PROGRAMMING note.pdf
 
LPP.pptx
LPP.pptxLPP.pptx
LPP.pptx
 
LPP, Duality and Game Theory
LPP, Duality and Game TheoryLPP, Duality and Game Theory
LPP, Duality and Game Theory
 
OI.ppt
OI.pptOI.ppt
OI.ppt
 
NON LINEAR PROGRAMMING
NON LINEAR PROGRAMMING NON LINEAR PROGRAMMING
NON LINEAR PROGRAMMING
 
qmb12ch08.pptx
qmb12ch08.pptxqmb12ch08.pptx
qmb12ch08.pptx
 
Chapter 03
Chapter 03Chapter 03
Chapter 03
 
Integer programming
Integer programmingInteger programming
Integer programming
 
Simplex method material for operation .pptx
Simplex method material for operation .pptxSimplex method material for operation .pptx
Simplex method material for operation .pptx
 
Linear Programming 1
Linear Programming 1Linear Programming 1
Linear Programming 1
 
Quantitativetechniqueformanagerialdecisionlinearprogramming 090725035417-phpa...
Quantitativetechniqueformanagerialdecisionlinearprogramming 090725035417-phpa...Quantitativetechniqueformanagerialdecisionlinearprogramming 090725035417-phpa...
Quantitativetechniqueformanagerialdecisionlinearprogramming 090725035417-phpa...
 
linear programming
linear programming linear programming
linear programming
 
Unit.2. linear programming
Unit.2. linear programmingUnit.2. linear programming
Unit.2. linear programming
 
Partial Derivatives.pdf
Partial Derivatives.pdfPartial Derivatives.pdf
Partial Derivatives.pdf
 
aaoczc2252
aaoczc2252aaoczc2252
aaoczc2252
 
Chapter 2 Linear Programming for business (1).pptx
Chapter 2 Linear Programming for business (1).pptxChapter 2 Linear Programming for business (1).pptx
Chapter 2 Linear Programming for business (1).pptx
 
Lecture - Linear Programming.pdf
Lecture - Linear Programming.pdfLecture - Linear Programming.pdf
Lecture - Linear Programming.pdf
 
Mathematics For Management CHAPTER THREE PART I.PPT
Mathematics For Management  CHAPTER THREE PART I.PPTMathematics For Management  CHAPTER THREE PART I.PPT
Mathematics For Management CHAPTER THREE PART I.PPT
 

Recently uploaded

Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 

Recently uploaded (20)

Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 

02_Intro to LP.pdf

  • 1. Deterministic Operations Research OR 6205 Module 2: Introduction to Linear Programming
  • 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
  • 3. Lesson 01: LP formulation
  • 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).
  • 34. Example: Solve problem by graphic method
  • 35. Lesson 2: Formulating and solving LP models on a spreadsheet
  • 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
  • 37. Potential Sources Destinations Limited production capacity Demand to be satisfied K1 K2 K3 K4 D1 D2 D3
  • 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:
  • 41. Capacitated Plant Location Model qMust satisfy all demand at each customer:
  • 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?
  • 59. Lesson 3: Formulating and solving LP models using Lingo and/or AMPL
  • 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
  • 62. LINGO in Explicit Mode Simple example: Max: Z= 20*x +31*y; 2*x+5*y <= 16; 4*x -3*y = 6; And x >=0, y>= 0. 3