ISE203 Optimization 1 Linear Models Dr. Arslan Örnek Chapter 4 Solving LP problems: The Simplex Method SIMPLEX Simplex method is an algebraic procedure However, its underlying concepts are geometric Understanding these geometric concepts helps before going into their algebraic equivalents 2 1
3 The point of intersection of constraint boundaries are the corner-point solutions of the problem. The points that lie on the corners of the feasible region are the corner-point feasible (CPF) solutions. 4 2
5 Edges For any LP problem with n decision variables, two CPF solutions are adjacent to each other if they share n-1 constraint boundaries. The two adjacent CPF solutions are connected by a line segment that lies on these same shared constraint boundaries. Such a line segment is referred to as an edge of the feasible region. 6 3
Optimality test Consider any LP problem that possesses at least one optimal solution. If a CPF solution has no adjacent CPF solutions that are better (as measured by Z), then it must be an optimal solution. 7 8 4
9 Introducing slack variables x 3, x 4 and x 5 to convert inequalities into equalities 10 5
Slack variables Slack variable = 0 in the current solution then this solution lies on the constraint boundary for the corresponding functional contraint. If 0 the solution lies on the feasible side of this constraint boundary. If 0, the solution lies on the infeasible side of this constraint boundary. 11 12 6
13 14 7
The Simplex Method in a Nutshell Initialization (Find initial CPF solution) Is the current CPF solution optimal? Yes Stop No Move to a better adjacent CPF solution 15 Language of the Simplex Method 16 8
Initial Assumptions All constraints are of the form All right-hand-side values (b j, j=1,,m) are positive We ll learn how to address other forms later 17 The Augmented Form Set up the method first: Convert inequality constraints to equality constraints by adding slack variables Original Form Augmented Form Maximize Z = 3x 1 +5x 2 Maximize Z = 3x 1 +5x 2 subject to x 1 4 2x 2 12 3x 1 +2x 2 18 x 1,x 2 0 subject to x 1 +s 1 = 4 2x 2 = 12 3x 1 +2x 2 = 18 x 1,x 2 0 18 9
X 2 Basic and Basic Feasible Solutions Augmented Form (0,9,4,-6,0) Maximize Z = 3x 1 + 5x 2 subject to x 1 +s 1 = 4 2x 2 +s 2 = 12 3x 1 + 2x 2 +s 3 = 18 (0,6,4,0,6) (2,6,2,0,0) (4,6,0,0,-6) x 1,x 2, s 1,s 2,s 3 0 (2,3,2,6,6) (4,3,0,6,0) Augmented solution Basic infeasible solution (0,2,4,8,14) (0,0,4,12,18) (4,0,0,12,6) (6,0,-2,12,0) Basic feasible solution (BFS) Nonbasic feasible solution X 1 19 Basic, Nonbasic Solutions and the Basis In an LP, number of variables > number of equations The difference is the degrees of freedom of the system e.g. in Wyndor Glass, degrees of freedom (d.f.)= 5-3=2 Can set some variables (# = d.f.) to an arbitrary value (simplex uses 0) These variables (set to 0) are called nonbasic variables The rest can be found by solving the remaining system The basis: the set of basic variables If all basic variables are 0, we have a BFS Between two basic solutions, if their bases are the same except for one variable, then they are adjacent 20 10
Algebra of the Simplex Method Initialization Maximize Z = 3x 1 + 5x 2 subject to x 1 +s 1 = 4 2x 2 +s 2 = 12 3x 1 + 2x 2 +s 3 = 18 x 1,x 2, s 1, s 2, s 3 0 Find an initial basic feasible solution Remember from key concepts: If possible, use the origin as the initial CPF solution Equivalent to: Choose original variables to be nonbasic (x i =0, i=1, n) and let the slack variables be basic (s j =b j, j=1, m)) 21 Algebra of the Simplex Method Optimality Test Maximize Z = 3x 1 + 5x 2 subject to x 1 +s 1 = 4 2x 2 +s 2 = 12 3x 1 + 2x 2 +s 3 = 18 x 1,x 2, s 1, s 2, s 3 0 Are any adjacent BF solutions better than the current one? Rewrite Z in terms of nonbasic variables and investigate rate of improvement Current nonbasic variables: x 1,x 2 Corresponding Z: 0 Optimal? no 22 11
Algebra of the Simplex Method Step 1 of Iteration 1: Direction of Movement Maximize Z = 3x 1 + 5x 2 subject to x 1 +s 1 = 4 2x 2 +s 2 = 12 3x 1 + 2x 2 +s 3 = 18 x 1,x 2, s 1, s 2, s 3 0 Which edge to move on? Determine the direction of movement by selecting the entering variable (variable entering the basis) Choose the direction of steepest ascent x 1 : Rate of improvement in Z =3 x 2 : Rate of improvement in Z =5 Entering basic variable = x 2 23 Algebra of the Simplex Method Step 2 of Iteration 1: Where to Stop Maximize Z = 3x 1 + 5x 2 subject to x 1 +s 1 = 4 (1) 2x 2 +s 2 = 12 (2) 3x 1 + 2x 2 +s 3 = 18 (3) x 1,x 2, s 1, s 2, s 3 0 How far can we go? Determine where to stop by selecting the leaving variable (variable leaving the basis) Increasing the value of x 2 decreases the value of basic variables The minimum ratio test Constraint (1): x 1 4 no bound on x 2 (s 1 = 4 - x 1 0) Constraint (2): x 2 6 min Constraint (3): x 2 9 Leaving basic variable = s 2 24 12
Algebra of the Simplex Method Step 3 of Iteration 1: Solving for the New BF Solution Z - 3x 1-5x 2 = 0 (0) x 1 +s 1 = 4 (1) 2x 2 +s 2 = 12 (2) 3x 1 + 2x 2 +s 3 = 18 (3) Convert the system of equations to a more proper form for the new BF solution Elementary algebraic operations: Gaussian elimination Eliminate the entering basic variable (x 2 ) from all but its equation Since x 1 =0 and s 2 =0 we obtain (x 1,x 2,s 1,s 2,s 3 )= (0,6,4,0,6) 25 Algebra of the Simplex Method Optimality Test Z - 3x 1 + + 5/2 s 2 = 30 (0) x 1 +s 1 = 4 (1) x 2 + 1/2 s 2 = 6 (2) 3x 1 -s 2 + s 3 = 6 (3) Are any adjacent BF solutions better than the current one? Rewrite Z in terms of nonbasic variables and investigate rate of improvement Current nonbasic variables: x 1, s 2 Corresponding Z: 30 Optimal? No (increasing x 1 increases Z value) 26 13
Algebra of the Simplex Method Step 1 of Iteration 2: Direction of Movement Z - 3x 1 + + 5/2 s 2 = 30 (0) x 1 +s 1 = 4 (1) x 2 + 1/2 s 2 = 6 (2) 3x 1 -s 2 + s 3 = 6 (3) Which edge to move on? Determine the direction of movement by selecting the entering variable (variable entering the basis) Choose the direction of steepest ascent x 1 : Rate of improvement in Z = 3 s 2 : Rate of improvement in Z = - 5/2 Entering basic variable = x 1 27 Algebra of the Simplex Method Step 2 of Iteration 2: Where to Stop Z - 3x 1 + + 5/2 s 2 = 30 (0) x 1 +s 1 = 4 (1) x 2 + 1/2 s 2 = 6 (2) 3x 1 -s 2 + s 3 = 6 (3) How far can we go? Determine where to stop by selecting the leaving variable (variable leaving the basis) Increasing the value of x 1 decreases the value of basic variables The minimum ratio test Constraint (1): x 1 4 Constraint (2): no upper bound on x 1 Constraint (3): x 1 6/3= 2 Leaving basic variable = s 3 28 14
Algebra of the Simplex Method Step 3 of Iteration 2: Solving for the New BF Solution Z - 3x 1 + + 5/2 s 2 = 30 (0) x 1 +s 1 = 4 (1) x 2 + 1/2 s 2 = 6 (2) 3x 1 -s 2 + s 3 = 6 (3) Convert the system of equations to a more proper form for the new BF solution Elementary algebraic operations: Gaussian elimination Eliminate the entering basic variable (x 1 ) from all but its equation The next BF solution is (x1,x2,s1,s2,s3)= (2,6,2,0,0) 29 Algebra of the Simplex Method Optimality Test Z + 3/2 s 2 + s 3 = 36 (0) +s 1 + 1/3 s 2-1/3 s 3 = 2 (1) x 2 + 1/2 s 2 = 6 (2) x 1-1/3 s 2 + 1/3 s 3 = 2 (3) Are any adjacent BF solutions better than the current one? Rewrite Z in terms of nonbasic variables and investigate rate of improvement Current nonbasic variables: s 2, s 3 Corresponding Z: 36 Optimal? yes 30 15
The Simplex Method in Tabular Form For convenience in performing the required calculations Record only the essential information of the (evolving) system of equations in tableaux Coefficients of the variables Constants on the right-hand-sides Basic variables corresponding to equations 31 32 16
33 34 17
35 36 18
37 38 19
39 40 20
41 42 21
43 44 22
45 46 23
47 48 24
49 50 25
51 52 26
53 54 27
55 Fig. 4.3 Equality constraint 56 28
57 58 29
59 Fig. 4.4 Sequence of CPF solutions 60 30
61 62 31
63 64 32
65 66 33
67 68 34
69 70 35
71 72 36
Fig. 4.5 CP Solutions 73 74 37
75 Fig. 4.6 Feasible region and the sequence of operations 76 38
77 78 39
79 80 40
81 82 41
83 84 42
85 86 43
87 88 44
89 90 45
91 92 46
93 94 47
95 96 48
97 98 49
99 100 50