Linear Programming for MBA Students

65
©Prof. R N Bhattacharya 1 Linear Programming Linear Programming Models Models

description

For MBA students, Graphical,Simplex,Big M, Two phase, Duality, Shadow costs, Sensitivity analysis.

Transcript of Linear Programming for MBA Students

Page 1: Linear Programming for MBA Students

©Prof. R N Bhattacharya

1

Linear Programming ModelsLinear Programming Models

Page 2: Linear Programming for MBA Students

©Prof. R N Bhattacharya

2

ContentsContents

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

Page 3: Linear Programming for MBA Students

©Prof. R N Bhattacharya

3

Steps in Developing a Linear Programming (LP) ModelSteps in Developing a Linear Programming (LP) Model

1) Formulation

2) Solution

3) Interpretation and Sensitivity Analysis

Page 4: Linear Programming for MBA Students

©Prof. R N Bhattacharya

4

Properties of LP ModelsProperties 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

Page 5: Linear Programming for MBA Students

©Prof. R N Bhattacharya

5

Basic Assumptions in LPBasic 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

Page 6: Linear Programming for MBA Students

©Prof. R N Bhattacharya

6

LP Solutions: Four CasesLP 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 solutions3. 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

Page 7: Linear Programming for MBA Students

©Prof. R N Bhattacharya

7

Linear Programming- Linear Programming- Graphical Method

Page 8: Linear Programming for MBA Students

©Prof. R N Bhattacharya

8

Example: A Furniture Manufacturing CompanyExample: 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.

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

Tables (X1)

(per table)

Chairs (X2)

(per chair)

Hours Available

Profit Contribution Rs.7 Rs.5

Carpentry 3 hrs 4 hrs 2400

Painting 2 hrs 1 hr 1000

Page 9: Linear Programming for MBA Students

©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:• Make no more than 450 chairs

X2 < 450• Make at least 100 tables

X1 > 100

Non negativity:Cannot make a negative number of chairs or tables

X1 > 0

X2 > 0

Page 10: Linear Programming for MBA Students

©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)

Page 11: Linear Programming for MBA Students

©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.

Page 12: Linear Programming for MBA Students

©Prof. R N Bhattacharya

12

Carpentry Constraint Line 3 X1 + 4 X2 < 2400

Intercepts

(X1 = 0, X2 = 600)

(X1 = 800, X2 = 0)

0 800 X1

X2

600

0

Feasible

< 2400 hrs

Infeasible

> 2400 hrs3X

1 + 4X2 = 2400

Page 13: Linear Programming for MBA Students

©Prof. R N Bhattacharya

13

Painting Constraint Line

2 X1 + 1 X2 = 1000

Intercepts

(X1 = 0, X2 = 1000)

(X1 = 500, X2 = 0)

0 500 800 X1

X2

1000

600

0

2 X1 + 1 X

2 = 1000

Page 14: Linear Programming for MBA Students

©Prof. R N Bhattacharya

14

0 100 500 800 X1

X2

1000

600

450

0

Max Chair Line

X2 = 450

Min Table Line

X1 = 100

Feasible

Region

Page 15: Linear Programming for MBA Students

0 100 200 300 400 500 X1

X2

500

400

300

200

100

0

Objective Function Line

7 X1 + 5 X2 = Profit

7 X1 + 5 X

2 = 2,100

7 X1 + 5 X

2 = 4,040

Optimal Point(X1 = 320, X2 =

360)

7 X1 + 5 X

2 = 2,800

Page 16: Linear Programming for MBA Students

0 100 200 300 400 500 X1

X2

500

400

300

200

100

0

Additional Constraint

Need at least 75 more chairs than tables

X2 > X1 + 75

Or

X2 – X1 > 75

X1 = 320

X2 = 360

Now infeasible

New optimal pointX1 = 300, X2 = 375

Page 17: Linear Programming for MBA Students

©Prof. R N Bhattacharya

17

LP CharacteristicsLP 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

Page 18: Linear Programming for MBA Students

©Prof. R N Bhattacharya

18

Special Situation in LPSpecial 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

Page 19: Linear Programming for MBA Students

Special Situation in LPSpecial 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.

Max 2X1 + 2X2

Subject to:X1 + X2 < 10X1 < 5 X2 < 6

X1, X2 > 0

0 5 10 X1

X2

10

6

0

2X1 + 2X

2 = 20 All points on Blue segment are optimal

Page 20: Linear Programming for MBA Students

Special Situation in LP

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

infinitely large

Max 2X1 + 2X2

Subject to: 2X1 + 3X2 > 6

X1, X2 > 0

0 1 2 3 X1

X2

2

1

0

Directi

on

of solutio

n

Page 21: Linear Programming for MBA Students

©Prof. R N Bhattacharya

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.

Page 22: Linear Programming for MBA Students

©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.

Page 23: Linear Programming for MBA Students

©Prof. R N Bhattacharya

23

Page 24: Linear Programming for MBA Students

©Prof. R N Bhattacharya

24

Simplex MethodSimplex Method

Page 25: Linear Programming for MBA Students

©Prof. R N Bhattacharya

25Simplex 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.

Page 26: Linear Programming for MBA Students

©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

Page 27: Linear Programming for MBA Students

©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 (hrs/table)

6 12 120

Painting time (hrs/table)

8 4 64

Profit (Rupees/ table)

200 240

Page 28: Linear Programming for MBA Students

©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

Page 29: Linear Programming for MBA Students

©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

Page 30: Linear Programming for MBA Students

©Prof. R N Bhattacharya

30Starting 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.

Page 31: Linear Programming for MBA Students

©Prof. R N Bhattacharya

31Simplex table - Pivoting

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

Pivot column = lowest value in z row

Pivot row = lowest value in V/C

Pivot Number Entering Variable

Leaving variable

Page 32: Linear Programming for MBA Students

©Prof. R N Bhattacharya

32Simplex table – Iteration 1

Label BV x1 x2 s1 s2 Value V/C

Formula

a1 x2 6/12 = 1/2

12/12 = 1

1/12 0/12 = 0

120/12 =10

- a1=a0/12

b1 s2 8-4x(6/12)=

6

4-4x1=

0

0-4x(1/12

)=

-4/12

1-4x (0) =

1

64- 4x 10 = 24

- b1= b0 – 4a1

O1 z -200+(240x ½) =

-80

-240+ (240x1)

=

0

0+240x 1/12 =

20

0+ 240x0

=

0

0 +240x10

=

2400

O1= O0+240a1

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

New Pivot col. For Iteration 2 (most –ve in z row)

Page 33: Linear Programming for MBA Students

©Prof. R N Bhattacharya

33

Simplex table – Iteration 2

Label BV x1 x2 s1 s2 Value V/C Formula

a2 x2½-(½)x1 =

01-(½)x0

= 1

1/12 –

(½) x (-1/18)0- ½)x (1/6)

10-(½)x4=

8

a2=a1 – (½)b2

b2 x1

6/6 = 1

0/6 =

0

(-1/3)

x(1/6)=

- 1/18

1/6 24/6 =

4

b2= b1/6

O2 z -80+80x1= 0

0+80x0=

0

20 + 80x

(-1/18)=

280/18

0+80x

(1/6)=

80/6

2400+

80x4=

2720

O2= O1+80b2

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

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

Page 34: Linear Programming for MBA Students

©Prof. R N Bhattacharya

34

Big M MethodBig M Method

(Charnes Method of Penalties)

Page 35: Linear Programming for MBA Students

©Prof. R N Bhattacharya

35

Big M Method (Charnes method of penalties)

The original problem:

Max z = 3x1 – x2

ST: 2 x1 + x2 > 2

x1 + 3 x2 < 3

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 + x2 – s1 + A = 2

x1 + 3 x2 + s2 = 3

x2 + s3 = 4

Let:

A = an artificial variable

s1 = a surplus variable

s2 and s3 = slack variable

Big M

Page 36: Linear Programming for MBA Students

©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 z -3 – 2M 1 - M M 0 0 0 -2MO0 = O0* - M a0

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.

Page 37: Linear Programming for MBA Students

©Prof. R N Bhattacharya

37

Big M Method – Pivoting and solving

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

a0 A2

1 - 1 0 0 1 2 2/2=1

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

c0 s3 0 1 0 0 1 0 44/0

Ignore

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

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:

X1 = 3, x2 = 0, Max Z = 9 . (In the final table, s1=4, s3 = 4)

Most negative

MinimumPivot number

Page 38: Linear Programming for MBA Students

©Prof. R N Bhattacharya

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.

Page 39: Linear Programming for MBA Students

©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

x1 + 2 x2 + s1 = 4

x1, x2 > 0

Page 40: Linear Programming for MBA Students

©Prof. R N Bhattacharya

40

Two Phase MethodTwo Phase Method

Page 41: Linear Programming for MBA Students

©Prof. R N Bhattacharya

41

Two Phase MethodTwo 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.

Page 42: Linear Programming for MBA Students

©Prof. R N Bhattacharya

42

Two Phase MethodTwo 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.

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.

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.

Page 43: Linear Programming for MBA Students

©Prof. R N Bhattacharya

43

Two Phase Method - ExampleTwo Phase Method - Example

Min Z = 4 x1 + x2

Subj To 3 x1 + x2 = 3 ……(1)

4 x1 + 3 x2 > 6 …(2)

x1 + 2 x2 < 4 ……(3)

x1, x2 > 0

We have :

3 x1 + x2 + A1 =3 ……………….(1)

4 x1 + 3 x2 – s1 + A2 = 6 ……….(2)

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

Min A = 9 – 7 x1 – 4 x2 + s1

Introduce Artificial Variables A1 into equation 1, Artificial variable A2 and surplus variable s1 into equation 2 and slack variable s2 into equation 3.

The new objective function to be MINIMIZED is the sum of the artificial variables.

Thus Min A = A1 + A2

Page 44: Linear Programming for MBA Students

©Prof. R N Bhattacharya

44

Two Phase Method - ExampleTwo 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

Max A* – 7 x1 – 4 x2 + s1 = -9

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

The starting solution is:

A1 = 3, A2 =6, s2 =4

and starting value of objective function A* = - 9

Page 45: Linear Programming for MBA Students

©Prof. R N Bhattacharya

45

Two Phase Method - ExampleTwo Phase Method - Example

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

Label BV x1

x2 A1 A2 s1 s2 Val

a2

x11 0 3/5 -1/5 1/5 0 3/5

b2

x20 1 -4/5 3/5 -3/5 0 6/5

c2

s20 0 1 -1 1 1 1

O2 A* 0 0 1 1 0 0 0

Opt. Solution to Phase 1:x1= 3/5, x2=6/5, s2= 1

Max A* = 0 = (-Min A) = 0

Since Min A = 0, the problem has a feasible solution and we can move to phase 2.

Page 46: Linear Programming for MBA Students

©Prof. R N Bhattacharya

46

Phase 2Phase 2

• Step 1With 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/50x1 +1 x2 -(4/5)A1 + (3/5)A2 - (3/5)s1 + 0 s2 = 6/50x1 +0 x2 +(1)A1 - (1)A2 + (1)s1 + (1) s2 = 1

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

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

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

Page 47: Linear Programming for MBA Students

©Prof. R N Bhattacharya

47

Phase 2Phase 2

• Step 3Since 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/5x2 - (3/5)s1 = 6/5s1 + s2 = 1

Page 48: Linear Programming for MBA Students

©Prof. R N Bhattacharya

48Phase 2 Phase 2 simplex table

Label BV x1 x2 s1 s2 Value V/C

a0

x11 0 1/5 0 3/5

(3/5) / (1/5)

= 3

b0 x2 0 1 -3/5 0 6/5(6/5) / (-3/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

Most -ve

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

Page 49: Linear Programming for MBA Students

©Prof. R N Bhattacharya

49

Duality in Linear Programming Duality in Linear Programming ProblemsProblems

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

Page 50: Linear Programming for MBA Students

©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.

Page 51: Linear Programming for MBA Students

©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.

Page 52: Linear Programming for MBA Students

©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 < 120o 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.

Page 53: Linear Programming for MBA Students

©Prof. R N Bhattacharya

53

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 =

Rules for writing Duals

Page 54: Linear Programming for MBA Students

©Prof. R N Bhattacharya

54

Some Examples of Primal-Dual

Primal-1

Max Z = 200 X1 + 240 X2

S.T. 6 X1 + 12 X2 < 120

8 X1 + 4 X2 < 64

X1, X2 > 0

Dual-1

Min C = 120 y1 + 64 y2

S.T 6 y1 + 8 y2 > 200

12 y1 + 4 y2 > 240

y1, y2 > 0

Primal-2

Max Z = 40 X1 + 60 X2

S.T. 3 X1 + 2 X2 < 2000

X1 + 2 X2 < 1000

X1, X2 > 0

Dual-2

Min C = 2000 y1 + 1000 y2

S.T 3 y1 + y2 > 40

2 y1 + 2 y2 > 60

y1, y2 > 0

Page 55: Linear Programming for MBA Students

©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

Dual formulation:

Min C = 120 y1 + 64 y2

S.T 6 y1 + 8 y2 > 200

12 y1 + 4 y2 > 240

y1, y2 > 0

Suppose our goal was to know the base minimum prices at which the company could rent out these two departments to outside parties.

Let y1 and y2 be the rents per hour at which the company is willing to rent out. Then the total monthly rental is:

C = 120 y1 + 64 y2.

The lowest value of this is the minimum that the company should charge, hence the obj. fn. Is Min (C)

Page 56: Linear Programming for MBA Students

©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

Page 57: Linear Programming for MBA Students

©Prof. R N Bhattacharya

57

Shadow Costs and Shadow Prices

• Shadow CostsThe coefficients of the Z row in the optimal simplex table of the original variables are called shadow costs.

• Shadow PricesIn 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

Page 58: Linear Programming for MBA Students

©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.

Page 59: Linear Programming for MBA Students

©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

S1 2 0 1 -1 1000

X2 1/2 1 0 1/2 500

Z 30 0 0 35 35000

The opt. value of C, y1 and y2 are found as follows:

y1 = Coeff. Of S1 in Z row = 0

y2 = Coeff. Of S2 in Z row = 35

Min cost C = Value of Z = 35,000

Page 60: Linear Programming for MBA Students

©Prof. R N Bhattacharya

60

Introduction to Sensitivity AnalysisIntroduction to Sensitivity Analysis

Page 61: Linear Programming for MBA Students

©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 bi – 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 cij – 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.

Page 62: Linear Programming for MBA Students

©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

2 X1 + 6 X2 + X3 + 5 X4 < 3

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

Requirement Vectors

Page 63: Linear Programming for MBA Students

©Prof. R N Bhattacharya

63

Sensitivity Analysis – An illustration

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

Starting Table

BV X1 X2 X3 X4 S1 S2 S3 Val

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

Final Optimal Table

Page 64: Linear Programming for MBA Students

©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.

Page 65: Linear Programming for MBA Students

©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.