Professional Documents
Culture Documents
3b.analysis of LP
3b.analysis of LP
Spring 2021
Recall: Linear Programming (Standard Form)
IE 311 2
How Does Gurobi Solve LPs?
IE 311 3
Main Steps of the (Primal) Simplex Method
• Although the Simplex Method can solve any LP in principle, we will first
look at well-structured LPs (those with an obvious initial BFS) and then
proceed with unstructured LPs (those without an obvious initial BFS).
• In particular, we will first learn how to solve maximization problems with
only ≤ constraints and a nonnegative right-hand-side (RHS) 𝒃 vector.
• In this case, an obvious BFS is available (WHY?)
• Then, we will discuss how to solve minimization problems with
minor modifications.
• Finally, we will learn how to incorporate ≥ and = constraints with an
arbitrary RHS vector.
• In these cases, some preliminary operations (Big-M or Two-Phase
methods) will be needed to obtain an initial BFS.
IE 311 5
A First Example
• We will first go over the following example LP and explain the steps of
𝑥2
the Simplex Method.
0
3 2
2
𝑥1
0 3
0 0
• For convenience, we defined a new variable 𝑥0 (column-0), which
represents the objective function value (row-0).
IE 311 6
A First Example: Step 1
IE 311 7
A First Example: Step 2
𝑥2
• In Step 2, we obtain an initial BFS:
0
3 2
2
𝑥1
0 3
0 0
• Convention: Variable 𝑥0 will ALWAYS be basic.
• Note: Since the original LP has only ≤ constraints with nonnegative
RHS, the slack variables 𝑥3 and 𝑥4 are chosen as basic variables.
• RHS column in this tableau gives the current values of the basic variables.
IE 311 8
A First Example: Step 3
IE 311 10
A First Example: Step 4
• In Step 4, we next decide which basic variable to make nonbasic (look at
the column of the entering variable and RHS):
0
3
2
• Idea: How can we make the column of the 2
entering variable a unit vector by pivoting?
𝑥1
0 3
0 0
IE 311 12
A First Example: Step 3 (Again)
IE 311 13
A First Example: Step 4 (Again)
IE 311 15
A First Example: Step 5 (Again)
0
3
2
2
• Idea: How can we make the column of the
entering variable a unit vector by pivoting? 𝑥1
0 3
0 0
IE 311 16
A First Example: Step 3 (Again)
IE 311 18
Main Steps of the Simplex Method: Structured LPs
IE 311 19
Main Steps of the Simplex Method: Structured LPs
IE 311 20
Main Steps of the Simplex Method: Structured LPs
IE 311 21
Main Steps of the Simplex Method: Structured LPs
IE 311 22
Main Steps of the Simplex Method: Structured LPs
IE 311 23
Main Steps of the Simplex Method: Structured LPs
• Step 5 Use EROs to find a new BFS with a better objective function
value.
• Use the entry in the intersection of the column of the entering
variable and the row of the leaving variable as pivot.
• Apply EROs to obtain the new BFS.
• Go to Step 3.
IE 311 24
Some Useful Observations
• The value of the entering variable in the next BFS is equal to the
minimum ratio.
• The change in the objective value is equal to the minimum ratio
times (minus) the objective coefficient of the entering variable.
• If there is a tie in the minimum ratio, the next BFS is degenerate.
• If the objective coefficient of a nonbasic variable is 0 in the optimal
tableau, then there exist multiple (or alternative) optima.
• If the LP is unbounded, the column of the entering variable can be
used to determine a direction of unboundedness which makes
positive inner product with the objective vector.
IE 311 25
Example 2
IE 311 27
Example 2: Iteration 2
IE 311 28
Example 2: Iteration 3
IE 311 29
Degenerate BFS: Example 3
0
4 2
2
𝑥1
0 5/2
0 0
IE 311 30
Example 3: Iteration 1
𝑥2
0
4 2
• Entering Variable: 𝑥1 (most negative coefficient = −5) 2
• Leaving Variable: 𝑥4 (minimum ratio = 5/2)
𝑥1
0 5/2
0 0
IE 311 31
Example 3: Iteration 2
𝑥2
0
4 2
• Entering Variable: 𝑥2 (most negative coefficient = −7/4) 2
• Leaving Variable: 𝑥3 (minimum ratio = 2 – there is a tie!)
𝑥1
0 5/2
0 0
IE 311 32
Example 3: Iteration 3
𝑥2
0
4 2
• Entering Variable: 𝑥4 (most negative coefficient = −1/2) 2
• Leaving Variable: 𝑥5 (minimum ratio = 0 – degenerate pivot)
𝑥1
0 5/2
0 0
IE 311 33
Example 3: Iteration 4
IE 311 34
Multiple (or Alternative) Optima: Example 4
56/17
45/17
0
1
𝑥1
0 7
0 0
IE 311 35
Example 4: Iteration 1
𝑥2
56/17
45/17
IE 311 36
Example 4: Iteration 2
𝑥2
56/17
45/17
IE 311 37
Example 4: Follow-up
0
1
𝑥1
0 7
0 0
IE 311 38
Unbounded LPs: Example 5
0
3
𝑥1
0 4
0 0
IE 311 39
Example 5: Iteration 1
𝑥2
0
• Entering Variable: 𝑥2 (most negative coefficient = −3) 3
• Leaving Variable: 𝑥4 (minimum ratio = 3)
𝑥1
0 4
0 0
IE 311 40
Example 5: Iteration 2
𝑥2
0
3
𝑥1
0 4
• Entering Variable: 𝑥1 (most negative coefficient = −7) 0 0
• Leaving Variable: NONE! LP is unbounded.
IE 311 41
Example 5: Follow-up
• Suppose 𝑥1 ‘enters’ the basis and its value is increased by 1 unit. Then,
• due to row-1, 𝑥3 is increased by 3 units,
• due to row-2, 𝑥2 is increased by 2 units,
• 𝑥4 is unaffected since it is nonbasic.
𝑑1 1
𝑑2 2
• ⇒ Direction of unboundedness (standard form): =
𝑑3 3
𝑑4 0
𝑑1 1
• ⇒ Direction of unboundedness (original variables): =
IE 311 𝑑2 2 42
Minimization Problems
IE 311 43
Tableau Implementation of the Simplex Method
with Initial BFS: Python Code
IE 311 44