Math Lecture The greedy algorithm provides the initial transportation matrix. matrix P P Demand W ª «2 ª2 «W ª «W ª «ª «ª «Supply The circled x ij s are the initial basic variables. Erase all other values to get a transportation skeleton.
skeleton W W W Supply P ª «ª «ª «ª «P ª2 «ª «Demand Converting a skeleton to a transportation tableau: The empty squares of the skeleton must be filled with the dual variables and slacks. The s go on the right border; the s on the bottom border, and the the o ij s in the squares not occupied by the x ij s. The ij th dual constraint with slacks is x ij : + +o ij = c ij. For a basic variable x ij, the dual slack is o ij = (Complementary Slackness Theorem). Thus + + o ij = c ij becomes + = c ij. For each of the circled basic variables we have an equation: + = c ij.
skeleton W W W Supply P ª «ª «ª «ª «P ª2 «ª «Demand For each of the circled basic variables we have an equation: + = c ij. There are dual variables but only independent equations, hence only are basic variables and one, let s pick p, is a parameter. Thus p =. Use the equations + = c ij to solve for the remaining dual variables p 2, p, w,..., w. Write the s on the right border; the s on the bottom border.
P P W ª «ª2 «W ª «W For the parameters, x ij =. So instead of writing a circled x ij in the square, write the dual slack o ij : + +o ij = c ij. Hence o ij = c ij - -. Use this equation to fill in the uncircled squares for o ij. These would be objective row entries in a simplex tableau. The result is a transportation tableau. ª «ª «ª «
tableau P P W ª «9 - ª2 «W 2 ª «W Now we successively improve these tableau to an optimal solution (none of the interior o ij s are negative). The circled x ij are > and the and are unrestricted. Hence the dual solution will be feasible (and the primal will be optimal) iff the uncircled o ij are >. In a simplex tableau, these would be objective row coefficients which must be made positive. Loop: If no o ij is negative, stop, you have an optimal solution. Otherwise Choose the next entering basic variable as usual. How ª «ª «ª «
Pick the most negative (uncircled) entry o ij. Erase o ij ; shade its square; add an empty circle. This will contain the new entering basic variable x ij. tableau W W W P ª «ª «- 2 ª «9 ª «ª «P ª2 «ª «In row i, the circled x ij values must sum to s i, i.e., S j x ij = s i. In column j, the circled values must sum to d j. Thus if one circled x ij value in a row or column increases (decreases), some other value must decrease (increase). Suppose we increase the green square by one, what are the consequences
Chase these increases and decreases around until you find a loop. This loop begins and ends at the shaded entering variable; its other corners are the circled basic variables. tableau P P W ª «+ ª «- ª2 «W ª «- ª «ª «+ ª «Alternately mark the corners of the loop + or - starting with a + on the entering variable. We will increase the + values; decrease the - ones. How much can be added and subtracted from the loop variables W
The - values cannot decrease below since x ij >. The maximum amount of change = the minimum of the values labeled -. Add this to the + variables; subtract it from the - variables. tableau P P W ª «+ ª «- ª «W ª «- W ª «ª «+ ª «The - variable with the minumum value goes to ; it is the departing basic variable (pick one if two or more go to ). Remove the square s circled basic variable. Picking the most negative o ij equals selecting a simplex column with the most negative objective coefficient. Picking the first basic variable which goes to equals picking the variable with the minimum q ratio to be the departing variable.
Erase the old s, s, and o ij s (getting a skeleton) recalculate the new ones (converting the skeleton to a tableau as before). Repeat the loop. tableau P P W ª «ª «ª «W ª «W ª «ª «
tableau W W W P ª «ª «ª «ª «P ª «ª «
tableau W W W P ª «ª «ª «ª «P 2 ª «ª «
tableau W W W P ª «ª «ª «ª «P 2 ª «ª «
tableau W W W P ª «ª «ª «ª «P 2 ª «ª «ª «
tableau W W W P ª «ª «ª «ª «P ª «ª «
tableau W W W P ª «ª «- ª «ª «P 2 ª «ª «2
tableau P P W ª «ª «ª «ª «ª «- Optimal. Solution: min z =. +. +. +. +. +. = 2 at x =, x 2 =, x 2 =, x 2 =, x =, x =, the rest = W W ª «2
TRANSPORTATION ALGORITHM Input: an initial transportation tableau. Output: an optimal transportation matrix. Repeat until an optimal solution is found: v Set p =. v For the remaining,, calculate, using + = c ij for each circled basic x ij. calculate o ij using o ij = c ij - - for each parameter x ij. v If no objective coefficient (uncircled o ij ) is negative, stop. You have an optimal solution. Otherwise: v Pick the variable with the most negative o ij as the entering variable. Erase o ij ; shade the square; add a circle. v v Find a loop, starting with the entering variable and whose other corners are basic (circled). Alternately mark the corners + and -, starting with a + on the entering variable. Increase the + and decrease the - corner by the minimum of the - values. v Remove the circled departing variable (a minimum - value) which went to.