Chapter 2 Linear Programming Model
Chapter 2 Linear Programming Model
1
Linear Programming model
2
1 Introduction to Linear Programming
• The linear model consists of the following
components:
• A set of decision variables. (X1, X2, X3….)
• An objective function. (8X1+ 5X2+10X3
• A set of constraints.
4
Introduction to Linear Programming
• The Importance of Linear Programming
• There are efficient solution techniques that solve linear
programming models.
• The output generated from linear programming packages
provides useful “what if” analysis.
5
Generalized LP Model
6
Variations in LP Model
7
Terminologies
• Solution: any specification of values for the decision variables, xj, is
called a solution
• Infeasible Solution: a solution for which at least one constraint is violated.
• Feasible Solution: a solution for which all of the constraints are satisfied
• Corner - Point Feasible (CPF) solution: a solution that lies at the corner of the feasible
region.
• Optimal Solution: a feasible solution that has the most favorable value of the objective
function.
8
Assumptions
1. Proportionality:
• contribution of each activity to the objective function, z, is proportional to its
level. Cjxj
• contribution of each activity to each functional constraint is proportional to
its level. ai xj
2. Additivity:
• every function is the sum of the individual contribution of the respective
activities.
9
Assumptions (cont’d)
3. Divisibility:
- decision variables are allowed to have any
real values that satisfy the functional and
non-negativity constraints.
4. Certainty:
- the parameter values are assumed to be
known constants. 10
The Galaxy Industries Production Problem –
A Prototype Example
11
The Galaxy Industries Production Problem –
A Prototype Example
• Marketing requirement
• Total production cannot exceed 700 dozens.
• Number of dozens of Space Rays cannot exceed number of dozens of
Zappers by more than 350.
• Technological input
– Space Rays requires 2 pounds of plastic and
3 minutes of labor per dozen.
– Zappers requires 1 pound of plastic and
4 minutes of labor per dozen.
12
The Galaxy Industries Production Problem –
A Prototype Example
• The current production plan calls for:
• Producing as much as possible of the more profitable
product, Space Ray ($8 profit per dozen).
• Use resources left over to produce Zappers ($5 profit
per dozen), while remaining within the marketing
guidelines.
• The current production plan consists of:
Space Rays = 450 dozen 8(450) + 5(100)
Zapper = 100 dozen
Profit = $4100 per week
13
Management is seeking a
production schedule that will
increase the company’s profit.
14
A linear programming model
can provide an insight and an
intelligent solution to this problem.
15
The Galaxy Linear Programming Model
• Decisions variables:
• X1 = Weekly production level of Space Rays (in dozens)
• X2 = Weekly production level of Zappers (in dozens).
• Objective Function:
• Weekly profit, to be maximized
16
The Galaxy Linear Programming Model
17
Solution
18
2.3 The Graphical Analysis of Linear
Programming
FEASIBLE REGION
19
Using a graphical presentation
we can represent all the constraints,
the objective function, and the three
types of feasible points.
20
Graphical Analysis – the Feasible Region
X2
X1
21
Graphical Analysis – the Feasible Region
X2
Infeasible
Production Feasible
Time
3X1+4X2 £ 2400 X1
500 700
22
Graphical Analysis – the Feasible Region
X2
1000 The Plastic constraint
2X1+X2 £ 1000
700 Total production constraint:
X1+X2 £ 700 (redundant)
500
Infeasible
Production mix
constraint:
Production Feasible X1-X2 £ 350
Time
3X1+4X2£ 2400
X1
500 700
Interior points. Boundary points. Extreme points.
• There are three types of feasible points 23
The search for an optimal solution
X1
24
500
Summary of the optimal solution
Space Rays = 320 dozen
Zappers = 360 dozen
Profit = $4360
• This solution utilizes all the plastic and all the production
hours.
25
Extreme points and optimal solutions
26
Multiple optimal solutions
• For multiple optimal solutions to exist, the objective
function must be parallel to one of the constraints
27
Simplex algorithm
• Write the equation in mathematical equation
• Converting the equations into standard form by adding slack variables,
or artificial variables or artificial variables and slack variables
• Construct the initial table
• Identify the entering variable-pivot column
• Identify the leaving variable- pivot row
• Conduct further iteration to that the value at the pivot cell is 1 and all
other numbers in the column are zero.
• Check for optimality ( for maximization models all values in the C-Z row
must be less than or equal to zero for the solution to be optimal. If
there is any positive value in the C-z row of the table that is an
indication that the solution is not optimal. Hence, there is a need to
iterate further by identifying the leaving variable and entering variable
using the techniques discussed above.
28
Example
Maximize Z = f(x,y) = 3x + 2y
Max Z=3x+2y+0S1+0S2+0S3
2x + 3y ≤ 42 2X+y+S1=18
3x + y ≤ 24
2X+3Y+S2=42
3X+Y+S3=24
x≥0,y≥0
X,Y,S1,S2,S3≥0
Solution
x = 3 and y = 12
29
Maximization with mixed constraints
30
Cont’d
31
Solve using simplex method
Max! 6X + 8Y
Subject to: Y≤4
X+Y=9
6X+ 2Y ≥ 24
X, Y ≥ 0
32
In standard form
33
Initial table
BV CBV X Y S1 S3 A2 A3 Quantity
6 8 0 0 -M -M
S1 0 0 1 1 0 0 0 4
A2 -M 1 1 0 0 1 0 9
A3 -M 6 2 0 -1 0 1 24
34
Second table
BV CBV X Y S1 S3 A2 A3 Quantity
6 8 0 0 -M -M
S1 0 0 1 1 0 0 0 4
A2 -M 0 2/3 0 1/6 1 0 5
X 6 1 1/3 0 -1/6 0 1 4
Z 6 2-2M/3 0 -1M/6 -1 -M -M 24 - 5M
C-Z 0 6+2M/3 0 1+ M/6 0 0
35
Third table
BV CBV X Y S1 S3 A2 Quantity
6 8 0 0 -M
Y 0 0 1 1 0 0 4
A2 -M 7/3
X 6 0 0 -2/3 1/6 1 8/3
1 0 -1/3 -1/6 0
BV CBV X Y S1 S3 Quantity
6 8 0 0
Y 8 0 1 1 0 4
S3 0 14
X 6 0 0 -4 1 5
1 0 -1 0 37
Minimization problems
38
Example
Minimize Z= 7X + 9Y
Subject to: 3X + 6Y ≥ 36
8X + 4Y ≥ 64
X, Y ≥ 0
39
In standard form
40
Initial table
BV CBV X Y S1 S2 A1 A2
7 9 0 0 M M
A1 M 3 6 -1 0 1 0 36
A2 M 8 4 0 -1 0 1 64
41
2nd table
BV CBV X Y S1 S2 A1 A2
7 9 0 0 M M
A1 M 0 9/2 -1 3/8 1 0 12
X 7 1 1/2 0 -1/8 0 1/8 8
42
3rd Table
BV CBV X Y S1 S2
7 9 0 0
43
Shadow price
• Shadow prices are values in the Z row of the final (optimal) simplex
table.
• It is a marginal value.
• It shows the impact that a one unit change in the amount of
constraint would have on the value of the objective function
44
Shadow prices
Negative of Shadow
prices 45
• From the above table one can clearly see that:
• If resource one is increased by one unit, there would be no effect on the
profit.
• If the second resource is increased by one unit, profit will increase by ten
birr and
• If the third resource is increased by one unit, profit will increase by 40/3
birr.
• shadow prices do not tell us by how much the level of scarce
resources can be increased and still have the same impact per unit
46
• resources with positive shadow prices as scarce goods (binding
constraints) and resources with zero shadow prices are free goods
(surplus resource).
• At some point, the ability to use additional resources will disappear
because of the fixed amounts of the other constraints.
• We need to determine the range over which we can change the
right hand side quantities and still have the same shadow prices.
• This is called range of feasibility/ right hand range
47
The Role of Sensitivity Analysis of
the Optimal Solution
• Is the optimal solution sensitive to changes in input parameters?
48
Sensitivity Analysis of
Objective Function Coefficients.
• Range of Optimality
• The range of optimality for each objective function coefficient
provides the range of values over which the current solution will
remain optimal.
• The optimal solution will remain unchanged as long as
• An objective function coefficient lies within its range of optimality
• There are no changes in any other input parameters.
49
Cont’d
50
Example
Consider:
Max! X1+ 2X2
Subject to: 2X1 + 3X2≤ 12
5X1 + 2X2 ≤ 15
X1, X2 ≥ 0
Solve using simplex method.
51
Optimal solution
1 2 0 0
BV CB X1 X2 S1 S2 RHS
V
X2 2 2/3 1 1/3 0 4
S2 0 11/3 0 -2/3 1 7
Z 4/3 2 2/3 0 8
C-Z -1/3 0 -2/3 0
52
Cont’d
53
For basic variable
55
Cont’d
• As you can see, the smallest negative ration (in terms of absolute
value) is -1/2 and there is no positive ratio.
• Hence, the coefficient of X2 can be reduced by 0.5 and increased
indefinitely without making it non basic.
56
Cont’d
57
Sensitivity Analysis of
Right-Hand Side Values
• a change in the right-hand side for a constraint may
affect the feasible region and perhaps cause a change
in the optimal solution to the problem
• In sensitivity analysis of right-hand sides of constraints
we are interested in the following questions:
• Keeping all other factors the same, how much would the
optimal value of the objective function (for example, the
profit) change if the right-hand side of a constraint changed
by one unit?
• For how many additional or fewer units will this per unit
change be valid?
58
Sensitivity Analysis of
Right-Hand Side Values
• Any change to the right hand side of a binding constraint will change
the optimal solution.
59
Cont’d
• To find range of feasibility for the right hand side, divide the entries in
associated the quantity column by slack column by the values.
• The smallest positive ratio indicates the allowable decrease and
negative ratio closest to zero indicates allowable increase
60
Cont’d
61
Cont’d
62
For second constraint
4/0=undefined
7/1=7
Hence, 15-7≤b2≤∞
8 ≤b2≤∞ Allowable decrease
63
Models Without Unique Optimal
Solutions
64
Infeasible Model
No point, simultaneously,
lies both above line 1 and
below lines 2 and 3
2
.
3 1
65
Solve the following using simplex method
• Maximize z=X1+2X2+X3
s.t. X1+(1/2)X2+(1/2)X3≤1
(3/2)X1+2X2+X3≥8
X1,X2,X3 ≥0
You arrive at an optimal solution while an artificial variable is still in the
basis.
66
Unbounded solution
the Ma
Ob x im
je ctiv ize
Th e Fu
reg e fea n ctio
ion sib n
le
67
Solve the following
68
Duality
69
Duality
• Every linear programming model can have two forms.
• The original formulation of the problem is referred to primal form.
• The other form is called the dual.
• The dual is the mirror image of the primal.
• Solution of the primal problem contains solution of the dual and
vice versa
70
Primal
Max c Xj
j j
s.t. a Xj
ij j bi for all i
Xj 0 for all j
Dual
Min U b
i
i i
s.t. U a
i
i ij c j for all j
Ui 0 for all i
71
Primal Dual Pair and Their Units
Primal
Max c X
j
j j
s.t. a X
j
ij j bi for all i
X j 0 for all j
where x is the variable and equals units sold
Dual
Min U b
i
i i
s.t. U a
i
i ij c j for all j
Ui 0 for all i
U is the variable and equals per unit resource value
74
Primal and dual
Primal Dual
• •
75
In matrix notation
Primal Dual
Max Z= CX Min Z= yb
S.t: AX≤ b S.t: Ay≥C
x≥ 0 y≥0
76
• Formulate a dual of:
Minimize 40X1 + 44X2 + 48X3
Subject to
X1+ 2X2+ 3X3 ≥ 20
4X1+4X2+4X3 ≥ 30
X1, X2, X3 ≥ 0
77
Maximize 20y1+30y2
Subject to:
1Y1+4Y2 ≤ 40
2y1+ 4Y2 ≤ 44
3Y1+ 4Y2 ≤ 48
Y1, Y2 ≥ 0
78
• Formulate the dual of:
Maximize 50X1 + 80X2
Subject to
3X1+ 5X2≤ 45
4X1+ 2X2≥ 16
6X1+ 6X2=30
6X1+6x2<=30
6X1+6X2>=30
79
Minimize 45y1-16y2+30y3-30y4
Subject to
3y1-4y2+6y3-6y4≥ 50
5y1-2y2+6y3-6y4≥ 80
y1, y2, y3, y4 ≥ 0
80
Primal and dual relationships
81
Comparing primal and dual simplex solution
• The solution quantities of the dual are equal to shadow prices of the
primal
• The values of the solution quantities of the primal can be found in
the bottom row of the dual.
82
Solve one of the models and read the solution
of the other form that.
83
• A firm, that assembles computers and
computer equipment, is about to start
production of two new micro computers. Each
type of microcomputer will require assembly
time inspection time and storage space. The
amount of each of these resources that can be
devoted to the production of the micro
computers is limited. The manager of the firm
would like to determine the quantity of each of
the microcomputers to produce in order to
maximize the profit generated by sales of these
microcomputers. The following additional
information is provided.
84
Type 1 Type 2
• Profit per unit 60 50
• Assembly time/unit 4hrs 10hrs
• Inspection time/unit 2hrs 1hrs
• Storage space/ unit 3 cubic feet 3 cubic feet
• Resources available
• Assembly time 100hrs
• Inspection time 22 hrs
• Storage space 39 cubic feet
85
Required
• Formulate the problem as Linear Programming model
• Solve using graphical method
• Solve using simplex method
• Find duality of the problem
• Compare the primal and dual
• Construct the range of optimality and feasibility for the objective
function coefficient and right hand side values.
• Interpret the shadow prices.
86
Cont’d
• Assume that the profit of type one product is 100 birr and that of
type two product is 50 birr per unit. Will the optimal solution
change?
• What if the profit contribution of type one and type are 50 and 50
birr each.
87