THEORY OF THE SIMPLEX METHOD - Koç...

18
INDR 262 Optimization Models and Mathematical Programming ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 1 THEORY OF THE SIMPLEX METHOD Terminology: Constraint Boundary Equation: an equation obtained by replacing its sign ( , , or = ) by an equality sign (=). Boundary: the boundary of the feasible region contains (1) the feasible solutions that satisfy one or more of the constraint boundary equations. CPF: is a feasible solution that exists at the constraints of more than one constraint boundary equations (i.e., it does not lie on any line segment connecting two other feasible solutions). For any linear programming problem with n decision variables, each CPF solution lies at the intersection of n constraint boundaries. Adjacent CPF solutions: A CPF solution lies at the intersection of n constraint boundaries. An edge of the feasible region is feasible line segment that lies at the intersection of n-1 constraint boundaries. Two CPF solutions are adjacent if the line segment connecting them is an edge of the feasible region. Each CPF solution has n edges each one leading to one of the n adjacent CPF solutions. Properties of CPF Solutions: Property 1: a) If there is exactly one optimal solution, then it must be a CPF solution. b) If there are multiple optimal solutions, then at least two must be adjacent CPF solutions. Proof: a) Assume that there is a single optimal solution which is not a CPF solution. x * : optimal solution z * : objective function value of the optimal solution since x * is not a CPF solution, there must be two other feasible solutions (x 1 and x 2 ) such that the line segment joining them contains the optimal solution, x * . Let z 1 and z 2 denote the objective function value for solutions x 1 and x 2 respectively. x * = αx 1 + (1-α)x 2 and 0<α<1 z * = αz 1 + (1-α)z 2 These cases are possible: 1) z * = z 1 = z 2 contradicts with the assumption so there are more than one CPF solutions. 2) z 1 < z * < z 2 x * is not an optimal solution. 3) z 1 > z * > z 2 - It is impossible to have a single optimal solution that is not a CPF solution. b) complete the proof as an exercise. Hint: When you have multiple optimal solutions, the objective function is parallel to a constraint boundary equation.

Transcript of THEORY OF THE SIMPLEX METHOD - Koç...

Page 1: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 1

THEORY OF THE SIMPLEX METHOD Terminology: Constraint Boundary Equation: an equation obtained by replacing its sign ( , , or = ) by an

equality sign (=). Boundary: the boundary of the feasible region contains (1) the feasible solutions that satisfy

one or more of the constraint boundary equations. CPF: is a feasible solution that exists at the constraints of more than one constraint boundary

equations (i.e., it does not lie on any line segment connecting two other feasible solutions).

For any linear programming problem with n decision variables, each CPF solution lies at the intersection of n constraint boundaries. Adjacent CPF solutions: A CPF solution lies at the intersection of n constraint boundaries. An

edge of the feasible region is feasible line segment that lies at the intersection of n-1 constraint boundaries. Two CPF solutions are adjacent if the line segment connecting them is an edge of the feasible region. Each CPF solution has n edges each one leading to one of the n adjacent CPF solutions.

Properties of CPF Solutions: Property 1: a) If there is exactly one optimal solution, then it must be a CPF solution.

b) If there are multiple optimal solutions, then at least two must be adjacent CPF solutions.

Proof: a) Assume that there is a single optimal solution which is not a CPF solution. x* : optimal solution z* : objective function value of the optimal solution since x* is not a CPF solution, there must be two other feasible solutions (x1 and x2) such that the line segment joining them contains the optimal solution, x*. Let z1 and z2 denote the objective function value for solutions x1 and x2 respectively. x* = αx1 + (1-α)x2 and 0<α<1 z* = αz1 + (1-α)z2 These cases are possible: 1) z*= z1= z2 contradicts with the assumption so there are more than one CPF solutions. 2) z1< z*< z2 x* is not an optimal solution. 3) z1> z*> z2 - It is impossible to have a single optimal solution that is not a CPF solution. b) complete the proof as an exercise.

Hint: When you have multiple optimal solutions, the objective function is parallel to a constraint boundary equation.

≥ ≤

Page 2: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 2

Property 2: There are only a finite number of CPF solutions.

m: constraints n: variables

- CPF solutions will involve solving n out of m+n constraint boundary equations (m:

functional constraints, n: non-negativity constraints). The number of solutions is given by:

( )m n m n !n m!n!+ +⎛ ⎞ =⎜ ⎟

⎝ ⎠

Example: m=3, n=2 (Wyndor Glass Co.) 3 2 (3 2) 120 102 3 2 12

!! !

+ +⎛ ⎞ = = =⎜ ⎟⎝ ⎠

possible solutions and 5 are CPF solutions.

Property 3: If a CPF solution has no adjacent CPF solutions that are better, then there are no

better solutions anywhere. Therefore, such a CPF solution is guaranteed to be an optimal solution assuming that the problem possesses at least one optimal solution.

Proof: complete the proof as an exercise.

Hint: For a CPF solution to have better objective function value than all of its adjacent CPF solutions while not being the optimal solution, the feasible region must be nonconvex.

Augmented Form of the LP Problem LP Model constraints: (1) a11x1 + a12x2 + … + a1nxn + xn+1 = b1 (2) a21x1 + a22x2 + … + a2nxn + xn+2 = b2 ... ... … ... … … ... ... … ... … … (m) am1x1 + am2x2 + … + amnxn + xn+m = bm

׀ slack variables ׀ Definitions: Basic Solutions: Augmented corner-point solutions BF Solutions: CPF solutions Defining Equations: set of n constraint boundary equations for each corner point solution. Indicating Variable: A unique variable for each constraint to indicate whether that constraint’s

boundary equation is satisfied by the current solution. (≥ type constraints involve two variables)

Page 3: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 3

Constraint Constraint Form Augmented Form Constr.

Boundary Eqn.

Indicating Variable

≤ 1

nij j i

ja x b

=≤∑

1

nij j n i i

ja x x b+

=+ =∑

1

nij j i

ja x b

==∑ xn+i

≥ 1

nij j i

ja x b

=≥∑

1i

nij j n i S i

ja x x x b+

=+ − =∑

1

nij j i

ja x b

==∑

in i Sx x+ −

= 1

nij j i

ja x b

==∑

1

nij j n i i

ja x x b+

=+ =∑

1

nij j i

ja x b

==∑ n ix +

Non-neg. xj≥0 xj≥0 xj=0 xj Example: Wyndor Glass Co. max z= 3x1+ 5x2 s.t.

x1 ≤ 4 2x2 ≤ 12 3x1+ 2x2 ≤ 18 x1 ≥ 0 x2 ≥ 0

Constraint Augmented Form Constraint

Boundary Eqn. Indicating Variable

x1 ≤ 4 x1+ x3 = 4 x1 = 4 x3 2x2≤12 2x2 +x4 =12 2x2=12 x4 3x1+2x2≤18 3x1+2x2 +x5=18 3x1+2x2=18 x5 x1 ≥ 0 x1 ≥ 0 x1 = 0 x1 x2≥ 0 x2 ≥ 0 x2= 0 x2

CPF Solution Defining Eqns BF Solution Non-basic Var.

(0,0) x1 = 0 x2= 0

(0,0,4,12,18) x1, x2

(0,6) x1 = 0 2x2=12 (0,6,4,0,6) x1, x4

(2,6) 2x2=12 3x1+2x2=18 (2,6,2,0,0) x4, x5

(4,3) 3x1+2x2=18 x1 = 4 (4,3,0,6,0) x3, x5

(4,0) x1 = 4 x2= 0 (4,0,0,12,6) x2, x3

Page 4: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 4

Summary of the Matrix Form of the Simplex Method Notation max z=cx st Ax=b

x≥0 BV any set of basic variables NB any set of nonbasic variables b right-hand side vector of the original problem aj column for xj in the constraints of the original problem B mxm constraints whose jth column is the column for BVj in the original constraints cj coefficients of xj in the objective function cB 1xm row vector whose jth element is the objective function coefficient for BVj ui mx1 column vector with ith element is 1 and all other elements equal to 0 Formulae B-1aj column for xj in BV tableau (1) cBB-1aj-cj coefficient of xj in row 0 (2) B-1b right-hand side of constraints in BV tableau (3) cBB-1ui coefficient of slack variables in BV in row 0 (4) cBB-1b right-hand side of BV in row 0 (5) Method Step 0 Identify the initial BF solution. Initially, B-1=I. Step 1 For the current tableau, compute cBB-1. Step 2 Evaluate equation (2) for all nonbasic variables (NB). If every nonbasic variable

has nonnegative value, the current basis is optimal with an objective function value given by equation (5). If the current basis is not optimal, select the nonbasic variable with the most negative coefficient in row 0, call this variable the entering basic variable, xk.

Step 3 In order to determine the leaving basic variable, compute xk’s column in the current tableau using equation (1) and compute the right-hand side of the current tableau using equation (3). Then use the minimum ratio test to determine the row in which xk should enter the basis. We now know the set of basic variables (BV) for the new tableau.

Step 4 Use the column for xk in the current simplex tableau to determine the ero’s needed to enter xk into the basis. Perform these ero’s on the current B-1. This will yield the new B-1. Return to Step 1.

Page 5: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 5

Example 1:

Consider the Wyndor Glass Company problem:

max z = 3x1 + 5x2

s.t. x1 ≤ 4 2x2 ≤12 3x1 + 2x2 ≤18 x1 ≥ 0 x2 ≥ 0

è

max z = 3x1 + 5x2

s.t. x1 + x3 = 4 2x2 + x4 =12 3x1 + 2x2 + x5 =18 x1, x2, x3, x4, x5 ≥ 0

0) BV0 = {x3, x4, x5} cB= [0 0 0] B0 =1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥

NB0 = {x1, x2} cN = [3 5] B0−1 =

1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥

Iteration 1:

1) cB B−1 = 0 0 0⎡

⎣⎢⎤⎦⎥

1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥= 0 0 0⎡⎣⎢

⎤⎦⎥

2) z1−c1 = cB B0−1a1−c1 = 0 0 0⎡

⎣⎢⎤⎦⎥

103

⎢⎢⎢

⎥⎥⎥−3= −3

z2 −c2 = 0 0 0⎡⎣⎢

⎤⎦⎥

022

⎢⎢⎢

⎥⎥⎥−5= −5 ⇒ x2 enters the basis

3) the column for x2 is 022

⎢⎢⎢

⎥⎥⎥

update a2: B0−1a2 =

1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥

022

⎢⎢⎢

⎥⎥⎥=

022

⎢⎢⎢

⎥⎥⎥

update b: B0−1b =

1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥

41218

⎢⎢⎢

⎥⎥⎥=

41218

⎢⎢⎢

⎥⎥⎥

Page 6: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 6

⇒ conduct the minimum ratio test: min 40,122,182

⎧⎨⎩

⎫⎬⎭

x2 enters the basis in row 2,

update the variables sets: BV1={x3, x2, x5}, NB1 = {x1, x4}

4) ero’s:

new row 0 = old row 0 + (5/2) * (old row 2)

new row 1 = old row 1 + (0) * (old row 2)

new row 2 = + (1/2) * (old row 2)

new row 3 = old row 3 + (-1) * (old row 2)

The new basis inverse:

B0−1 =

1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥⇒ B1

−1 =1 0 00 1 / 2 00 −1 1

⎢⎢⎢

⎥⎥⎥

Iteration 2:

1) cB B1−1 = 0 5 0⎡

⎣⎢⎤⎦⎥

1 0 00 1 / 2 00 −1 1

⎢⎢⎢

⎥⎥⎥= 0 5 / 2 0⎡⎣⎢

⎤⎦⎥

2) z1−c1 = 0 5 / 2 0⎡⎣⎢

⎤⎦⎥

103

⎢⎢⎢

⎥⎥⎥−3= −3 ⇒ x1 enters the basis

z4 −c4 = 0 5 / 2 0⎡⎣⎢

⎤⎦⎥

010

⎢⎢⎢

⎥⎥⎥−0 = 5 / 2

3) the column for x1 is 103

⎢⎢⎢

⎥⎥⎥

Page 7: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 7

update a1: B1−1a1 =

1 0 00 1/ 2 00 −1 1

⎢⎢⎢

⎥⎥⎥

103

⎢⎢⎢

⎥⎥⎥=

103

⎢⎢⎢

⎥⎥⎥

update b: B1−1b =

1 0 00 1/ 2 00 −1 1

⎢⎢⎢

⎥⎥⎥

41218

⎢⎢⎢

⎥⎥⎥=

466

⎢⎢⎢

⎥⎥⎥

⇒ conduct the minimum ratio test: min 41,60,63

⎧⎨⎩

⎫⎬⎭

x1 enters the basis in row 3,

update the variables sets: BV1={x3, x2, x1}, NB1 = {x5, x4}

4) ero’s:

new row 0 = old row 0 + (1) * (old row 3)

new row 1 = old row 1 + (-1/3) * (old row 3)

new row 2 = old row 2 + (0) * (old row 3)

new row 3 = + (1/3) * (old row 3)

The new basis inverse:

B1−1 =

1 0 00 1/ 2 00 −1 1

⎢⎢⎢

⎥⎥⎥⇒ B2

−1 =1 1/ 3 −1/ 30 1/ 2 00 −1/ 3 1/ 3

⎢⎢⎢

⎥⎥⎥

Iteration 3:

1) cB B2−1 = 0 5 3⎡

⎣⎢⎤⎦⎥

1 1 / 3 −1 / 30 1 / 2 00 −1 / 3 1 / 3

⎢⎢⎢

⎥⎥⎥= 0 3 / 2 1⎡⎣⎢

⎤⎦⎥

2) z5 −c5 = 0 3 / 2 1⎡⎣⎢

⎤⎦⎥

001

⎢⎢⎢

⎥⎥⎥−0 =1

Page 8: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 8

z4 −c4 = 0 3 / 2 1⎡⎣⎢

⎤⎦⎥

010

⎢⎢⎢

⎥⎥⎥−0 = 3 / 2

⇒ no negative coefficients, the current solution is OPTIMAL!

Calculate the optimal objective function and the optimal values of the decision variables:

z* = cB B2−1b = 0 5 3⎡

⎣⎢⎤⎦⎥

1 1 / 3 −1 / 30 1 / 2 00 −1 / 3 1 / 3

⎢⎢⎢

⎥⎥⎥

41218

⎢⎢⎢

⎥⎥⎥

= 0 3 / 2 1⎡⎣⎢

⎤⎦⎥

41218

⎢⎢⎢

⎥⎥⎥

= 36

xB

* = B −1b

=1 1 / 3 −1 / 30 1 / 2 00 −1 / 3 1 / 3

⎢⎢⎢

⎥⎥⎥

41218

⎢⎢⎢

⎥⎥⎥

=262

⎢⎢⎢

⎥⎥⎥

Example 2:

max z = 60x1+30x2 + 20x3

s .t . 8x1 +6x2 + x3 + x4 = 48

4x1 + 2x2 +1.5x3 + x5 = 20

2x1+1.5x2 +0.5x3 + x6 = 8

x1 , x2 , x3 , x4 , x5 , x6 ≥ 0

0) BV0={x4, x5, x6}, NB0={x1, x2, x3}

B0 =1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥⇒ B0

−1 =1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥

Page 9: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 9

cB= [0 0 0], cN= [60 30 20]

Iteration 1:

1) cB B0−1 = 0 0 0⎡

⎣⎢⎤⎦⎥

1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥= 0 0 0⎡⎣⎢

⎤⎦⎥

2) z1−c1 = cB B0−1a1−c1 = 0 0 0⎡

⎣⎢⎤⎦⎥

−842

⎢⎢⎢

⎥⎥⎥−60 = −60 ⇒ x1 enters the basis

z2 −c2 = 0 0 0⎡⎣⎢

⎤⎦⎥

621.5

⎢⎢⎢

⎥⎥⎥−30 = −30

z3 −c3 = 0 0 0⎡⎣⎢

⎤⎦⎥

11.50.5

⎢⎢⎢

⎥⎥⎥− 20 = −20

3) the column for x1 is 842

⎢⎢⎢

⎥⎥⎥

update a1: B0−1a1 =

1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥

842

⎢⎢⎢

⎥⎥⎥=

842

⎢⎢⎢

⎥⎥⎥

update b: B0−1b =

1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥

48208

⎢⎢⎢

⎥⎥⎥=

48208

⎢⎢⎢

⎥⎥⎥

⇒ conduct the minimum ratio test: min 488,204,82

⎧⎨⎩

⎫⎬⎭

x1 enters the basis in row 3,

update the variables sets: BV1={x4, x5, x1}, NB1 = {x6, x2, x3}

cB=[0 0 60], cN=[0 30 20]

4) ero’s:

new row 1 = old row 1 + (-8/2) * (old row 3)

Page 10: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 10

new row 2 = old row 2 + (-4/2) * (old row 3)

new row 3 = + (1/2) * (old row 3)

The new basis inverse:

B0−1 =

1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥⇒ B1

−1 =1 0 −40 1 −20 0 1/ 2

⎢⎢⎢

⎥⎥⎥

Iteration 2:

1) cB B1−1 = 0 0 60⎡

⎣⎢⎤⎦⎥

1 0 −40 1 −20 0 1 / 2

⎢⎢⎢

⎥⎥⎥= 0 0 30⎡⎣⎢

⎤⎦⎥

2) z6 −c6 = 0 0 30⎡⎣⎢

⎤⎦⎥

001

⎢⎢⎢

⎥⎥⎥−0 = 30

z2 −c2 = 0 0 30⎡⎣⎢

⎤⎦⎥

621.5

⎢⎢⎢

⎥⎥⎥−30 =15

z3 −c3 = 0 0 30⎡⎣⎢

⎤⎦⎥

11.50.5

⎢⎢⎢

⎥⎥⎥− 20 = −5 ⇒ x3 enters the basis

3) the column for x3 is 13 / 21/ 2

⎢⎢⎢

⎥⎥⎥

update a3: B1−1a3 =

1 0 −40 1 −20 0 1/ 2

⎢⎢⎢

⎥⎥⎥

13 / 21/ 2

⎢⎢⎢

⎥⎥⎥=

−11/ 21/ 4

⎢⎢⎢

⎥⎥⎥

update b: B1−1b =

1 0 −40 1 −20 0 1/ 2

⎢⎢⎢

⎥⎥⎥

48208

⎢⎢⎢

⎥⎥⎥=

1644

⎢⎢⎢

⎥⎥⎥

⇒ conduct the minimum ratio test: min 16−1, 41 / 2

, 41 / 4

⎧⎨⎩

⎫⎬⎭

x3 enters the basis in row 2,

Page 11: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 11

update the variables sets: BV1={x4, x3, x1}, NB1 = {x6, x2, x5}

cB=[0 20 60], cN=[0 30 0]

4) ero’s:

new row 1 = old row 1 + (1/(1/2)) * (old row 2)

new row 2 = (1/(1/2)) * (old row 2)

new row 3 = old row 3 + [(-1/4)/(1/2)] * (old row 2)

The new basis inverse:

B1−1 =

1 0 −40 1 −20 0 1/ 2

⎢⎢⎢

⎥⎥⎥⇒ B2

−1 =1 2 −80 2 −40 −1/ 2 3 / 2

⎢⎢⎢

⎥⎥⎥

Iteration 3:

1) cB B2−1 = 0 20 60⎡

⎣⎢⎤⎦⎥

1 2 −80 2 −40 −1 / 2 3 / 2

⎢⎢⎢

⎥⎥⎥= 0 10 10⎡⎣⎢

⎤⎦⎥

2) z6 −c6 = 0 10 10⎡⎣⎢

⎤⎦⎥

001

⎢⎢⎢

⎥⎥⎥−0 =10

z2 −c2 = 0 10 10⎡⎣⎢

⎤⎦⎥

621.5

⎢⎢⎢

⎥⎥⎥−30 = 5

z5 −c5 = 0 10 10⎡⎣⎢

⎤⎦⎥

010

⎢⎢⎢

⎥⎥⎥−0 =10

⇒ no negative coefficients, the current solution is OPTIMAL!

Calculate the optimal objective function and the optimal values of the decision variables:

Page 12: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 12

z* = cB B2−1b

= 0 20 60⎡⎣⎢

⎤⎦⎥

1 2 −80 2 −40 −1 / 2 3 / 2

⎢⎢⎢

⎥⎥⎥

48208

⎢⎢⎢

⎥⎥⎥

= 280

xB

* = B2−1b

=1 2 −80 2 −40 −1 / 2 3 / 2

⎢⎢⎢

⎥⎥⎥

48208

⎢⎢⎢

⎥⎥⎥

=2482

⎢⎢⎢

⎥⎥⎥

The LP Problem

max z = cxs.t. Ax ≤ b x ≥ 0

where c = c1 c2 . . cn⎡⎣⎢

⎤⎦⎥

x =

x1x2

.

.xn

⎢⎢⎢⎢⎢⎢⎢

⎥⎥⎥⎥⎥⎥⎥

, b =

b1b2

.

.bn

⎢⎢⎢⎢⎢⎢⎢

⎥⎥⎥⎥⎥⎥⎥

, A =

a11 a12 . . a1n

a21 a22 . . a2n

. . . . .

. . . . .am1 am2 . . amn

⎢⎢⎢⎢⎢⎢⎢

⎥⎥⎥⎥⎥⎥⎥

⇒ The augmnted form is obtained by introducing a column vector of slack variables:

xs =

xn+1xn+2..

xn+m

⎢⎢⎢⎢⎢⎢⎢

⎥⎥⎥⎥⎥⎥⎥

⇒ The following linear system represents the constraints:

Page 13: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 13

A ,I⎡⎣ ⎤⎦xxs

⎣⎢⎢

⎦⎥⎥= b and x

xs

⎣⎢⎢

⎦⎥⎥≥ 0

Since the above system of linear equations is not square, a basic feasible solution is obtained

by setting n variables to zero (non-basic variables) and the remaining variables can have non-

negative values (basic variables). The basic variables are represented as xB, and the

submatrix, B, in [A, I] selected such that B includes only the columns for basic variables.

The simplex iterations of a linear programming problem in the matrix form can be represented as follows:

• initially

1 −c 00 A I

⎣⎢

⎦⎥zxxs

⎢⎢⎢

⎥⎥⎥= 0

b

⎣⎢

⎦⎥

• after any iteration RHS is updated:

zxB

⎣⎢⎢

⎦⎥⎥=

1 cB B−1

0 B −1

⎢⎢

⎥⎥0b

⎣⎢

⎦⎥=

cB B−1b

B −1b

⎢⎢

⎥⎥

The system of equations are updated:

1 cB B−1

0 B −1

⎢⎢

⎥⎥1 −c 00 A I

⎣⎢

⎦⎥=

1 −c +cB B−1A cB B

−1I

0 B −1A B −1I

⎢⎢

⎥⎥

The following system is obtained at each iteration:

1 −c +cB B−1A cB B

−1I

0 B −1A B −1I

⎢⎢

⎥⎥

zxxs

⎢⎢⎢

⎥⎥⎥=

cB B−1b

B −1b

⎢⎢

⎥⎥

Page 14: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 14

THE REVISED SIMPLEX METHOD

Given the following LP: max z=cx st Ax=b

x≥0 0) Find an initial basic feasible solution, xB, with basis B. Partition the variables into two sets

as the set of basic variables, XB, and the set of nonbasic variables, XN. The objective function coefficients of basic and nonbasic variables are also partitioned into cB and cN respectively.

1) For the current tableau, calculate y=cBB-1.For each nonbasic variable in XN, calculate the reduced cost coefficient using, zj–cj = yaj-cj.

2) Calculate zk–ck = max {zj–cj}. If zk–ck ≥ 0, then the optimal solution is found. Otherwise go to step 3.

3) Update the relevant columns: 1−=k ka B a where ak is the coefficients of variable k in the constraints of initial

formulation and ka is the coefficients of variable k in the constraints for the current iteration

1−=b B b where b is the right-hand-side values in the constraints of initial formulation and b is the right-hand-side values in the constraints of for the current iteration

4) Determine the leaving variable by conducting minimum ratio test: b rark

= min1≤i ≤m

biaik:aik > 0

⎧⎨⎪

⎩⎪

⎫⎬⎪

⎭⎪

Designate the row of the leaving basic variable with r. 5) Pivot at rka . Pivoting on yrk updates the B-1 for the current basis. Lets examine the

algebraic operations for the basis update and develop an efficient representation.

Bnew−1( )

ij=

1ark

Bnew−1( )

rj if i = r

Bold−1( )

ij−aijark

Bold−1( )

rj if i ≠ r

⎪⎪

⎪⎪

This relationship can be represented as,

Bnew−1 = E Bold

−1 E is defined as the following augmented matrix:

E = U1,U2 ,...,Ur−2 ,Ur−1,η, Ur+1,Ur+2 ,...,Um⎡⎣ ⎤⎦ where

Page 15: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 15

U i is the m-dimensional column vector with its i th element equal to 1 and the rest are equal to 0

η =

η1

η2

...ηm

⎢⎢⎢⎢⎢

⎥⎥⎥⎥⎥

is the m-dimensional column vector with ηi =1ark

when i = r and ηi = −aikark

when i ≠ r

6) Update XB, XN, cB, cN, B-1, N and go back to 1. Example: Consider the Wyndor Glass Company problem: max z = 3x1 + 5x2

s.t. x1 + x3 = 4 2x2 + x4 =12 3x1 + 2x2 + x5 =18 x1, x2, x3, x4, x5 ≥ 0

0) Initial basic feasible solution:

xB = {x3, x4, x5} cB= [0 0 0] B0 =1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥

B0−1 =

1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥

xN = {x1, x2} cN = [3 5] N =1 00 23 2

⎢⎢⎢

⎥⎥⎥

Iteration 1:

1) y = cB B−1 = 0 0 0⎡

⎣⎢⎤⎦⎥

1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥= 0 0 0⎡⎣⎢

⎤⎦⎥

2) z1−c1 = ya1−c1 = 0 0 0⎡⎣⎢

⎤⎦⎥

103

⎢⎢⎢

⎥⎥⎥−3= −3

z2 −c2 = ya2 −c2 = 0 0 0⎡⎣⎢

⎤⎦⎥

022

⎢⎢⎢

⎥⎥⎥−5= −5 ⇒ x2 enters the basis

Page 16: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 16

3) the column for x2 is 022

⎢⎢⎢

⎥⎥⎥

update a2 = B0−1a2 =

1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥

022

⎢⎢⎢

⎥⎥⎥=

022

⎢⎢⎢

⎥⎥⎥

update b = B0−1b =

1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥

41218

⎢⎢⎢

⎥⎥⎥=

41218

⎢⎢⎢

⎥⎥⎥

4) conduct the minimum ratio test: min 40,122,182

⎧⎨⎩

⎫⎬⎭

x2 enters the basis in row 2 (r=2).

5) B1−1 = EB0

−1

E = U 1 U 2 U 3⎡⎣⎢

⎤⎦⎥=

1 0 00 1/ 2 00 −1 1

⎢⎢⎢

⎥⎥⎥

The new basis inverse:

B1−1 = EB0

−1 =1 0 00 1 / 2 00 −1 1

⎢⎢⎢

⎥⎥⎥

1 0 00 1 00 0 1

⎢⎢⎢

⎥⎥⎥=

1 0 00 1 / 2 00 −1 1

⎢⎢⎢

⎥⎥⎥

6) Current Solution:

xB = {x3, x2, x5} cB= [0 5 0] B1−1 =

1 0 00 1/ 2 00 −1 1

⎢⎢⎢

⎥⎥⎥

xN = {x1, x4} cN = [3 0] N =1 00 13 0

⎢⎢⎢

⎥⎥⎥

Iteration 2:

Page 17: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 17

1) y = cB B1−1 = 0 5 0⎡

⎣⎢⎤⎦⎥

1 0 00 1 / 2 00 −1 1

⎢⎢⎢

⎥⎥⎥= 0 5 / 2 0⎡⎣⎢

⎤⎦⎥

2) z1−c1 = ya1−c1 = 0 5 / 2 0⎡⎣⎢

⎤⎦⎥

103

⎢⎢⎢

⎥⎥⎥−3= −3 ⇒ x1 enters the basis

z4 −c4 = ya4 −c4 = 0 5 / 2 0⎡⎣⎢

⎤⎦⎥

010

⎢⎢⎢

⎥⎥⎥−0 = 5 / 2

3) the column for x1 is 103

⎢⎢⎢

⎥⎥⎥

update a1 = B1−1a1 =

1 0 00 1/ 2 00 −1 1

⎢⎢⎢

⎥⎥⎥

103

⎢⎢⎢

⎥⎥⎥=

103

⎢⎢⎢

⎥⎥⎥

update b = B1−1b =

1 0 00 1/ 2 00 −1 1

⎢⎢⎢

⎥⎥⎥

41218

⎢⎢⎢

⎥⎥⎥=

466

⎢⎢⎢

⎥⎥⎥

4) conduct the minimum ratio test: min 41,− ,63

⎧⎨⎩

⎫⎬⎭

x1 enters the basis in row 2 (r=3).

5) B2−1 = EB1

−1

E = U 1 U 2 U 3⎡⎣⎢

⎤⎦⎥=

1 0 −1/ 30 1 00 0 1/ 3

⎢⎢⎢

⎥⎥⎥

The new basis inverse:

B2−1 = EB1

−1 =1 0 −1 / 30 1 00 0 1 / 3

⎢⎢⎢

⎥⎥⎥

1 0 00 1 / 2 00 −1 1

⎢⎢⎢

⎥⎥⎥=

1 1 / 3 −1 / 30 1 / 2 00 −1 / 3 1 / 3

⎢⎢⎢

⎥⎥⎥

Page 18: THEORY OF THE SIMPLEX METHOD - Koç Hastanesihome.ku.edu.tr/~mturkay/indr262/Indr262LectureNotes_5... · 2016-04-25 · INDR 262 Optimization Models and Mathematical Programming ...

INDR 262 Optimization Models and Mathematical Programming

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Metin Turkay 18

6) Current solution:

xB = {x3, x2, x1} cB= [0 5 3] B2−1 =

1 1/ 3 −1/ 30 1/ 2 00 −1/ 3 1/ 3

⎢⎢⎢

⎥⎥⎥

xN = {x5, x4} cN = [0 0] N =0 00 11 0

⎢⎢⎢

⎥⎥⎥

Iteration 3:

1) y = cB B2−1 = 0 5 3⎡

⎣⎢⎤⎦⎥

1 1 / 3 −1 / 30 1 / 2 00 −1 / 3 1 / 3

⎢⎢⎢

⎥⎥⎥= 0 3 / 2 1⎡⎣⎢

⎤⎦⎥

2) z5 −c5 = ya5 −c5 = 0 3 / 2 1⎡⎣⎢

⎤⎦⎥

001

⎢⎢⎢

⎥⎥⎥−0 =1

z4 −c4 = ya4 −c4 = 0 3 / 2 1⎡⎣⎢

⎤⎦⎥

010

⎢⎢⎢

⎥⎥⎥−0 = 3 / 2

3) No negative coefficients, the current solution is OPTIMAL!

Solution:

xB =

x3x2x1

⎢⎢⎢⎢

⎥⎥⎥⎥

= B2−1b =

1 1/ 3 −1/ 30 1/ 2 00 −1/ 3 1/ 3

⎢⎢⎢

⎥⎥⎥

41218

⎢⎢⎢

⎥⎥⎥=

262

⎢⎢⎢

⎥⎥⎥

z = cB B2−1b = cB xB = 0 5 3⎡

⎣⎢⎤⎦⎥

262

⎢⎢⎢

⎥⎥⎥= 36