0% found this document useful (0 votes)
78 views27 pages

Dr. Joon-Yeoul Oh: IEEN 5335 Principles of Optimization

This document discusses the simplex algorithm for optimization problems. Specifically, it covers: 1) How to handle minimize problems using the simplex algorithm by converting it to a maximize problem in standard form. 2) The two-phase method for problems with inequality constraints, which first finds a feasible solution (Phase I) before finding the optimal solution (Phase II). 3) An example of applying the two-phase method to a linear program with two variables and inequality constraints. The example walks through setting up and solving the problem in both Phase I and Phase II.

Uploaded by

Soumojit Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views27 pages

Dr. Joon-Yeoul Oh: IEEN 5335 Principles of Optimization

This document discusses the simplex algorithm for optimization problems. Specifically, it covers: 1) How to handle minimize problems using the simplex algorithm by converting it to a maximize problem in standard form. 2) The two-phase method for problems with inequality constraints, which first finds a feasible solution (Phase I) before finding the optimal solution (Phase II). 3) An example of applying the two-phase method to a linear program with two variables and inequality constraints. The example walks through setting up and solving the problem in both Phase I and Phase II.

Uploaded by

Soumojit Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

IEEN 5335

Principles of Optimization

Lecture 5

Dr. Joon-Yeoul Oh

Dept. of Mechanical & Industrial Engineering


Texas A&M University – Kingsville
 This lecture note (#5) and the next lecture note (#6) will
cover:
 Simplex Algorithm – special cases
 Minimize problem

 Infeasible

 Unbounded

 Free variable

 Multiple optimal solutions

2
Agenda

 Simplex Algorithm
 Minimize problem
 Two-phase method

3
Minimize problem

 Consider the following simple problem

Min z = x1 + x2
s.t. x1 <= 5
x2 <= 5
x1, x2 >= 0

4
Minimize problem

 Standard form
- Max -z = -x1 - x2
s.t. x1 + x3 = 5
x2 + x4 = 5
x1, x2, x3, x4 >= 0

b.v z x1 x2 x3 x4 RHS
z -1 1 1 0 0 0
x3 0 1 0 1 0 5
x4 0 0 1 0 1 5
5
Two-phase method

 Consider the following problem

Min z = x1 - 5x2
s.t. 2x1 + 5x2 <= 10
x1 + x2 >= 1
x1, x2 >= 0

6
Two-phase method

 Graphical solution – Simplex Algorithm start at (0,0), and


the origin (0, 0) is not in feasible region. it indicates that
phase I is needed.
 Phase I – search for a feasible region

7
Two-phase method

 Two Phase method addresses “≥” and “=“ constraints


 It provides an important test for feasibility:
 Phase 1 asks: “Is this LP feasible?”
 Phase 2 asks: “What is the optimum solution?”

Infeasible Unbounded
Input

Feasible Optimal

Phase I Phase II
8
Two-phase method

 Phase I
 Puts a complete ID block in the tableau
 Introduction an “artificial objective” and “artificial
variables”
 Pivots to remove artificial variables from the tableau
 Stops when the tableau shows a feasible solution or
when the problem is found to be infeasible

9
Setting up the Phase I problem

 Introduce one artificial variable for each missing ID column


 Introduce the Phase I objective:
Min = ∑ artificial variables
 Maintain the Phase II objective as well
 Solve using pivot rules
 Phase I stops when:
 If finds the problem to be infeasible.
 If finds a tableau in which all artificial variables are
equal to 0.

10
Two-phase – Example 1

 Example
Min z = x1 - 5x2
s.t. 2x1 + 5x2 <= 10
x1 + x2 >= 1
x1, x2 >= 0
 Standard form
-Max -z = -x1 + 5x2
s.t. 2x1 + 5x2 + s1 = 10
x1 + x2 - s2 + a1 = 1
x1, x2, s1, s2, a1 >= 0
11
Two-phase – Example 1

 Phase I objective: Min ∑ ai


Min z1 = a1
 - Max -z1 = -a1
 - Max -z1 + a1 = 0

 Phase II objective: (keep it during Phase I)


Min z2 = x1 – 5x2
 - Max -z2 = -x1 + 5x2
 - Max -z2 + x1 – 5x2 = 0

12
Two-phase – Example 1

 Initial Phase I tableau

B.V z1 z2 x1 x2 s1 s2 a1 RHS
z1 -1 0 0 0 0 0 1 0
z2 0 -1 1 -5 0 0 0 0
s1 0 0 2 5 1 0 0 10
s2 0 0 1 1 0 -1 1 1

13
Two-phase – Example 1

 Phase I – step 1: make the coefficient of artificial variables


in z1 row 0.  new z1 row = z1 – a1

B.V z1 z2 x1 x2 s1 s2 a1 RHS
z1 -1 0 -1 -1 0 1 0 -1
z2 0 -1 1 -5 0 0 0 0
s1 0 0 2 5 1 0 0 10
a1 0 0 1 1 0 -1 1 1

14
Two-phase – Example 1

 Phase I – step 2: select entering and leaving variables.


 Ties for entering column – any candidate is fine.

B.V z1 z2 x1 x2 s1 s2 a1 RHS Ratio


z1 -1 0 -1 -1 0 1 0 -1
z2 0 -1 1 -5 0 0 0 0
s1 0 0 2 5 1 0 0 10 10/5
a1 0 0 1 1 0 -1 1 1 1/1

15
Two-phase – Example 1

 Phase I – step 3: update the tableau and check if the problem


is feasible (see the RHS value of z1. if it is 0, then Phase 1 is
done and problem is feasible). If not, make another pivot.

B.V z1 z2 x1 x2 s1 s2 a1 RHS
z1 -1 0 0 0 0 0 1 0
z2 0 -1 6 0 0 -5 5 5
s1 0 0 -3 0 1 5 -5 5
x2 0 0 1 1 0 -1 1 1
We found optimal for Phase I ; x = (0, 1), s = (5, 0), z2 = -5
16
Two-phase – Example 1

 Phase II – step 1: setting up for Phase II  remove z1 row


and al column.
 Do the optimality test – if it is optimal, stop. Otherwise,
select entering and leaving variables and make pivot.

B.V z2 x1 x2 s1 s2 RHS Ratio


z2 -1 6 0 0 -5 5
s1 0 -3 0 1 5 5 5/5
x2 0 1 1 0 -1 1

17
Two-phase – Example 1

 Phase II – step 2: update the tableau and do the optimality


test.
 If it is optimal (the coefficients of z2 row are all >= 0), stop.
Otherwise, select entering and leaving variables and make
pivot.
B.V z2 x1 x2 s1 s2 RHS
z2 -1 3 0 1 0 10
s2 0 -0.6 0 0.2 1 1
x2 0 0.4 1 0.2 0 2
We found optimal for Phase II ; x = (0, 2), s = (0, 1), z2 = -10
18
Two-phase – Example 2
 Example
Min z = x1 - 5x2
s.t. 2x1 + 5x2 <= 10
x1 + x2 >= 1
x1 >= 1
x1, x2 >= 0
 Standard form
-Max -z = -x1 + 5x2
s.t. 2x1 + 5x2 + s1 = 10
x1 + x2 - s2 + a1 = 1
x1 -s3 + a2 = 1
x1, x2, s1, s2, s3, a1, a2 >= 0
19
Two-phase – Example 2

 Phase I objective: Min ∑ ai


Min z1 = a1 + a2
 - Max -z1 = -a1 – a2
 - Max -z1 + a1 + a2 = 0

 Phase II objective: (keep it during Phase I)


Min z2 = x1 – 5x2
 - Max -z2 = -x1 + 5x2
 - Max -z2 + x1 – 5x2 = 0

20
Two-phase – Example 2

 Initial Phase I tableau

B.V z1 z2 x1 x2 s1 s2 s3 a1 a2 RHS
z1 -1 0 0 0 0 0 0 1 1 0
z2 0 -1 1 -5 0 0 0 0 0 0
s1 0 0 2 5 1 0 0 0 0 10
s2 0 0 1 1 0 -1 0 1 0 1
s3 0 0 1 0 0 0 -1 0 1 1

21
Two-phase – Example 2

 Phase I – step 1: make the coefficient of artificial variables


in z1 row 0.  new z1 row = z1 – a1 – a2

B.V z1 z2 x1 x2 s1 s2 s3 a1 a2 RHS
z1 -1 0 -2 -1 0 1 1 0 0 -2
z2 0 -1 1 -5 0 0 0 0 0 0
s1 0 0 2 5 1 0 0 0 0 10
a1 0 0 1 1 0 -1 0 1 0 1
a2 0 0 1 0 0 0 -1 0 1 1
Then, do the same procedure what we did for example 1.
22
Two-phase – Example 2

 Phase I – selecting entering variable and leaving variable

B.V z1 z2 x1 x2 s1 s2 s3 a1 a2 RHS Ratio


z1 -1 0 -2 -1 0 1 1 0 0 -2
z2 0 -1 1 -5 0 0 0 0 0 0
s1 0 0 2 5 1 0 0 0 0 10 10/2
a1 0 0 1 1 0 -1 0 1 0 1 1/1
a2 0 0 1 0 0 0 -1 0 1 1 1/1

Ratio for a1 and a2 are same so pick any one you want. I picked a1.
23
Two-phase – Example 2

 Phase I – not optimal yet. select entering variable and


leaving variable

B.V z1 z2 x1 x2 s1 s2 s3 a1 a2 RHS Ratio


z1 -1 0 0 1 0 -1 1 2 0 0
z2 0 -1 0 -6 0 1 0 -1 0 -1
s1 0 0 0 3 1 2 0 -2 0 8 8/2
x1 0 0 1 1 0 -1 0 1 0 1
a2 0 0 0 -1 0 1 -1 -1 1 0 0/1

Comment: z1 is zero but not optimal yet.


24
Two-phase – Example 2

 Phase I – found optimal for the phase 1 so this problem is


feasible.
B.V z1 z2 x1 x2 s1 s2 s3 a1 a2 RHS
z1 -1 0 0 0 0 0 0 1 1 0
z2 0 -1 0 -5 0 0 1 0 -1 -1
s1 0 0 0 5 1 0 2 0 -2 8
x1 0 0 1 0 0 0 -1 0 1 1
s2 0 0 0 -1 0 1 -1 -1 1 0

25
Two-phase – Example 2

 Phase II – start without z1 row and a1, a2 columns

B.V z1 z2 x1 x2 s1 s2 s3 RHS Ratio


z2 0 -1 0 -5 0 0 1 -1
s1 0 0 0 5 1 0 2 8 8/5
x1 0 0 1 0 0 0 -1 1
s2 0 0 0 -1 0 1 -1 0

26
Two-phase – Example 2

 Phase II – Found optimal solution.

B.V z1 z2 x1 x2 s1 s2 s3 RHS
z2 0 -1 0 0 1 0 3 7
x2 0 0 0 1 0.2 0 0.4 1.6
x1 0 0 1 0 0 0 -1 1
s2 0 0 0 0 0.2 1 -1 1.6

(x1, x2, s1, s2, s3) = (1, 1.6, 0, 1.6, 0), Z = -7

27

You might also like