You are on page 1of 65

1

Linear Programming Models

©Prof. R N Bhattacharya
2

Contents
1. Steps in Developing a Linear Programming (LP) Model
2. Properties of LP Models
3. Basic Assumptions in LP
4. LP Solutions: Four Cases
5. Graphical Method
6. Special Situation in LP
7. Simplex Method
8. Big M Method
9. Two Phase Method
10. Duality in Linear Programming Problems
11. Introduction to Sensitivity Analysis

©Prof. R N Bhattacharya
3

Steps in Developing a Linear Programming (LP) Model

1) Formulation

2) Solution

3) Interpretation and Sensitivity Analysis

©Prof. R N Bhattacharya
4

Properties of LP Models

1) A single objective - minimize or maximize

2) Include “constraints” or limitations

3) There must be alternatives available

4) All equations are linear, all variables are continuous

©Prof. R N Bhattacharya
5

Basic Assumptions in LP
o Proportionality
o The contribution to the objective function from each decision variable is
proportional to the value of the decision variable
o The contribution of each decision variable to the LHS of each constraint
is proportional to the value of the decision variable
o Additivity
o The contribution to the objective function for any decision variable is
independent of the values of the other decision variables
o The contribution of a decision variable to LHS of each constraint is
independent of the values of other decision variables
o Divisibility
o Each decision variable is allowed to assume fractional values. If we
actually can not produce a fractional number of decision variables, we
use IP
o Certainty
o Each parameter is known with certainty
©Prof. R N Bhattacharya
6

LP Solutions: Four Cases

 When an LP is solved, one of the following four cases will occur:


1. The LP has a unique optimal solution.
2. The LP has alternative (multiple) optimal solutions. It has more than one
(actually an infinite number of) optimal solutions
3. The LP is infeasible. It has no feasible solutions (The feasible region contains
no points).
4. The LP is unbounded. In the feasible region there are points with arbitrarily
large (in a max problem) objective function values.

 Graphically,
o In the unique optimal solution case, isoprofit line last hits a point (vertex -
corner) before leaving the feasible region.
o In the alternative optimal solutions case, isoprofit line last hits an entire line
(representing one of the constraints) before leaving the feasible region.
o In the infeasible case, there is no feasible region.
o In the unbounded case, isoprofit line never lose contact with the feasible
region

©Prof. R N Bhattacharya
7

Linear Programming- Graphical Method

©Prof. R N Bhattacharya
8

Example: A Furniture Manufacturing Company


• A furniture company manufactures chairs tables. Each type requires
different amounts of construction time and painting time, as given in the
table below. The company wants to know how many of each type must be
produced in order to maximize profit.

Tables (X1) Chairs (X2)


(per table) (per chair)
Hours
Profit Contribution Rs.7 Rs.5
Available
Carpentry 3 hrs 4 hrs 2400
Painting 2 hrs 1 hr 1000

Other Limitations:
• Make no more than 450 chairs
• Make at least 100 tables

©Prof. R N Bhattacharya
9

Decision Variables:
Let
X1 = Number of tables to make
X2 = Number of chairs to make
Objective Function: Maximize Profit
Maximize 7 X1 + 5 X2
Constraints
• Have 2400 hours of carpentry time available
3 X1 + 4 X2 < 2400(hours)
• Have 1000 hours of painting time available
2 X1 + 1 X2 < 1000 (hours)
More Constraints: Non negativity:
• Make no more than 450 chairs Cannot make a negative number of
X2 < 450 chairs or tables
• Make at least 100 tables X1 > 0
X1 > 100 X2 > 0
©Prof. R N Bhattacharya
10

Model Summary

Maximize 7 X1 + 5 X2 (profit)
Subject to the constraints:
3 X1 + 4 X2 < 2400 (carpentry hrs)
2 X1 + 1 X2 < 1000 (painting hrs)
X2 < 450 (max # chairs)
X1 > 100 (min # tables)

X1, X2 > 0 (non negativity)

©Prof. R N Bhattacharya
11

Steps

• Step 1: Plot the constraints on a graph

• Step 2 : Locate all the corner points on the graph

• Step 3 : Test all corner points to see which yields maximum profit.

©Prof. R N Bhattacharya
12

X2
Carpentry Constraint Line
3 X1 + 4 X2 < 2400
Intercepts
(X1 = 0, X2 = 600) Infeasible
600 > 2400 hrs
(X1 = 800, X2 = 0)
3X
1 +
4X
2 =
24
00
Feasible
< 2400 hrs
0
0 800 X1

©Prof. R N Bhattacharya
13
X2
1000
Painting Constraint Line

2 X1
2 X1 + 1 X2 = 1000

+1
X2
Intercepts 600

=1
(X1 = 0, X2 = 1000)

000
(X1 = 500, X2 = 0)

0
0 500 800 X1

©Prof. R N Bhattacharya
14
X2
Max Chair Line 1000

X2 = 450

Min Table Line


X1 = 100
600
450

Feasible
Region
0
0 100 500 800 X1

©Prof. R N Bhattacharya
X2

7X
Objective Function Line

1
+5
7 X1 + 5 X2 = Profit

X2
=4
500

,04
0
Optimal Point
(X1 = 320, X2 =

7X
400
360)

1
+5
X2
7X
300

=2
1

,80
+5

0
X2
200

=2
,10
0
100

0
0 100 200 300 400 500 X 1
X2
Additional Constraint New optimal point
Need at least 75 more 500 X1 = 300, X2 = 375
chairs than tables
X2 > X1 + 75
Or 400 X1 = 320
X2 – X1 > 75 X2 = 360
Now infeasible
300

200

100

0 100 200 300 400 500 X 1


17

LP Characteristics

• Feasible Region: The set of points that satisfies all constraints

• Corner Point Property: An optimal solution must lie at one or more corner
points

• Optimal Solution: The corner point with the best objective function value is
optimal

©Prof. R N Bhattacharya
18

Special Situation in LP

1. Redundant Constraints - do not affect the feasible region

Example: x < 10
x < 12

The second constraint is redundant because it is less restrictive.


2. Infeasibility – when no feasible solution exists (there is no feasible
region)

Example: x < 10
x > 15

©Prof. R N Bhattacharya
Special Situation in LP

3. Alternate Optimal Solutions – when there is more than one optimal solution.
Note that if there are more than one optimal solution, there will be infinite number
of optimal solutions.

X2
Max 2X1 + 2X2

2X
10
Subject to:

1
+
X1 + X2 < 10

2X
All points on Blue

2
X1 < 5

=
20
X2 < 6 6 segment are optimal
X1, X2 > 0

0
0 5 10 X1
Special Situation in LP

4. Unbounded Solutions – when nothing prevents the solution from becoming


infinitely large

X2 t ion n
c
Max 2X1 + 2X2 ri e lutio
Subject to: D so
2X1 + 3X2 > 6 2 of
X1 , X 2 > 0

0
0 1 2 3 X1
21

Exercise

Alpha ltd. produces two products X and Y each requiring same production
capacity. The total installed production capacity is 9 tones per days. Alpha Ltd. Is
a supplier of Beta Ltd. Which must supply at least 2 tons of X & 3 tons of Y to
Beta Ltd. Every day. The production time for X and Y is 20 machine hour pr units
& 50 machine hour per unit respectively the daily maximum possible machine
hours is 360 profit margin for X & Y is Rs. 80 per ton and Rs. 120 per ton
respectively. Formulate as a LP model and use the graphical method of
generating the optimal solution for determining the maximum number of units of
X & Y, which can be produced by Alpha Limited.

©Prof. R N Bhattacharya
22

Note that the region of feasible solution shown in the following figure is bounded by
the graphs of the Linear equalities:
x 1+ x2 =9, x 1=2, x2 = 3 and 20x1 + 50x2 =360, and by the coordinates axes.

©Prof. R N Bhattacharya
23

©Prof. R N Bhattacharya
24

Simplex Method

©Prof. R N Bhattacharya
25
Simplex Method – Introduction

o Note that in the example considered of the graphical method, the optimal
solution occurred at a vertex (corner) of the feasible region. In fact it is true
that for any LP the optimal solution occurs at a vertex of the feasible region.
o This fact fact is the key to the simplex algorithm for solving LP's.
o The Simplex algorithm for solving LPP was developed by Dantzig in the late
1940’s and since then a number of different versions of the algorithm have been
developed. One of these later versions, called the revised simplex algorithm
(sometimes known as the "product form of the inverse" simplex algorithm) forms
the basis of most modern computer packages for solving LP's.
o Steps:
1. Convert the LP to standard form
2. Obtain a basic feasible solution (bfs) from the standard form
3. Determine whether the current bfs is optimal. If it is optimal, stop.
4. If the current bfs is not optimal, determine which nonbasic variable should
become a basic variable and which basic variable should become a
nonbasic variable to find a new bfs with a better objective function value
5. Go back to Step 3.
©Prof. R N Bhattacharya
26

Simplex Method – Introduction

• Related Concepts:

 Standard form: all constraints are equations and all variables are
nonnegative

 bfs: any basic solution where all variables are nonnegative

 Nonbasic variable: a chosen set of variables where variables


equal to 0

 Basic variable: the remaining variables that satisfy the system of


equations at the standard form

©Prof. R N Bhattacharya
27

Simplex Method - Example


• A furniture company manufactures 2 types of dining tables. Each type requires
different amounts of construction time and painting time, as given below. The
company wants to know how many tables of each type must be produced in order to
maximize profit.

Type 1 Type 2 Available


(hrs/month)
Decision variable x1 X2

Construction time 6 12 120


(hrs/table)

Painting time 8 4 64
(hrs/table)

Profit (Rupees/ 200 240


table)

©Prof. R N Bhattacharya
28

Simplex Method - Example

• The Model:

Max z = 200 x1 + 240 x2 (Objective function)


Subject to:
 6 x1 +12 x2 < 120
 8 x1 + 4 x2 < 64
 X1,x2 > 0

©Prof. R N Bhattacharya
29

Simplex method – Converting to standard form

Introducing slack variables s1 and s2 and modifying


objective function suitably:

Max z = 200 x1 + 240 x2 + 0 s1 + 0 s2


S.T
6 x1 + 12 x2 + s1 + 0 s2 = 120
8 x1 + 4 x2 + 0 s1 + s2 = 64

©Prof. R N Bhattacharya
30
Starting simplex table

Label BV x1 x2 s1 s2 Value Value/Coefficient Formula

a0 s1 6 12 1 0 120 120/12 = 10

b0 s2 8 4 0 1 64 64/4 = 16

O0 z -200 -240 0 0 0

Interpretation of coefficients in row O:


Each coefficient represents the increase (for –ve coeff.) or decrease (for + ve coeff.) in Z with
a unit increase of the associated non-basic variable.
©Prof. R N Bhattacharya
31
Simplex table - Pivoting

Pivot Number Entering


Variable
Label BV x1 x2 s1 s2 Value Value/Coefficient Formula

a0 s1 6 12 1 0 120 120/12 = 10

b0 s2 8 4 0 1 64 64/4 = 16

O0 z -200 -240 0 0 0

Leaving variable
Pivot row = lowest value
Pivot column = lowest in V/C
value in z row ©Prof. R N Bhattacharya
32
Simplex table – Iteration 1

Make the pivot number = 1 and the vales of all other cells in pivot column = zero
through elementary operations

Label BV x1 x2 s1 s2 Value V/ Formula


C

a1 x2 6/12 = 1/2 1/12 0/12 = 120/12 - a1=a0/12


12/12 = 0 =10
1
b1 s2 8- 4-4x1= 0- 1-4x 64- 4x - b1= b0 – 4a1
4x(6/12)= 0 4x(1/12 (0) = 10 = 24
6 )= 1
-4/12
O1 z -200+(240x -240+ 0+240x 0+ 0 O1= O0+240a1
½) = (240x1) 1/12 = 240x0 +240x10
-80 = 20 = =
0 0 2400

New Pivot col. For Iteration 2 ©Prof. R N Bhattacharya


(most –ve in z row)
33
Simplex table – Iteration 2
Make the pivot number = 1 and the vales of all other cells in pivot column = zero
through elementary operations

Label BV x1 x2 s1 s2 Value V/C Formula

10-
½-(½)x1 = 1-(½)x0 1/12 – 0- ½)x
a2 x2 (½)x4= a2=a1 – (½)b2
0 =1 (½) x (-1/18) (1/6)
8

b2 x1 0/6 = (-1/3) 1/6 24/6 = b2= b1/6


6/6 = 1 0 x(1/6)= 4
- 1/18

O2 z -80+80x1= 0+80x0 20 + 80x 0+80x 2400+ O2= O1+80b2


0 = (-1/18)= (1/6)= 80x4=
0 280/18 80/6 2720

All values in Z row are non-negative, hence this is optimal solution.


Make 4 units of x1 and 8 units of x2, max. profit = 2720 ©Prof. R N Bhattacharya
34

Big M Method

(Charnes Method of Penalties)

©Prof. R N Bhattacharya
35

Big M Method (Charnes method of penalties)

The original problem:


Let:
Max z = 3x1 – x2
A = an artificial variable
ST: 2 x1 + x2 > 2
s1 = a surplus variable
x1 + 3 x2 < 3
s2 and s3 = slack variable
x2 <4
x1,x2 > 0
Adding slack, surplus and artificial variables and writing the problem in
standard form, we get:
Max z = 3 x1 – x2 + 0 s1 + 0 s2 + 0 s3 – M A
ST: 2 x1 + x 2 – s 1 + A = 2
Big M
x1 + 3 x2 + s2 = 3
x 2 + s3 = 4 ©Prof. R N Bhattacharya
36
Big M Method – Initial Operation – Eliminate M

Label BV x1 x2 s1 s2 s3 A Val V/C Formula

a0 A 2 1 -1 0 0 1 2

b0 s2 1 3 0 1 0 0 3

c0 s3 0 1 0 0 1 0 4

O0* z -3 1 0 0 0 M 0

O0 = O0* - M a0
O0 z -3 – 2M 1-M M 0 0 0 -2M

The initial operations removes M from the Z row of artificial variable vector using
formula O0 = O0* - M a0. This gives us the starting table, as shown in next slide .
©Prof. R N Bhattacharya
37

Pivot number Big M Method – Pivoting and solving Minimum

Label BV x1 x2 s1 s2 s3 A Val V/C Formula

a0 A 1 -1 0 0 1 2 2/2=1
2

b0 s2 1 3 0 1 0 0 3 3/1=3

4/0
c0 s3 0 1 0 0 1 0 4 Ignore

O0 z -3 – 2M 1-M M 0 0 0 -2M

Most negative

Now, proceed as in normal simplex method. The most – ve Z row value is


–3 – 2M, hence it becomes the pivot column and V/C=1 is minimum so it is pivot
row.
Solving, after two iterations, the optimal solution is found to be:
©Prof. R N Bhattacharya
X1 = 3, x2 = 0, Max Z = 9 . (In the final table, s1=4, s3 = 4)
38

Some Notes on artificial variables

• Artificial Variable:
The idea of using artificial variable calls for adding a non negative variable
to the left side of each equation that has no obvious starting basic variable.

• However, since such artificial variables have no physical meaning from the
standpoint of the original problem (hence the name ‘artificial’), the procedure
will be valid only if we force these variables to be zero when the optimum is
reached.

• Hence, in the optimal table (optimal table = all coefficients in the objective
function are non negative), if the artificial variable remained in the ‘basis’
(basis = the variables appearing in the BV column as Basic Variable) with a
positive value, it means there is no feasible solution to the problem.

• There are two methods based on the idea of artificial variables. The first is
the Big M method, and the second is called the Two Phase Technique.

©Prof. R N Bhattacharya
39

Some Notes on artificial variables

Artificial Variables are also used when we have a constraint equation


with equality sign. For example:

Min Z = 4 x1 + x2
Subj.To. : 3x1 + x2 = 3
x1 + 2 x2 =< 4
x1, x2 > 0
Is written as :
Min Z = 4 x1 + x2 + 0 S1 – M A
Subj.To. 3x1 + x2 + A = 3
x 1 + 2 x 2 + s1 = 4
x1, x2 > 0 ©Prof. R N Bhattacharya
40

Two Phase Method

©Prof. R N Bhattacharya
41
Two Phase Method

• A drawback of the Big-M method is the possible computational error that


could result from assigning a very large value to the constant M while
solving on a digital computer.

• For example suppose M = 1,00,000. Then if in the objective function row we


have –4+M it would be (-4+7,00,000).

• The effect of the original coefficient ‘4’ is now too small relative to the large
number created by the multiple of M.

• Because of round-off error, which is inherent in any digital computer, the


computation may become insensitive to the relative value of the original
objective function coefficient.

• The dangerous outcome is that the variables x1, x2 etc. may be treated as
having zero coefficients in the objective function.

• The Two Phase Method is designed to alleviate this difficulty. Although the
artificial variables are added in the same manner, the use of the constant M
is eliminated by solving the problem in two phases.
©Prof. R N Bhattacharya
42
Two Phase Method

Phase 1

1. Augment the artificial variables as necessary to secure a starting


solution.
2. Form a new objective function which seeks the minimization of the sum
of the artificial variables subject to the constraints of the original problem,
modified by the artificial variables.

If the minimum value of the new objective function is zero


(meaning that all artificials are zero, whether in the basis or
otherwise), the problem has a feasible solution space.

3. Go to Phase 2.
4. Otherwise, if the minimum is positive (I.e. max. is –ve), the problem has
no feasible solution, hence STOP.

Phase 2
Use the optimum basic solution of phase 1 as a starting point for the
original problem. ©Prof. R N Bhattacharya
43

Two Phase Method - Example

Min Z = 4 x1 + x2
Subj To 3 x1 + x2 = 3 ……(1) Introduce Artificial Variables A1 into
equation 1, Artificial variable A2 and
4 x1 + 3 x2 > 6 …(2) surplus variable s1 into equation 2 and
x1 + 2 x2 < 4 ……(3) slack variable s2 into equation 3.

x1, x2 > 0
We have : The new objective function to
3 x1 + x2 + A1 =3 ……………….(1) be MINIMIZED is the sum of
the artificial variables.
4 x1 + 3 x2 – s1 + A2 = 6 ……….(2)
Thus Min A = A1 + A2
x1 + 2 x2 + s2 = 4 ……………..(3)
From (1) A1 = 3 – 3 x1 – x2
From (2) A2 = 6 – 4 x1 – 3 x2 + s1
Substituting, we have the new objective function is ©Prof. R N Bhattacharya
44

Two Phase Method - Example

Thus the problem in Phase 1 is :


Min A = 9 – 7 x1 – 4 x2 + s1
Subj To 3 x1 + x2 + A1 =3 ……………….(1)
4 x1 + 3 x2 – s1 + A2 = 6 ……….(2)
x1 + 2 x2 + s2 = 4 ……………..(3)
x1, x2,s1,s2,A1,A2 > 0
Converting to maximization (by multiplying the RHS of objective function with –1) we
have Max A* = - 9 + 7 x1 + 4 x2 - s1 , or
The starting solution is:
Max A* – 7 x1 – 4 x2 + s1 = -9
A1 = 3, A2 =6, s2 =4
Subj To 3 x1 + x2 + A1 =3 ……………….(1)
and starting value of objective
4 x1 + 3 x2 – s1 + A2 = 6 ……….(2) function A* = - 9
x1 + 2 x2 + s2 = 4 ……………..(3)
©Prof. R N Bhattacharya
x1, x2,s1,s2,A1,A2 > 0
45
Two Phase Method - Example

Using Simplex method to solve this Phase 1 problem, after two iterations we get the
following optimal simplex table:

x2
Label BV x1 A1 A2 s1 s2 Val

x1
a2 1 0 3/5 -1/5 1/5 0 3/5
Opt. Solution to Phase 1:
x1= 3/5, x2=6/5, s2= 1
x2
b2 0 1 -4/5 3/5 -3/5 0 6/5
Max A* = 0 = (-Min A) = 0

s2 Since Min A = 0, the problem


c2 0 0 1 -1 1 1 1 has a feasible solution and
we can move to phase 2.

O2 A* 0 0 1 1 0 0 0

©Prof. R N Bhattacharya
46
Phase 2

• Step 1
With the help of the optimal table of phase 1, write the equivalent constraint
equations, noting that the optimal table is nothing but equations written in detached
coefficient form. Thus we have:

1x1 +0 x2 +(3/5)A1 – (1/5)A2 + (1/5)s1 + 0 s2 = 3/5


0x1 +1 x2 -(4/5)A1 + (3/5)A2 - (3/5)s1 + 0 s2 = 6/5
0x1 +0 x2 +(1)A1 - (1)A2 + (1)s1 + (1) s2 = 1

• Step 2
Since artificial variables have served their purpose in phase 1, rewrite the constraints
neglecting the artificial variables. This gives:
x1 + (1/5)s1 = 3/5
x2 - (3/5)s1 = 6/5
s1 + s2 =1

• Our starting basis is x1 = 3/5, x2 = 6/5, s2 = 1

• The Original Obj. Function is Min Z = 4 x1 + x2

©Prof. R N Bhattacharya
47

Phase 2

• Step 3
Since x1 and x2 are in the basis, eliminate them from objective function by
using the constraint equations.
The constraint equations give:
x1 = 3/5 – (1/5)s1 and x2 = 6/5 + (3/5)s1
Substituting these in objective function, we have the following modified
obj.fn.:

Min Z = 18/5 – (1/5)S1 or Max Z* = (1/5) S1 – (18/5)

• The LPP can thus be written as:

Max Z* = (1/5) S1 – (18/5)

Subj.to x1 + (1/5)s1 = 3/5


x2 - (3/5)s1 = 6/5
s1 + s2 =1

©Prof. R N Bhattacharya
Phase 2 simplex table 48

Most -ve

Label BV x1 x2 s1 s2 Value V/C

x1 (3/5) / (1/5)
a0 1 0 1/5 0 3/5
=3

(6/5) / (-3/5) =
b0 x2 0 1 -3/5 0 6/5 -ve value so
neglect it

c0 s2 0 0 1 1 1 1/1 = 1

O0 Z* 0 0 -1/5 0 -18/15

a1 x1 1 0 0 -1/5 2/5 a1=a0 - (1/5) c1

b1 x2 0 1 0 3/5 9/5 b1=b0 + (3/5) c1

c1 s1 0 0 1 1 1 C1 = c0

O1 Z* 0 0 0 1/5 -17/5 O1 = O0 + (1/5) c2

All values in row O1 are non-negative, hence the optimal ©Prof. R N Bhattacharya
solution is x1= 2/5, x2=9/5, s1=1,s2=0, Min Z = - Max Z* = 17/5
49

Duality in Linear Programming


Problems

The Duality Theorem


“For every maximization (or, minimization) problem in
linear programming, there is a unique similar problem
of minimization (or, maximization) involving the same
data which describes the original problem.”

©Prof. R N Bhattacharya
50

Duality in Linear Programming Problems


• For every LPP there is a corresponding LPP called the dual.

• If the original problem is a maximization problem then the dual problem is


minimization problem and if the original problem is a minimization problem
then the dual problem is maximization problem.

• In either case the final table of the dual problem will contain both the
solution to the dual problem and the solution to the original problem.

• The solution of the dual problem is readily obtained from the original
problem solution if the simplex method is used.

• The formulation of the dual problem, also sometimes referred as the


concept of duality, is helpful for the understanding of the linear
programming. The variables of the dual problem are known as the dual
variables or shadow prices of the various resources.

©Prof. R N Bhattacharya
51

Rules for writing Duals

1. Define a Dual Variable for each Primal (Constraint) equation.


2. Define a Dual Constraint for each Primal Variable.
3. The constraint (column) coefficients of a primal variable defines the left
hand side coefficients of the dual constraint and its objective coefficient
define the right-hand side.
4. The objective coefficients of the dual equal the right-hand side of the
primal constraint equations.

Considerations:
• If a constraint in Primal has an equal sign, the corresponding Dual
Variable is Unrestricted.
• If a Primal is a Maximization (or Minimization) Problem, the
corresponding Dual is Minimization (or Maximization).
• The sign of a Dual Variable is same as its Primal Constraint if it is a Dual
Maximization.
• The sign of a Dual Variable is opposite of its Primal Constraint if it is a
Dual Minimization.

©Prof. R N Bhattacharya
52

Rules for writing Duals


• For Minimization Primal
 The constraints should be having sign ‘≥’
 If it is ‘<’ then make it ‘≥’ by multiplying the constraint by ‘-1’ on both sides
 Then form the dual in normal way. After that, replace the variable multiplied with
‘-1’. Example: Y1=-Y2.
• For Maximization Primal
 The constraints should be having sign ‘<’
 Follow the same process to change the sign if there is ‘>’ in the constraint.
• If there is ‘=’ sign then form 2 constraints one with ‘≥’ and the other with ‘<’
 Example: 2X1+3X2+5X3=120
 form two constraints as follows:
o 2X1+3X2+5X3 < 120
o 2X1+3X2+5X3 > 120
 The 2 constraints thus formed would gives the ‘=’ constraint.
 There will be 2 dual variables now. They will be of form Y1-Y2. Replace
them with a single variable Y3 and since Y1-Y2 can give any value, Y3 will
be unrestricted.

©Prof. R N Bhattacharya
53

Rules for writing Duals


Sl.No. Primal Dual
Dual Primal
Maximization Minimization
1 Constraints Variables
2 ≥  ≤0
3 ≤  ≥0
4 =  Unrestricted
5 Variables Constraints
6 ≥0  ≥
7 ≤ 0  ≤
8 Unrestricted  =

©Prof. R N Bhattacharya
54

Some Examples of Primal-Dual

Primal-1 Dual-1
Max Z = 200 X1 + 240 X2 Min C = 120 y1 + 64 y2
S.T. 6 X1 + 12 X2 < 120 S.T 6 y1 + 8 y2 > 200
8 X1 + 4 X2 < 64 12 y1 + 4 y2 > 240
X1, X2 > 0 y1, y2 > 0

Primal-2 Dual-2
Max Z = 40 X1 + 60 X2 Min C = 2000 y1 + 1000 y2
S.T. 3 X1 + 2 X2 < 2000 S.T 3 y1 + y2 > 40
X1 + 2 X2 < 1000 2 y1 + 2 y2 > 60
X1, X2 > 0 y1, y2 > 0

©Prof. R N Bhattacharya
55

Understanding Duality

Consider the furniture shop example with the following formulation:


Max Z = 200 X1 + 240 X2
S.T. 6 X1 + 12 X2 < 120 ….. Construction constraint … (y1)
8 X1 + 4 X2 < 64 …….. Painting constraint ……..(y2)
X1, X2 > 0
Suppose our goal was to know the base minimum prices at
Dual formulation: which the company could rent out these two departments to
outside parties.
Min C = 120 y1 + 64 y2
Let y1 and y2 be the rents per hour at which the company is
S.T 6 y1 + 8 y2 > 200 willing to rent out. Then the total monthly rental is:
12 y1 + 4 y2 > 240 C = 120 y1 + 64 y2.
y1, y2 > 0 The lowest value of this is the minimum that the company
should charge, hence the obj. fn. Is Min (C)

©Prof. R N Bhattacharya
56

Understanding Duality – contd.

• The rents y1 and y2 should be competitive with available alternatives. The


available alternative is to produce X1 and X2 units of furniture using the
construction and painting resources.

• For example, since 6 hrs of construction and 8 hrs of painting time are
needed to produce one unit of X1, the valuation of these two resources, if
they are to be rented out, would be 6 y1 + 8 y2, and this total rental value
must be > 200 (which is the profit obtained from Type 1 furniture).

• Hence one of the constraints is 6 y1 + 8 y2 > 200. Using similar reasoning


for the resources of type 2 furniture, we get 12 y1 + 4 y2 > 240

• Also, we can not have any negative rents per hour, hence y1, y2 >0

©Prof. R N Bhattacharya
57

Shadow Costs and Shadow Prices


• Shadow Costs
The coefficients of the Z row in the optimal simplex table of the original variables are
called shadow costs.
• Shadow Prices
In the optimal table, the Z row coefficients of the slack variables are called shadow prices
for the corresponding scarce resource.

• Example: Below is the optimal simplex table:

BV X1 X2 X3 X4 S1 S2 S3 Val
X1 1 5/7 0 -5/7 10/7 0 -1/7 50/7
S2 0 -6/7 0 13/7 -61/7 1 4/7 325/7
X3 0 2/7 1 12/7 -3/7 0 1/7 55/7

Z 0 3/7 0 11/7 13/7 0 5/7 695/7

Shadow Costs Shadow Prices

©Prof. R N Bhattacharya
58

Understanding Shadow costs and prices


BV X1 X2 X3 X4 S1 S2 S3 Val
X1 1 5/7 0 -5/7 10/7 0 -1/7 50/7
S2 0 -6/7 0 13/7 -61/7 1 4/7 325/7
X3 0 2/7 1 12/7 -3/7 0 1/7 55/7

Z 0 3/7 0 11/7 13/7 0 5/7 695/7

Suppose we decide to set X2= 1. The shadow cost (3/7) in the Z row under the
variable X2 tells us that the value of Z would decrease by 3/7
Again, the shadow price of S1 is 13/7. It indicates that if the first scarce resource
(I.e. the first constraint) can somehow be improved by one unit (i.e. the RHS of
the first constraint is increased by 1 unit) this will improve the profit level by 13/7.
Note however that since S2 is in the basis of the opt. table, any improvement in
the second resource (second constraint) will not improve the profit. This is
evident from the value of the shadow cost for S2 being equal to zero as above.

©Prof. R N Bhattacharya
59

Finding solution of Dual from the solution of


the primal

Find the solution of the dual model from the solution of the primal model when the primal is:
Max Z = 5 X1 + 70 X2
Subj. to 3 X1 + 2 X2 < 2000
x1 + 2 x2 < 1000 , X1, X2 > 0
The final simplex table is:

BV X1 X2 S1 S2 Value The opt. value of C, y1 and y2 are found as


follows:
S1 2 0 1 -1 1000 y1 = Coeff. Of S1 in Z row =0
X2 1/2 1 0 1/2 500 y2 = Coeff. Of S2 in Z row = 35
Z 30 0 0 35 35000 Min cost C = Value of Z = 35,000

©Prof. R N Bhattacharya
60

Introduction to Sensitivity Analysis

©Prof. R N Bhattacharya
61

Sensitivity Analysis

• Sensitivity analysis is concerned with studying possible changes in the


available optimal solution as a result of making changes in the original
model.
• There could be five basic types of changes in the original model:
1. Changes in the right hand side constants b i – It affects feasibility
2. Changes in the cost coefficient of objective function c j – It affects optimality
3. Changes in the coefficients of the technology matrix c ij – It affects optimality
4. Addition of new variable – It affects both optimality and feasibility
5. Addition of new constraint – It affects feasibility
• In General, when a parameter is changed, it results in one of the
following three cases:
 The optimal solution remains unchanged
 The basic variables remain the same but their values are changed
 The basic variables as well as their values are changed.

©Prof. R N Bhattacharya
62

Sensitivity Analysis – An illustration

Max Z = 3 X1 + 4 X2 + X3 + 7 X4
Subj. to 8 X1 + 3 X2 + 4 X3 + X4 < 7 Requirement
2 X1 + 6 X2 + X3 + 5 X4 < 3 Vectors

X1 + 4 X2 + 5 X3 + 2 X4 < 8
Xi > 0 I = 1,2,3,4

Find the limits between which the


elements of the requirement vector (7,3,8)
can be changed one at a time so that an
optimal solution may still be obtained

©Prof. R N Bhattacharya
63

Sensitivity Analysis – An illustration

Starting Table BV X1 X2 X3 X4 S1 S2 S3 Val


S1 8 3 4 1 1 0 0 7
S2 2 6 1 5 0 1 0 3
S3 1 4 5 2 0 0 1 8
Z -3 -4 -1 -7 0 0 0 0

BV X1 X2 X3 X4 S1 S2 S3 Val
Final Optimal Table
X1 1 9/38 1/2 0 5/38 -1/38 0 16/19
X4 0 21/19 0 1 -1/19 8/38 0 5/19
S3 0 59/38 9/2 0 -1/38 -15/38 1 126/19
Z 0 169/38 1/2 0 1/38 53/38 0 83/19

©Prof. R N Bhattacharya
64

Sensitivity Analysis – An illustration

The current optimal values are X1=16/19, X4=5/19 and S3=126/19.


Let the RHS of the first constraint be changed from 7 to 7 + b1.
Notice that S1 is associated with the first constraint, hence look up the
coefficient under the S1 column in the final table.
These are (5/38,-1/19,-1/38).
So, a change of b1 in RHS of first constraint will change the values of the
current basic variables (optimal) as follows:
X1 will be changed from 16/19 to (16/19) + (5/38) b1
X4 will be changed from 5/19 to (5/19) - (1/19) b1
S3 will be changed from 126/19 to (126/19) - (1/38) b1
Imposing non-negativity constraints for X1,X4,S3 we get three inequalities
as discussed in next slide.

©Prof. R N Bhattacharya
65

Sensitivity Analysis – An illustration


• (16/19) + (5/38) b1 > 0  b1 > -32/5
(5/19) - (1/19) b1 > 0  b1 < 5
(126/19) - (1/38) b1 > 0  b1 < 252
The third inequality is redundant as b1 < 5 implies b1 < 252
Hence:
If the RHS of the first constraint is changed within the range
-32/5 < b1 < 5
the present basic variable will remain feasible.

• Similarly, the range of the others may be found.

©Prof. R N Bhattacharya

You might also like