Slides Simplex PDF
Slides Simplex PDF
Program
Frédéric Giroire
FG Simplex 1/20
Motivation
FG Simplex 2/20
The simplex
FG Simplex 3/20
The simplex
2x1 + 3x2 + x3 ≤ 5
x4 ≥ 0.
FG Simplex 4/20
The simplex
4x1 + x2 − 2x3 ≤ 11
3x1 + 4x2 − 2x3 ≤ 8
We define x5 and x6 :
x5 = 11 − 4x1 − x2 − 2x3
x6 = 8 − 3x1 − 4x2 − 2x3
x5 ≥ 0, x6 ≥ 0.
FG Simplex 5/20
The simplex
x4 = 5 − 2x1 − 3x2 − x3
x5 = 11 − 4x1 − x2 − 2x3
x6 = 8 − 3x1 − 4x2 − 2x3
z = 5x1 + 4x2 + 3x3 .
Maximize z subject to x1 , x2 , x3 , x4 , x5 , x6 ≥ 0.
FG Simplex 6/20
The simplex
x4 = 5 − 2x1 − 3x2 − x3 = 5
Similarly, x5 = 11 and x6 = 8.
We get an initial solution
x1 = 0, x2 = 0, x3 = 0, x4 = 5, x5 = 11, x6 = 8
of value z = 0
FG Simplex 7/20
The simplex
Dictionary:
x4 = 5 − 2x1 − 3x2 − x3
x5 = 11 − 4x1 − x2 − 2x3
x6 = 8 − 3x1 − 4x2 − 2x3
z = 5x1 + 4x2 + 3x3 .
FG Simplex 8/20
The simplex
Dictionary:
x4 = 5 − 2x1 − 3x2 − x3
x5 = 11 − 4x1 − x2 − 2x3
x6 = 8 − 3x1 − 4x2 − 2x3
z = 5x1 + 4x2 + 3x3 .
FG Simplex 8/20
The simplex
x4 = 5 − 2x1 − 3x2 − x3
x5 = 11 − 4x1 − x2 − 2x3
x6 = 8 − 3x1 − 4x2 − 2x3
z = 5 x1 + 4x2 + 3x3 .
Here, we try to increase x1 .
FG Simplex 9/20
The simplex
x4 = 5 − 2x1 − 3x2 − x3
x5 = 11 − 4x1 − x2 − 2x3
x6 = 8 − 3x1 − 4x2 − 2x3
z = 5x1 + 4x2 + 3x3 .
We have x4 ≥ 0 .
5
It implies 5 − 2x1 ≥ 0, that is x1 ≤ .
2
FG Simplex 10/20
The simplex
x4 = 5 − 2x1 − 3x2 − x3
x5 = 11 − 4x1 − x2 − 2x3
x6 = 8 − 3x1 − 4x2 − 2x3
z = 5x1 + 4x2 + 3x3 .
We have x4 ≥ 0 .
It implies 5 − 2x1 ≥ 0, that is x1 ≤ 5/2 .
Similarly,
x5 ≥ 0 gives x1 ≤ 11/4.
x6 ≥ 0 gives x1 ≤ 8/3.
FG Simplex 11/20
The simplex
x4 = 5 − 2x1 − 3x2 − x3
x5 = 11 − 4x1 − x2 − 2x3
x6 = 8 − 3x1 − 4x2 − 2x3
z = 5x1 + 4x2 + 3x3 .
We have x4 ≥ 0 .
It implies 5 − 2x1 ≥ 0, that is x1 ≤ 5/2 Strongest constraint
Similarly,
x5 ≥ 0 gives x1 ≤ 11/4.
x6 ≥ 0 gives x1 ≤ 8/3.
FG Simplex 12/20
The simplex
x4 = 5 − 2x1 − 3x2 − x3
x5 = 11 − 4x1 − x2 − 2x3
x6 = 8 − 3x1 − 4x2 − 2x3
z = 5x1 + 4x2 + 3x3 .
We have x4 ≥ 0 .
It implies 5 − 2x1 ≥ 0, that is x1 ≤ 5/2 Strongest constraint
FG Simplex 13/20
The simplex
x4 = 5 − 2x1 − 3x2 − x3
x5 = 11 − 4x1 − x2 − 2x3
x6 = 8 − 3x1 − 4x2 − 2x3
z = 5x1 + 4x2 + 3x3 .
x1 enters the bases and x4 leaves it:
FG Simplex 14/20
The simplex
FG Simplex 15/20
The simplex
FG Simplex 16/20
The simplex
3 1 1
x1 = 5/ 2 − 2
x2 − 2
x3 − 2
x4
x5 = 1 + 5 x2 + 2 x4
1 1 3
x6 = 1/ 2 + 2
x2 − 2
x3 + 2
x4
z = 25/2 − 7/2 x2 + 1/2 x3 − 5/2 x4 .
FG Simplex 17/20
The simplex
5
x1 = 2
− 32 x2 − 1
2
x3 − 12 x4
x5 = 1 + 5 x2 + 2 x4
1
x6 = 2
+ 12 x2 − 1
2
x3 + 32 x4
25
z = 2
− 72 x2 + 1
2
x3 − 52 x4 .
FG Simplex 18/20
The simplex
x3 = 1 + x2 + 3x4 − 2x6
x1 = 2 − 2x2 − 2x4 + x6
x5 = 1 + 5x2 + 2x4
z = 13 − 3x2 − x4 − x6 .
x1 = 2, x2 = 0, x3 = 1, x4 = 0, x5 = 1, x6 = 0
of value z = 13.
FG Simplex 19/20
The simplex
x3 = 1 + x2 + 3x4 − 2x6
x1 = 2 − 2x2 − 2x4 + x6
x5 = 1 + 5x2 + 2x4
z = 13 − 3x2 − x4 − x6 .
x1 = 2, x2 = 0, x3 = 1, x4 = 0, x5 = 1, x6 = 0
of value z = 13.
FG Simplex 19/20
Take Aways
• Complexity:
• In theory, NP-complete (can explore a number of solutions
exponentiel in the number of variables and constraints).
• In practice, almost linear in the number of constraints.
FG Simplex 20/20