lecture05 - Yinyu Ye, MS&E, Stanford The Simplex...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Yinyu Ye, MS&E, Stanford The Simplex Method II Yinyu Ye Department of Management Science and Engineering Stanford University Stanford, CA 94305, U.S.A. MS&E211 Lecture Note #05 http://www.stanford.edu/~yyye 1 More Questions One shortcoming of the algorithm as stated is that it gives no indication of how to determine a starting feasible basis. There are techniques for dealing with this problem. This is also an unsatisfactory statement because one or both of the index choices to be made might not be uniquely specified, due to ties. Unless a suitable rule is employed, application of the steps stated above can result in a phenomenon known as cycling: the infinite repetition of a finite sequence of bases. Cycling can occur at either an optimal basis or a nonoptimal basis. Fortunately, there are ways to overcome this problem as well. Yinyu Ye, MS&E, Stanford MS&E211 Lecture Note #05 2 The Two-Phase Simplex Method We know that in order to begin the Simplex Method, we need to find an initial basic feasible solution of the problem constraints (if one exists). One approach to doing this is by solving the so-called Phase I Problem. The technique uses the Simplex Method itself to solve a related problem for which a starting basic feasible solution is known and for which an optimal solution must exist. If Phase I results in the discovery of a basic feasible solution for the originally stated constraints, then we can initiate Phase II wherein the Simplex Method is applied to the solving the originally stated linear programming problem. The combination of Phases I and II gives rise to the Two-Phase Simplex Method. Since there are two different linear programs being solved in these phases, it is advantageous to have a "smooth transition" between them. MS&E211 Lecture Note #05 3 Yinyu Ye, MS&E, Stanford d1 1 C11, x11 1 d2 2 2 d3 3 . . dn n . . . . s1 Yinyu Ye, MS&E, Stanford s2 MS&E211 Lecture Note #05 m sm Demand Figure 1: Supply chain network Supply 4 The Transportation Problem Yinyu Ye, MS&E, Stanford min s.t. m i=1 = si , i = dj , j 0, i, j. n j=1 cij xij n j=1 xij m i=1 xij xij constraint is redundant. Assume that the total supply equal the total demand. Thus, exactly one equality At each step the simplex method attempts to send units along a route that is unused (non-basic) in the current BFS, while eliminating one of the routes that is currently being used (basic). MS&E211 Lecture Note #05 5 Yinyu Ye, MS&E, Stanford Supply Chain Network Retailers Warehouses 1 1 2 3 Demand 2 12 6 10 400 13 4 9 900 3 4 10 12 4 6 11 4 200 500 Supply 500 700 800 20000 MS&E211 Lecture Note #05 6 Transportation Simplex Method: Phase I 1. Start with the cell in the northwest corner cell 2. Allocate as many units as possible, consistent with the available supply and demand. 3. Move one cell to right if there is remaining supply; otherwise, move one cell down. 4. goto Step 2. Yinyu Ye, MS&E, Stanford 500 700 800 400 900 200 500 MS&E211 Lecture Note #05 7 Yinyu Ye, MS&E, Stanford Construct the initial BFS 400 100 700 800 0 900 200 500 MS&E211 Lecture Note #05 8 Yinyu Ye, MS&E, Stanford MS&E211 Lecture Note #05 9 Yinyu Ye, MS&E, Stanford MS&E211 Lecture Note #05 10 0 700 800 Construct the initial BFS Construct the initial BFS 500 800 0 100 200 500 0 100 400 100 800 200 400 0 700 0 Yinyu Ye, MS&E, Stanford Construct the initial BFS 400 700 100 0 0 200 500 700 0 100 0 MS&E211 Lecture Note #05 11 Yinyu Ye, MS&E, Stanford Construct the initial BFS 400 100 700 100 200 0 0 0 500 0 0 MS&E211 Lecture Note #05 500 12 Yinyu Ye, MS&E, Stanford Construct the initial BFS 400 700 100 0 0 0 0 200 500 0 0 100 0 MS&E211 Lecture Note #05 13 d1 1 C11, x11 1 d2 2 2 d3 d4 3 3 4 Demand Yinyu Ye, MS&E, Stanford s1 s2 MS&E211 Lecture Note #05 s3 Supply 14 Figure 2: A BFS has a tree network structure Transportation Simplex Method: Phase II 1. Determine the shadow prices for each supply side ui and each demand side vj such that ui + vj = cij for every USED cell (basic variable), that is, solving AT y B always set vn 2. Calculate the reduced costs Yinyu Ye, MS&E, Stanford = cB . One can = 0. rij = cij - ui - uj for the UNUSED cells (non-basic variable), that is, computing rN = cN - AT y. If the reduced cost for every unused cell is nonnegative, N then STOP: declare OPTIMAL. 3. Select an unused cell with the most negative reduced cost. Using a chain reaction cycle, determine the maximum number of units ( ) that can be MS&E211 Lecture Note #05 15 Yinyu Ye, MS&E, Stanford allocated to the cell and adjust the allocation appropriately. Update the values of the new set of used cells (BFS). 4. Goto Step 1. MS&E211 Lecture Note #05 16 Yinyu Ye, MS&E, Stanford Determine the shadow prices 12 4 9 v1 v2 v3 v4 = 0 12 4 u3 u2 13 u1 MS&E211 Lecture Note #05 17 Yinyu Ye, MS&E, Stanford Determine the shadow prices 12 13 4 9 v1 v2 12 v3 4 v4 = 0 u1 u2 MS&E211 Lecture Note #05 u3 = 4 18 Yinyu Ye, MS&E, Stanford Determine the shadow prices 12 4 9 v1 v2 v3 = 8 v4 = 0 12 4 u3 = 4 u2 13 u1 MS&E211 Lecture Note #05 19 Yinyu Ye, MS&E, Stanford Determine the shadow prices 12 13 4 9 v1 v2 = 5 12 v3 = 8 4 v4 = 0 u1 u2 MS&E211 Lecture Note #05 u3 = 4 20 Yinyu Ye, MS&E, Stanford Determine the shadow prices 12 4 9 v1 v2 = 5 v3 = 8 v4 = 0 12 4 u3 = 4 u2 = -1 13 u1 MS&E211 Lecture Note #05 21 Yinyu Ye, MS&E, Stanford Determine the shadow prices 12 13 4 9 v1 v2 = 5 12 v3 = 8 4 v4 = 0 u1 = 8 u2 = -1 MS&E211 Lecture Note #05 u3 = 4 22 Yinyu Ye, MS&E, Stanford Determine the shadow prices 12 4 9 v1 = 4 v2 = 5 v3 = 8 v4 = 0 12 4 u2 = -1 u3 = 4 13 u1 = 8 MS&E211 Lecture Note #05 23 Yinyu Ye, MS&E, Stanford Calculate reduced cost coefficients 12 6 10 v1 = 4 13 4 9 v2 = 5 4 10 12 v3 = 8 6 11 4 v4 = 0 u1 = 8 u2 = -1 MS&E211 Lecture Note #05 u3 = 4 24 Yinyu Ye, MS&E, Stanford Calculate reduced cost coefficients 12/0 6/3 10/2 v1 = 4 v2 = 5 v3 = 8 v4 = 0 9/0 12/0 4/0 4/0 10/3 11/12 u2 = -1 u3 = 4 13/0 4/ - 12 6/ - 2 u1 = 8 MS&E211 Lecture Note #05 25 Yinyu Ye, MS&E, Stanford Chain reaction cycle 400 100(-) 700 (+) 100(+) 200(-) 0 0 0 = 100. 0 0 500 0 MS&E211 Lecture Note #05 0 26 d1 1 s1 d2 2 d3 d4 4 Supply 27 1 C11, x11 Yinyu Ye, MS&E, Stanford 2 s2 3 3 s3 MS&E211 Lecture Note #05 Demand Figure 3: The newly selected route and the BFS tree will form a unique cycle Yinyu Ye, MS&E, Stanford Update the new BFS 400 700 100 200 100 0 0 0 0 0 500 0 0 The total supply cost is reduced by $1200 at the new BFS. MS&E211 Lecture Note #05 28 Yinyu Ye, MS&E, Stanford Degeneracy in the Simplex Algorithm In a system of rank m, a (basic) solution that uses fewer than m columns to represent the right-hand side vector is said to be degenerate. Otherwise, it is called nondegenerate. A basic feasible solution will be nondegenerate if and only if its m basic variables all have positive values. MS&E211 Lecture Note #05 29 Yinyu Ye, MS&E, Stanford World Cup Auction Order Price Limit Quantity Limit Argentina Brazil Italy Germany France 1 2 3 4 5 .75 .35 .40 .95 .75 10 5 10 10 5 1 0 1 1 0 1 0 0 1 1 1 0 1 1 0 0 1 0 1 1 0 0 1 0 0 MS&E211 Lecture Note #05 30 LP Mechanism Design maximize subject to .75x1 x1 x1 x1 x2 +x3 x1 x2 x3 x4 x5 xj 0 +x4 +x5 -x6 -x6 +x3 +x4 -x6 0 0 0 10 5 10 10 5 +x4 +x5 -x6 0 +x3 +x4 -x6 0 Yinyu Ye, MS&E, Stanford +.35x2 +.4x3 +.95x4 +.75x5 -x6 MS&E211 Lecture Note #05 31 LP Tableau B Yinyu Ye, MS&E, Stanford .75 7 8 9 10 11 12 13 14 15 16 1 1 1 0 0 1 0 0 0 0 .35 0 0 0 1 0 0 1 0 0 0 .4 1 0 1 0 1 0 0 1 0 0 .95 1 1 1 1 0 0 0 0 1 0 .75 0 1 0 1 0 0 0 0 0 1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 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 0 0 0 0 -1 0 1 0 0 0 0 0 0 0 0 -1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 -.05 0 0 -.4 -.25 0 -.35 0 0 0 0 0 -.15 1 1 0 0 0 0 0 -1 0 1 -.75 5 5 0 0 0 10 5 5 10 5 3 5 9 2 11 12 13 14 15 6 10 5 MS&E211 Lecture Note #05 41 LP Tableau B Yinyu Ye, MS&E, Stanford 0 3 5 9 2 11 12 1 14 15 6 0 0 0 0 -1 0 1 0 0 -1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 -.05 0 0 0 0 -1 0 0 0 1 -1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -.4 1 0 -1 0 -1 0 0 -1 0 0 -.35 -1 0 0 0 1 -1 1 1 0 0 0 0 0 1 -1 -1 1 0 0 0 -1 -.25 0 0 0 1 0 0 -1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 -.1 0 0 0 1 1 -1 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 -.15 1 1 0 0 0 0 0 -1 0 1 -1.25 MRT 5 5 0 5 5 5 5 5 10 MS&E211 Lecture Note #05 10 42 Yinyu Ye, MS&E, Stanford Resolving Cycling in the Simplex Algorithm But degeneracy can be a problem ! The Simplex Algorithm can cycle when a degenerate basic feasible solution crops up in the course of executing the algorithm. MS&E211 Lecture Note #05 43 Cycling Example min s.t. -2x1 -2x1 1 3 x1 - - + x1 , 3x2 9x2 x2 x2 , + + - x3 x3 1 3 x3 + + - x3 , 12x4 9x4 2x4 x4 , x5 , +x5 +x6 x6 sequence shown in the table below leads back to the original system after 6 pivots. Pivot number Basic var. out Basic var. in 1 2 3 4 5 6 Yinyu Ye, MS&E, Stanford =0 =0 0 MS&E211 Lecture Note #05 Initially, the basic variables are {x5 , x6 } and it is in the canonical form. The pivot x6 x2 x5 x1 x2 x4 x1 x3 x4 x6 x3 x5 44 Yinyu Ye, MS&E, Stanford Methods for Resolving Cycling There are several methods for resolving degeneracy in linear programming. Among these are: 1. Perturbation of the right-hand side. 2. Lexicographic ordering. 3. Application of Bland's pivot selection rule. MS&E211 Lecture Note #05 45 Bland's Rule It is a double least-index rule consisting of the following two parts: (i) Among all candidates for the entering column (i.e., those with rj choose the one with the smallest index, say e. (ii) Among all rows i for which the minimum ratio test results in a tie, choose the row r for which the corresponding basic variable has the smallest index, jr . Theorem 1 Under Bland's pivot selection rule, the Simplex Algorithm cannot cycle. Yinyu Ye, MS&E, Stanford < 0), MS&E211 Lecture Note #05 46 ...
View Full Document

This note was uploaded on 06/16/2010 for the course MS&E 211 taught by Professor Yinyuye during the Fall '07 term at Stanford.

Ask a homework question - tutors are online