72
Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Embed Size (px)

Citation preview

Page 1: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Computational Methods forManagement and Economics

Carla Gomes

Module 8bThe transportation simplex method

Page 2: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

The transportation and assignment problems

• Special types of linear programming problems.

• The structure of these problems leads to algorithms – streamlined versions of the simplex method - more efficient than the standard simplex method.

Page 3: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

The transportation problem

Page 4: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Setting up the tableau for the general simplex method

• Convert minimization problem into maximization problem

• Big M or 2 phase method to introduce m+ n artificial variables (equality constraints)

• Find an initial BF solution

Note:all entries not shown are 0.

Insert table 8.13

Page 5: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

• Optimality test and step 1 of iteration:

– Select an entering basic variable knowing current row 0 (which is obtained by subtracting a certain multiple of another row from the preceding row 0).

• Step 2 (leaving basic variable) identifies which basic variable reaches zero as the entering variable is increased (which is done by comparing the current coefficients of the entering basic variable and the corresponding rhs).

• Step 3 (determine new BF solution) subtracting certain multiples of one row from other rows

Iterations in the general simplex method

Page 6: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Iterations in the general simplex method applied to transportation problem

• General form of row 0 – ui – multiple of the original row i that has been

subtracted (directly or indirectly) from original row 0.

– vj – multiple of the original row i that has been subtracted (directly or indirectly) from original row 0.

– cij – ui – vj –– 0 if it is a basic variable; otherwise it is interpreted as the rate at which Z will change as xij is increased.

Insert table – 8:14

Page 7: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Transportation simplex method

NO!• No artificial variables are needed simple procedure is used to identify the initial BF solution.• Row 0 can be obtained without using any other row –a simple procedure allows us to calculate the values of u i and vi directly.

Basically by solving a simple procedure that allows us to find the solution to the set of equations for the basic variables that have a coefficient 0 in row 0, i.e., c ij – ui – vj=0.• The leaving variable can also be identified in a simple way due to the special structure of the problem, without explicitly using the coefficients of the new entering basic variable.• The new BF solution can also be identified very easily.

Does the transportation simplex method do all the general simplex method operations?

Almost the entire simplex tableau can be eliminated!

Page 8: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

• Much faster than standard simplex method– standard simplex method

m+n+1 rows(m+1)(n+1) = mn + m + n + 1 columns

– transportation simplex method m + 2 rowsn + 2 columns

Transportation simplex method

Assume m = 10 n = 100 and see the difference!

Page 9: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Tableau for Transportation simplex method

(*) Because there are m+n equations a BF solution in this case only has m+n-1 basic variables – the other variable can be obtained as a function of the m+n-1 variables

Insert table 8.15

Page 10: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

• Initialization: finding the initial BF solution

• Optimality test

• Iteration

Transportation simplex method

Page 11: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

General procedure for construction of an initial basic feasible solution for TP

1. From the rows and columns still under consideration select the next basic variable (allocation) according to some criterion

2. Make that allocation the largest possible (the smallest of the remaining supply in its row vs. remaining demand in its column)

3. Eliminate the row or column that zeroed the corresponding supply/demand (in case of tie, randomly pick between the row vs. column; this is a case of a degenerate basic solution, i.e, a basic variable with value 0).

4. If only one row or column remains under consideration, then the procedure is complete by selecting every remaining variable associated with that row or column to be basic with the only feasible allocation. Otherwise return to step 1.

Page 12: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Criteria for selecting next basic variable

There are several methods. Here are three:

1. Northwest Corner Method

2. Minimum Cost Method

3. Vogel’s Method

Page 13: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

1. Northwest Corner Method

To find the bfs by the NWC method:

Begin in the upper left (northwest) corner of the transportation tableau and set x11 as large as possible (here the limitations for setting x11 to a larger number, will be the demand of demand point 1 and the supply of supply point 1. Your x11 value can not be greater than minimum of this 2 values).

Page 14: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

According to the explanations in the previous slide we can set x11=3 (meaning demand of demand point 1 is satisfied by supply point 1).

5

6

2

3 5 2 3

3 2

6

2

X 5 2 3

Page 15: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

After we check the east and south cells, we saw that we can go east (meaning supply point 1 still has capacity to fulfill some demand).

3 2 X

6

2

X 3 2 3

3 2 X

3 3

2

X X 2 3

Page 16: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

After applying the same procedure, we saw that we can go south this time (meaning demand point 2 needs more supply by supply point 2).

3 2 X

3 2 1

2

X X X 3

3 2 X

3 2 1 X

2

X X X 2

Page 17: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Finally, we will have the following bfs, which is: x11=3, x12=2, x22=3, x23=2, x24=1, x34=2

3 2 X

3 2 1 X

2 X

X X X X

Page 18: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

2. Minimum Cost Method

The Northwest Corner Method dos not utilize shipping costs. It can yield an initial bfs easily but the total shipping cost may be very high. The minimum cost method uses shipping costs in order come up with a bfs that has a lower cost. To begin the minimum cost method, first we find the decision variable with the smallest shipping cost (Xij). Then assign Xij its largest possible value, which is the minimum of si and dj

Page 19: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

After that, as in the Northwest Corner Method we should cross out row i and column j and reduce the supply or demand of the noncrossed-out row or column by the value of Xij. Then we will choose the cell with the minimum cost of shipping from the cells that do not lie in a crossed-out row or column and we will repeat the procedure.

Page 20: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

An example for Minimum Cost MethodStep 1: Select the cell with minimum cost.

2 3 5 6

2 1 3 5

3 8 4 6

5

10

15

12 8 4 6

Page 21: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Step 2: Cross-out column 2

2 3 5 6

2 1 3 5

8

3 8 4 6

12 X 4 6

5

2

15

Page 22: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Step 3: Find the new cell with minimum shipping cost and cross-out row 2

2 3 5 6

2 1 3 5

2 8

3 8 4 6

5

X

15

10 X 4 6

Page 23: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Step 4: Find the new cell with minimum shipping cost and cross-out row 1

2 3 5 6

5

2 1 3 5

2 8

3 8 4 6

X

X

15

5 X 4 6

Page 24: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Step 5: Find the new cell with minimum shipping cost and cross-out column 1

2 3 5 6

5

2 1 3 5

2 8

3 8 4 6

5

X

X

10

X X 4 6

Page 25: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Step 6: Find the new cell with minimum shipping cost and cross-out column 3

2 3 5 6

5

2 1 3 5

2 8

3 8 4 6

5 4

X

X

6

X X X 6

Page 26: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Step 7: Finally assign 6 to last cell. The bfs is found as: X11=5, X21=2, X22=8, X31=5, X33=4 and X34=6

2 3 5 6

5

2 1 3 5

2 8

3 8 4 6

5 4 6

X X X X

X

X

X

Page 27: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

3. Vogel’s Method

1. Begin with computing each row and column a penalty. The penalty will be equal to the difference between the two smallest shipping costs in the row or column.

2. Identify the row or column with the largest penalty. Find the first basic variable which has the smallest shipping cost in that row or column. Assign the highest possible value to that variable, and cross-out the row or column as in the previous methods.

3. Compute new penalties and use the same procedure.

Page 28: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

An example for Vogel’s MethodStep 1: Compute the penalties.

Supply Row Penalty

6 7 8

15 80 78

Demand

Column Penalty 15-6=9 80-7=73 78-8=70

7-6=1

78-15=63

15 5 5

10

15

Page 29: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Step 2: Identify the largest penalty and assign the highest possible value to the variable.

Supply Row Penalty

6 7 8

5

15 80 78

Demand

Column Penalty 15-6=9 _ 78-8=70

8-6=2

78-15=63

15 X 5

5

15

Page 30: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Step 3: Identify the largest penalty and assign the highest possible value to the variable.

Supply Row Penalty

6 7 8

5 5

15 80 78

Demand

Column Penalty 15-6=9 _ _

_

_

15 X X

0

15

Page 31: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Step 4: Identify the largest penalty and assign the highest possible value to the variable.

Supply Row Penalty

6 7 8

0 5 5

15 80 78

Demand

Column Penalty _ _ _

_

_

15 X X

X

15

Page 32: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Step 5: Finally the bfs is found as X11=0, X12=5, X13=5, and X21=15

Supply Row Penalty

6 7 8

0 5 5

15 80 78

15

Demand

Column Penalty _ _ _

_

_

X X X

X

X

Page 33: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Russell’s method

1. For each row and column remaining under consideration determine its ui – the largest cij still in that row, and its vj -- the largest cij still in that column.

2. For each variable xij not previous selected in these rows and columns calculate ij = cij - ui - vj.

3. Select the variable xij with the largest (in absolute terms) negative ij (ties my be broken randomly).

Page 34: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Supply u

16 16 13 22 17 50 22

14 14 13 19 15 60 19

19 19 20 23 M 50 M

M 0 M 0 0 50 M

Demand 30 20 70 30 60

v M 19 M 23 M

An example for Russell’s MethodStep 1: Compute ui’s and vj’s for each row and column .

Page 35: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Supply u

-6-M 16 -25 16 –9 - M 13 -23 22 -5-M 17 50 22

- 5 – M 14 -24 14 -6-M 13 -23 19 -4-M 15 60 19

19-2M 19 -M 19 20-2M 20 -M 23 -M M 50 M

– M M -M-19 0 -M M -M-23 0 -2M 0 0 M

50 50Demand 30 20 70 30 10

50v M 19 M 23 M

An example for Russell’s MethodStep 2: For each variable xij not previous selected in these rows and

columns calculate ij = cij - ui - vj.

11 = 16 - 22 – M = - 6 – M21 = 14 - 19 – M = - 5 – M31 = 19 - M– M = 19 – 2 M41 = M - M– M = – M

12 = 16 - 22 –19= – 2522 = 14 - 19 – 19 = – 2432 = 19 - M– 19 = - M42 = 0 - M– 19= – M - 19

13 = 13 - 22 –M= –9 - M23 = 13 - 19 – M = – 6 - M33 = 20 - M– M = 20 – 2 M43 = M - M– M = – M

13 = 22 - 22 –23= –2323 = 19 - 19 – 23 = – 2333 = 23 - M– 23 = – M 43 = 0 - M– 23 = – M -23

14 = 17 - 22 –M= –5-M24 = 15 - 19 – M = –4-M34 = M - M– M = – M 44 = 0 - M– M = – 2M

Page 36: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Supply u

-25 16 -25 16 -29 13 -23 22 -5-M 17 40 22

10 50

-24 14 -24 14 -25 13 -23 19 -4-M 15 60 19

-M 19 -M 19 -M 20 -M 23 -M M 50 M

– M M -M-19 0 -M M -M-23 0 -2M 0 0

50

Demand 30 20 70 30 060

v 19 19 20 23 M

An example for Russell’s MethodStep 2: For each variable xij not previous selected in these rows and

columns calculate ij = cij - ui - vj.

Note: v1 and v3 changed

11 = 16 - 22 –19 = - 2521 = 14 - 19 – 19= - 2431 = 19 - M– 19 = – M

12 = 16 - 22 –19= – 2522 = 14 - 19 – 19 = – 2432 = 19 - M– 19 = - M

13 = 13 - 22 –20= – 29 23 = 13 - 19 – 20= –2633 = 20 - M– 20 = – M

14 = 22 - 22 –23= –2324 = 19 - 19 – 23 = – 2334 = 23 - M– 23 = – M

15 = 17 - 22 –M= –5-M25 = 15 - 19 – M = –4-M35 = M - M– M = – M

Page 37: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Supply u

-25 16 -25 16 –29 13 -23 22 -5-M 17 0 22

40 10 50

-24 14 -24 14 -24 13 -23 19 -4-M 15 60 19

-M 19 -M 19 -M 20 -M 23 -M M 50 M

– M M -M-19 0 -M M -M-23 0 -2M 0 0

50

Demand 30 20 30 30 070 60

v 19 19 20 23 M

An example for Russell’s MethodStep 2: For each variable xij not previous selected in these rows and

columns calculate ij = cij - ui - vj.

11 = 16 - 22 –19 = - 2521 = 14 - 19 – 19= - 2431 = 19 - M– 19 = – M

12 = 16 - 22 –19= – 2522 = 14 - 19 – 19 = – 2432 = 19 - M– 19 = - M

13 = 13 - 22 –20= – 29 23 = 13 - 19 – 20= –2633 = 20 - M– 20 = – M

14 = 22 - 22 –23= –2324 = 19 - 19 – 23 = – 2334 = 23 - M– 23 = – M

Page 38: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Russell’s method – Interactive Solver

Page 39: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 40: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 41: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 42: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 43: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 44: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 45: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 46: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 47: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 48: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 49: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 50: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 51: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 52: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Initial Basic Feasible Solution

Page 53: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Comparison of different methods for finding initial basic feasible solution

• NW corner rule – very simple to implement and therefore fast. However it doesn’t factor in the costs.

• The minimum cost method and Vogel’s method take into consideration the costs and they are simple to compute

• Russell’s method – also takes into consideration the costs and it closely patterns the decision criterion used by the transportation simplex method to pick the entering variable.(*)

• Nevertheless it is not clear which method performs better on average, which may depend on the particular class of problem

(*) In particular ij = cij - ui – vj estimate the relative values of cij - ui – vj

Page 54: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

• Initialization: finding the initial BF solution

• Optimality test – how do we check if it is the optimal solution?

• Iteration

Transportation simplex method

Page 55: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

• Very similar to the standard simplex method – we check if all the cij - ui – vj are non-negative.

Transportation simplex methodOptimality Test

Optimality test – A BF solution is optimal iff cij - ui – vj 0 for every (i,j) such that xij is non-basic .

Note: the cij - ui – vj correspond to the coefficients in row 0.

Page 56: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

So what do we have to do?1. calculate the ui’s and vj’s for the current BF

solution

2. Use the values obtained in 1 to calculate the cij

- ui – vj for the non-basic variables.

Transportation simplex methodOptimality Test

Optimality test – A BF solution is optimal iff cij - ui – vj 0 for every (i,j) such that xij is non-basic .

Note: the cij - ui – vj correspond to the coefficients in row 0.

Page 57: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Calculation of the ui’s and vj’s for the current BF solution

• We know that when a variable is basic its corresponding row 0 coefficient is zeroSo cij - ui – vj= 0 cij = ui – vj for all the basic variables

Given that there are m + n – 1 variables, there are m + n – 1 of these equations

Since the number of unknowns (ui’s and vj’s ) is m+n, we can assign an arbitrary value to one of them; a convenient choice is to assign to the ui that has the largest number of allocations the value 0.

It is then very easy to solve the remaining equations.

Page 58: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Calculation of the ui’s and vj’s for the current BF solution

x31: 19 = u3 + v1; set u3=0 v1 = 19;x32: 19 = u3 + v2; v2 = 19;x34: 19 = u3 + v4; v4 = 23;x21: 14 = u2 + v1; v1 = 19; u2 = -5;x23: 13 = u2 + v3; u2 = -5; v3 = 18;x13: 13 = u1 + v3; v3 = 18; u1 = -5;x15: 17 = u1 + v5; u1 = -5; v5 = 22;x45: 0 = u4 + v5; v5 = 22; u4 = -22;

Now we can compute the cij - ui – vj for the non-basic variables.

Page 59: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

x11: 16 +5 - 19 = 2; x12: 16 + 5 – 19 = 2; x14: 22 + 5 – 23 = 4; x22: 14 + 5 –19 = 0; v1 = 19; x24: 19 + 5 –23 = 1; + v3; x25: 15 + 5 –22 = -2; x33: 20 –0 –18 = 2; x41: M + 22 – 19 = M – 3; x42: 0 + 22 – 19 = 3;x43: M + 22 – 18 = M + 4;x43: 0 + 22 – 23 = -1;

Which non-basic variable will enter the basis?Is it optimal?

The one with the largest cij - ui – vj in absolute value

Page 60: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

• Initialization: finding the initial BF solution

• Optimality test – how do we check if it is the optimal solution?

• Iteration

Transportation simplex method

Page 61: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

How to Pivot a Transportation Problem

1. Select as the entering variable the variable with the largest (in absolute value) negative cij - ui – vj value.

2. Select as the leaving variable. Increasing the entering variable from zero sets off a chain reaction of compensating changes in other basic variables. The first variable to be decreased to zero then becomes the leaving basic variable.

1. Find the chain involving the entering variable and some of the basic variables.

2. Counting the cells in the chain, label them alternating as (+) and (–) cells, starting with the entering variable with label (+);

Page 62: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

3. Find the (-) cells whose variable assumes the smallest value. Call this value . The variable corresponding to this (-) cell will leave the basis.

4. To perform the pivot, decrease the value of each (-) cell by and increase the value of each + cell by . The variables that are not in the loop remain unchanged. The pivot is now complete.

( If =0, the entering variable will equal 0, and a - variable that has a current value of 0 will leave the basis. In this case a degenerate bfs existed before and will result after the pivot. If more than one - cell in

the loop equals , you may arbitrarily choose one of these odd cells to leave the basis; again a degenerate bfs will result)

Page 63: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Illustration of pivoting procedure. We want to find the bfs that would result if x14 were entered into the basis.

Example of the chain

35 35

10 20 20 50

10 30 40

45 20 30 30

Ent.Variable

+

-+

-+

-

What is the value of the entering variable?

Page 64: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

New bfs after x14 is pivoted into basis. Since There is no loop involving the cells (1,1), (1,4), (2,1), (2,2), (3,3) and (3, 4) the new solution is a

bfs.

35-20 0+20 35

10+20 2020-20

(nonbasic)50

10+20 30-20 40

45 20 30 30

After the pivot the new bfs is x11=15, x14=20, x21=30, X22=20, X33=30 and X34=10.

Page 65: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

Two important points!

In the pivoting procedure:

1. Since each row has as many +20s as –20s, the new solution will satisfy each supply and demand constraint.

2. By choosing the smallest (-) variable (X23) to leave the basis, we ensured that all variables will remain nonnegative.

Page 66: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 67: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 68: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 69: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 70: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 71: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method
Page 72: Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method

• The 1st initial BF solution is degenerate because x31=0. But it is not a problem since this cell becomes a (+) cell.

• Another degenerate solution arises in the 3rd tableau (two (-) cells tie for the smallest value - 30). We selected (2,1) to be the leaving variable; if we selected (3,4), (2,1) would become the degenerate basic variable. Cell (3,4) is a (-) cell but at the level 0. So the entering variable has the value 0.

• Because none of the cij - ui – vj is negative in the 4th tableau, it means that the 3rd tableau is also optimal.