Ee/Econ 458 The Simplex Method: J. Mccalley
Ee/Econ 458 The Simplex Method: J. Mccalley
Ee/Econ 458 The Simplex Method: J. Mccalley
1
An approach
5
4 2
2 6
2
100
90
3
2 7 80
2
70
60
50
8
2 40
2
30
9
20
1 10
2 5 10
2
Definitions
3
An approach
1. Pick a corner point at random.
2. Move to an adjacent corner point that is better.
a. If there are two that are better, move to the one that is best.
b. If there are no better adjacent corner points, the current
corner point is the solution to the problem.
x1 0, x2 0, x3 0, x4 0, x5 0
9
Positive right-hand-sides
min f ( x)
g ( x)b We require b ≥ 0
x0
10
High-Level Version of Simplex Method
1. Initialization: Start at a corner point solution.
2. Iterative step: Move to a better adjacent corner point
feasible solution.
3. Optimality test: Determine if the current feasible
corner point is optimal using our optimality test (if
none of its adjacent feasible corner points are better,
then the current feasible corner point is optimal).
a. If the current feasible corner point is optimal, the
solution has been found, and the method
terminates.
b. If the current feasible corner point is not optimal,
then go to 2.
11
max F 3 x1 5 x2
s.t.
Initialization
x1 x3 4 xn+k is the slack variable.
2 x2 x4 12 a1x1 a2 x2 ... an xn xn k bk
3x1 2 x2 x5 18 Above equation is satisfied by
below basic solution
x1 0, x2 0, x3 0, x4 0, x5 0
x1 0, x2 0,..., xn 0, xn k bk
x1 0, x2 0, x3 0, x4 0, x5 0
16
Iterative step
Move from 1 to 2.
Crnr pnt feasible soltns Defining cnstrnt eqtns
1 (0,0) x1=0
x2=0
2 (0,6) x1=0
2 3
2x2=12
3 (2,6) 2x2=12
3x1+2x2=18
4 4 (4,3) 3x1+2x2=18
x1=4
5 (4,0) x1=4
1 5
x2=0
Start at (0,0).
1. The x2=0 constraint becomes inactive.
2. Move along the x1=0 constraint until you reach the next
corner point, which is (0,6).
3. The 2x =12 constraint becomes active. 17
Iterative step
Move from 2 to 3.
Crnr pnt feasible soltns Defining cnstrnt eqtns
1 (0,0) x1=0
x2=0
2 (0,6) x1=0
2 3
2x2=12
3 (2,6) 2x2=12
3x1+2x2=18
4 4 (4,3) 3x1+2x2=18
x1=4
5 (4,0) x1=4
1 5
x2=0
Any BFS has n variables 0. Any BFS has n non-basic variables. 22
Iterative step
Basic feasible solutions (BFSs)
Basic feasible soltns Defining cnstrnt eqtns
1 (0,0,4,12,18) x1=0
x2=0
2 3
2 (0,6,4,0,6) x1=0
2x2+x4 =12
3 (2,6,2,0,0) 2x2+x4 =12
4 3x1+2x2+x5=18
4 (4,3,0,6,0) 3x1+2x2+x5=18
x1+x3=4
1 5
5 (4,0,0,12,6) x1+x3=4
x2=0
Observation 3: The way we move from one
The way we move from one BFS BFS to another is by
to another is by exchanging exchanging exactly one non-
exactly one zeroed variable with basic variable with a basic
a non-zeroed variable. variable.
23
Iterative step
Three questions:
1.How is the entering basic variable identified?
2.How is the leaving basic variable identified?
3.How is the new basic feasible solution found?
24
Iterative step
1. How is the entering basic variable identified?
Basic feasible soltns Defining cnstrnt eqtns
The candidates for the entering 1 (0,0,4,12,18) x1=0
basic variable are the n nonbasic x2=0
(0,6,4,0,6) x1=0
variables. In the first step of our 2
2x2+x4 =12
example (solution 1 to 2), the 3 (2,6,2,0,0) 2x2+x4 =12
3x1+2x2+x5=18
candidates are x1 and x2. 4 (4,3,0,6,0) 3x1+2x2+x5=18
Criterion is: x1+x3=4
(4,0,0,12,6) x1+x3=4
Select the one that improves the 5
x2=0
objective at the highest rate (i.e.,
the largest amount of objective
per unit change in variable).
Objective F 3x1 5 x2
Increasing either variable, x1 or x2,
increases the objective, but x2
increases it the most for a given unit
change, since 5>3; so x2 is the
entering variable. 25
Iterative step
2. How is the leaving basic variable identified?
Basic feasible soltns Defining cnstrnt eqtns
(0,0,4,12,18) x1=0
The candidates for the leaving
1
x2=0
basic variable are the m basic 2 (0,6,4,0,6) x1=0
2x2+x4 =12
variables. In the first step of our 3 (2,6,2,0,0) 2x2+x4 =12
example (solution 1 to 2), the 3x1+2x2+x5=18
(4,3,0,6,0) 3x1+2x2+x5=18
candidates are x3, x4, and x5. The 4
x1+x3=4
balance between how much the 5 (4,0,0,12,6) x1+x3=4
x2=0
entering variable may increase
without pushing any current basicRecall initial point, origin, has all n DV zero and all m SV non-zero. There is 1
variable negative is controlled bySV per constraint, so each constraint contains exactly 1 basic variable at
initialization. Since iterations always cause each constraint to exchange 1 basic
Criterion
our is: Choose the
m constraints. and 1 non-basic variables, each constraint always has just 1 basic variable.
leaving variable to be the
Recall x2 is our entering variable. We want to identify the
basic variable that hits 0 constraint, when its basic variable is 0, most limits x 2.
first as the entering Basic Constraint Upper bound for x2
variable
variable is increased, as x3 x1+x3=4 No limit imposed
dictated by one of the m x4 2x2+x4=12 x2=(12-0)/2=6
constraint equations. x5 3x1+2x2+x5=18 x2=(18-3(0)-0)/2=9 26
Iterative step
2. How is the leaving basic variable identified?
Basic Constraint Upper bound for x2
variable
x3 x1+x3=4 No limit imposed
x4 2x2+x4=12 x2=(12-0)/2=6
x5 3x1+2x2+x5=18 x2=(18-3(0)-0)/2=9
F 3 x1 5 x2 F 3x1 5 x2 0
For the initial solution, we can write F together with constraint equations:
F 3x1 5 x2 0 (7)
x1 x3 4 (8)
2 x2 x4 12 (9)
3x1 2 x2 x5 18 (10)
The above is set up for our initial solution: (x1, x2, x3, x4, x5)=(0,0,4,12,18). We
observe values of the basic variables are the right-hand-sides of (8), (9), (10).
Because x1 and x2 are non-basic (0), the right-hand-side of (7) is the objective
value at this solution.
29
Iterative step
3. How is the new basic feasible solution found?
F 3x1 5 x2 0 (7)
x1 x3 4 (8)
2 x2 x4 12 (9)
3 x1 2 x2 x5 18 (10)
Goal: Have x2 enter the basis & x4 leave the basis so that, at the new
solution, our system of equations is in the same form as above
where:
• the values of the basic variables at the solution can be directly read
off as the right-hand-sides of those equations and
• the value of the objective at that solution can be directly read off as
To accomplish
the right-hand-side this… of the objective equation.
• Because x2 is going to be non-zero, it must show up in only one
constraint equation, with a 1 as its coefficient (so it can be directly read off),
and it must not appear in the objective equation (since it will not be 0).
• Because x4 is going to be 0, it must appear in the objective equation
(so the right-hand-side of the objective equation will directly give F) . 30
Iterative step
3. How is the new basic feasible solution found?
F 3x1 5 x2 0 (7)
x1 x3 4 (8)
2 x2 x4 12 (9)
3 x1 2 x2 x5 18 (10)
F
1 3 5 0 0 0 x1 0
0 1 0 1 0 0 x2 4
Entering variable: x2
Leaving variable: x4 0 0 2 0 1 0 x3 12
0 3 2 0 0 1 x4 18
x5
F
1 3 5 0 0 0 x1 0 1 3 5 0 0 0 0
0 1 0 1 0 4
0 1 0 0 x2 4 0 1 0
0 0 2 0 1 0 12 Pivot
0 0 2 0 1 0 x3 12
row
0 3 2 0 0 1 x4 18 0 3 2 0 0 1 18
x5