Sunteți pe pagina 1din 27

1

Lecture 3 The Simplex Method for LP


Principles of Simplex
Geometric Interpretation and Key Concepts
The Algebraic Simplex Method
Slack variables
Augmented Solution, Basic Solution
Basic/Non-basic Variables
Canonical System of Equations
Optimality Test

Learning outcomes: understand the geometric concepts behind the
Simplex method; relate the geometric and algebraic interpretations
of the Simplex method; apply the algebraic Simplex method step by
step to solve small LP problems.
Operations Research

2
Principles of Simplex
Developed by G. Dantzig in 1947, this is a very efficient
algebraic procedure to solve very large LP problems.

The underlying principles of the Simplex method are
based on the geometric concepts:
constraint boundaries
corner-point solutions
corner-point feasible (CPF) solutions
corner-point infeasible solutions
adjacent CPF solutions
edges of the feasible region
a CPF solution is optimal if it does not have adjacent CPF
solutions that are better

3
0
1
2
3
4
5
6
1 2 3 4 5 6
x
1
x
2
Geometric Concepts of Simplex
(4)
(5)
(2)
(3)
example problem ATLAS
(6) 0 , 0
(5) 2
(4) 1
(3) 6 2
(2) 24 4 6
: Subject to
(1) 4 5 : Maximise
2 1
2
2 1
2 1
2 1
2 1
> >
s
s +
s +
s +
+ =
x x
x
x x
x x
x x
x x Z
4
0
1
2
3
4
5
6
1 2 3 4 5 6
x
1
x
2
(4)
(5)
(2)
(3)
The Simplex Procedure
1. Initialisation
2. Optimality Test
3. If Optimal, Stop
4. If not Optimal, perform
iteration: move to better
adjacent CPF solution
and then go to step 2.
(6) 0 , 0
(5) 2
(4) 1
(3) 6 2
(2) 24 4 6
: Subject to
(1) 4 5 : Maximise
2 1
2
2 1
2 1
2 1
2 1
> >
s
s +
s +
s +
+ =
x x
x
x x
x x
x x
x x Z
5
Key Concepts of the Simplex Procedure
It focuses only on CPF solutions (assuming there is at least
one).
In each iteration, another CPF solution is explored.
If possible, the origin (x
i
= 0 i) being a CPF solution, is
selected as the initial point.
The procedure moves to adjacent CPF solutions by moving
along the edges of the feasible region.
Better adjacent CPF solutions are identified by positive rate
of improvement on the objective value Z.
If the rate of improvement along the edges emanating from
the current CPF solution are all negative, then the current
CPF solution is optimal.

6
Importance of the Simplex Method
Simplex is the standard method for solving LP problems
Even modern algorithms to solve large IP problems are
based on successive LP relaxations solved using Simplex
Variants of the Simplex method are tailored for specific
types of problems
The Primal Simplex method is simply known as Simplex
The Dual Simplex method is efficient for re-optimization
after the model has changed (change of coefficients, change
of right-hand side values, addition/deletion of constraints)
The Revised Simplex method is useful as part of a
technique called Column Generation for solving very large
LP problems


7
Special Cases in the Simplex Method
The form of the Simplex method explained in this lecture
works for a given format of the LP model:
Maximisation objective (starting from solution x
i
=0 i
is straightforward)
Inequalities in the constraints are of type (adding
slack variables makes sense)
The right-hand side values b
i
in the constraints are
positive
Non-negativity constraints in all decision variables.

To deal with variations of the above LP model formal,
some algebraic manipulation is required to prepare the
augmented model.



8
Unbounded Search Space
No leaving basic variable can be identified in Step 2 of a
given iteration. This will happen if there is no bound on
the increase of the entering basic variable.

Multiple Optimal Solutions
The Simplex method stops immediately after the first
optimal solution is found. Multiple optimal solutions
exist if at least one of the non-basic variables has a
coefficient of zero in the objective function equation.
Additional optimal solutions can be obtained by
performing additional iterations of the Simplex method,
each time choosing a non-basic variable with zero
coefficient as the entering basic variable.
9
The Algebraic Simplex Method
Convert constraints to equations
Introduce 1 slack variable in each functional constraint
to obtain equalities:
0 and 24 4 6 24 4 6
3 3 2 1 2 1
> = + + s + x x x x x x
0 and 6 2 6 2
4 4 2 1 2 1
> = + + s + x x x x x x
0 and 1 1
5 5 2 1 2 1
> = + + s + x x x x x x
0 and 2 2
6 6 2 2
> = + s x x x x
Example 5.1 Apply the algebraic Simplex method to solve the
ATLAS maximisation problem.
(6) 0 , 0
(5) 2
(4) 1
(3) 6 2
(2) 24 4 6 : Subject to
(1) 4 5 : Maximise
2 1
2
2 1
2 1
2 1
2 1
> >
s
s +
s +
s +
+ =
x x
x
x x
x x
x x
x x Z
10
The result is an augmented model
(6) 6 ... 1 for 0
(5) 2
(4) 1
(3) 6 2
(2) 24 4 6 : Subject to
(1) 0 4 5 : Maximise
6 2
5 2 1
4 2 1
3 2 1
2 1
= >
= +
= + +
= + +
= + +
=
i x
x x
x x x
x x x
x x x
x x Z
i
0
1
2
3
4
5
6
1 2 3 4 5 6
x
1
x
2
(4)
(5)
(2)
(3)
For a given solution, the
value of the slack variable
indicates if the solution is:
On the constraint
boundary
On the feasible region
On the infeasible region
11
Augmented solutions and basic solutions
0
1
2
3
4
5
6
1 2 3 4 5 6
x
1
x
2
(4)
(5)
(2)
(3)
For a given solution, the
augmented solution is
obtained by calculating
the value of the slack
variables. A basic solution
is an augmented corner-
point solution.
(6) 6 ... 1 for 0
(5) 2
(4) 1
(3) 6 2
(2) 24 4 6 : Subject to
(1) 0 4 5 : Maximise
6 2
5 2 1
4 2 1
3 2 1
2 1
= >
= +
= + +
= + +
= + +
=
i x
x x
x x x
x x x
x x x
x x Z
i
12
Algebraic procedure from the augmented model
From the set of variables in the augmented model, some
are designated as basic variables and the others are
designated as non-basic variables during the solution
procedure.

The non-basic variables are set to zero and the basic
variables are calculated by solving the equations
(augmented constraints).

Initialisation
0
so , variables basic - non the as designated are and
2 1
2 1
= = x x
x x
6 5 4 3
2 1
, , , : basic
, : basic - non
x x x x
x x
13
Solving for the basic variables from the augmented model:
(6) 6 ... 1 for 0
2 (5) 2
1 (4) 1
6 (3) 6 2
24 (2) 24 4 6
: Subject to
(1) 0 4 5 : Maximise
6 6 2
5 5 2 1
4 4 2 1
3 3 2 1
2 1
= >
= = +
= = + +
= = + +
= = + +
=
i x
x x x
x x x x
x x x x
x x x x
x x Z
i
The initial basic feasible (BF) solution: (0,0,24,6,1,2)


Optimality Test
The initial BF solution (0,0,24,6,1,2) is not optimal

6 5 4 3
2 1
, , , : basic
, : basic - non
x x x x
x x
(1) 4 5
2 1
x x Z + =
14
Iteration 1
1. Determine direction of movement.
Rate of improvement 5 (corresponding to x
1
) is better.
The non-basic variable x
1
is now called the entering basic
variable.
2 (5) 2
bounds no so 1 (4) 1
6 so 6 (3) 6 2
4 so 6 24 (2) 24 4 6
6 6 2
1 1 5 5 2 1
1 1 4 4 2 1
1 1 3 3 2 1
= = +
+ = = + +
s = = + +
s = = + +
x x x
x x x x x x
x x x x x x
x x x x x x
2. Determine when to stop the movement.
Increase x
1
as much as possible but maintain the other non-
basic variables on zero (x
2
= 0), maintain the satisfaction of
the equations, and maintain variables non-negative.
(1) 4 5
2 1
x x Z + =
15
(cont. Step 2)
Then, x
1
can be increased up to 4 as indicated by the
augmented constraint (2).
The basic variable x
3
becomes the leaving basic variable.

(5) 2
(4) 1
(3) 6 2
(2) 24 4 6
(1) 0 4 5
6 2
5 2 1
4 2 1
3 2 1
2 1
= +
= + +
= + +
= + +
=
x x
x x x
x x x
x x x
x x Z
6 5 4 1
3 2
, , , : basic
, : basic - non
x x x x
x x
3. Solving for the new BF solution
Initial BF solution: (0,0,24,6,1,2)
New BF solution: (4,0,0,?,?,?)

16
(cont. Step 3)
The coefficient pattern of the leaving basic variable x
3

(0,1,0,0,0) is reproduced for the entering variable x
1
by
means of algebraic manipulation.
(5) 2
(4) 1
(3) 6 2
(2) 24 4 6
(1) 0 4 5
6 2
5 2 1
4 2 1
3 2 1
2 1
= +
= + +
= + +
= + +
=
x x
x x x
x x x
x x x
x x Z
(1) 0 2
6
5
3
2
3 2
= + x x Z
Given the new non-basic variables
x
2
=0 and x
3
=0 then:
Z=20, x
1
=4, x
4
=2, x
5
=5, x
6
=2

The new BF solution: (4,0,0,2,5,2)
6 5 4 1
3 2
, , , : basic
, : basic - non
x x x x
x x
(2) 4
6
1
3
2
3 2 1
= + + x x x
(3) 2
6
1
3
4
4 3 2
= + x x x
(5) 2
6 2
= + x x
(4) 5
6
1
3
5
5 3 2
= + + x x x
17
(1)
6
5
3
2
20
3 2
x x Z + =
Optimality Test
The new BF solution (4,0,0,2,5,2) is not optimal.
Iteration 2
1. Determine direction of movement.
Rate of improvement 2/3 (corresponding to x
2
) is better.
The non-basic variable x
2
is now the entering basic variable.
2. Determine when to stop the movement.
Increase x
2
as much as possible but maintain the other non-
basic variables on zero (x
3
= 0), maintain the satisfaction of
the equations, and maintain variables non-negative.
18
(cont. Step 2)
2 so 2 (5) 2
3 so
3
5
5 (4) 5
6
1
3
5
4
6
so
3
4
2 (3) 2
6
1
3
4
6 so
3
2
4 (2) 4
6
1
3
2
2 2 6 6 2
2 2 5 5 3 2
2 2 4 4 3 2
2 2 1 3 2 1
s = = +
s = = + +
s = = +
s = = + +
x x x x x
x x x x x x
x x x x x x
x x x x x x
Then, x
2
can be increased up to 6/4=1.5 as indicated by the
augmented constraint (3).
The basic variable x
4
becomes the leaving basic variable.
6 5 2 1
4 3
, , , : basic
, : basic - non
x x x x
x x
19
3. Solving for the new BF solution
Previous BF solution: (4,0,0,2,5,2)
New BF solution: (?,1.5,0,0,?,?)
The coefficient pattern of the leaving basic variable x
4

(0,0,1,0,0) is reproduced for the entering variable x
2
by
means of algebraic manipulation.


(5) 2
(4) 5
6
1
3
5
(3) 2
6
1
3
4
(2) 4
6
1
3
2
(1) 0 2
6
5
3
2
6 2
5 3 2
4 3 2
3 2 1
3 2
= +
= + +
= +
= + +
= +
x x
x x x
x x x
x x x
x x Z
(3)
2
3
4
3
8
1
4 3 2
= + x x x
6 5 2 1
4 3
, , , : basic
, : basic - non
x x x x
x x
(1) 21
2
1
4
3
4 3
= + + x x Z
(2) 3
2
1
4
1
4 3 1
= + x x x
(4)
2
5
4
5
8
3
5 4 3
= + x x x
(5)
2
1
4
3
8
1
6 4 3
= + x x x
20
(cont. Step 3)

Since the new non-basic variables x
3
=0 and x
4
=0 then:
Z=21, x
1
=3, x
2
=1.5, x
5
=5/2, x
6
=1/2

The new BF solution: (3,1.5,0,0,2.5,0.5)
Optimality Test
The new BF solution (3,1.5,0,0,2.5,0.5) is optimal because
in the new objective function both x
3
and x
4
have negative
coefficient, so increasing any of them would lead to a worse
adjacent BF solution.
(1)
2
1
4
3
21
4 3
x x Z =
6 5 2 1
4 3
, , , : basic
, : basic - non
x x x x
x x
21
Example 5.2 Apply the algebraic Simplex method to solve the WENBU
maximisation problem.
Augmented Model
0 , 0
(4) 600 7 5
(3) 1500 25
(2) 800 0 1 : Subject to
(1) 10 25 : Maximise
2 1
2 1
1
2
2 1
> >
s +
s
s
+ =
x x
x x
x
x
x x Z
0 , , , , 0
600 7 5 ) 4 (
1500 25 (3)
800 0 1 ) 2 (
0 10 25 ) 1 (
5 4 3 2 1
5 2 1
4 1
3 2
2 1
> >
= + +
= +
= +
=
x x x x x
x x x
x x
x x
x x Z
22
Example 5.2 (cont.)
Initialisation
5 4 3
2 1
, , : basic
, : basic - non
x x x
x x
600 600 7 5 ) 4 (
1500 1500 25 (3)
800 800 0 1 ) 2 (
0 10 25 ) 1 (
5 5 2 1
4 4 1
3 3 2
2 1
= = + +
= = +
= = +
=
x x x x
x x x
x x x
x x Z
(1) 10 24
2 1
x x Z + =
Optimality Test
New BF solution (0,0,800,1500,600) with Z = 0 is not optimal.
23
Example 5.2 (cont.)
Iteration 1
( )
( )
( ) 120 5 600 600 7 5 ) 4 (
60 25 1500 1500 25 (3)
on bound no 800 800 0 1 ) 2 (
0 10 25 ) 1 (
1 1 5 5 2 1
1 1 4 4 1
1 3 3 2
2 1
s = = + +
s = = +
= = +
=
x x x x x x
x x x x x
x x x x
x x Z
x
1
can increase up to 60 as given by (3)
Leaving basic variable: x
4
New BF solution: (60,0,?,0,?)

5 3 1
4 2
, , : basic
, : basic - non
x x x
x x
= + +
= +
= +
=
600 7 5 ) 4 (
1500 25 (3)
800 0 1 ) 2 (
0 10 25 ) 1 (
5 2 1
4 1
3 2
2 1
x x x
x x
x x
x x Z
60
25
1
4 1
= + x x
1500 10
4 2
= + x x Z
800 10
3 2
= + x x
300
5
1
7
5 4 2
= + x x x
New BF solution (60,0,800,0,300) Z = 1500

Entering basic variable: x
1
24
Example 5.2 (cont.)
(1) 10 1500
4 2
x x Z + =
Optimality Test
New BF solution (60,0,800,0,300) with Z = 1500 is not optimal.
5 3 1
4 2
, , : basic
, : basic - non
x x x
x x
Iteration 2
( )
( )
( )
7
300
7 300 300
5
1
7 ) 4 (
on bound no 60 60
25
1
(3)
80 10 800 800 0 1 ) 2 (
1500 10 ) 1 (
2 2 5 5 4 2
2 1 4 1
2 2 3 3 2
4 2
s = = +
= = +
s = = +
= +
x x x x x x
x x x x
x x x x x
x x Z
Entering basic variable: x
2
x
2
can increase up to 300/7 ~ 42.86 as given by (4)
Leaving basic variable: x
5
New BF solution: (?,300/7,?,0,0)

3 2 1
5 4
, , : basic
, : basic - non
x x x
x x
25
Example 5.2 (cont.)
= +
= +
= +
= +
300
5
1
7 ) 4 (
60
25
1
(3)
800 0 1 ) 2 (
1500 10 ) 1 (
5 5 2
4 1
3 2
4 2
x x x
x x
x x
x x Z
60
25
1
4 1
= + x x
7
13500
7
10
35
25
5 4
= + + x x Z
7
2600
7
10
35
10
5 4 3
= + x x x
7
300
7
1
35
1
5 4 2
= + x x x
New BF solution (60,300/7,2600/7,0,0) Z = 13500/7

3 2 1
5 4
, , : basic
, : basic - non
x x x
x x
(1)
7
10
35
25
7
13500
5 4
x x Z =
Optimality Test
New BF solution (60,42.86,371.42,0,0) with Z = 1928.57 is optimal
Example 5.3
For the following LP model and
with reference to the Simplex method in algebraic form, write the
augmented model, find the initial (basic feasible) BF solution and
determine if this initial solution is optimal or not. Then, continue
the process and work through the steps of the Simplex method (in
algebraic form) to solve this model. Please label clearly each of the
steps and calculations carried out.


26
) 5 ( 0 , 0
(4) 10 2
(3) 15 3
(2) 4 : Subject to
(1) 2 3 : Maximise
2 1
2 1
2 1
1
2 1
> >
s +
s +
s
+ =
x x
x x
x x
x
x x Z
Example 5.4 For the following LP model and with reference to the
Simplex method in algebraic form, write the augmented model, find
the initial (basic feasible) BF solution and determine if this initial
solution is optimal or not. Then, continue the process and work
through the steps of the Simplex method (in algebraic form) to solve
this model. Please label clearly each of the steps and calculations
carried out.


27
) 4 ( 0 , 0
(3) 30 3
(2) 30 3 : Subject to
(1) : Maximise
2 1
2 1
2 1
2 1
> >
s +
s +
=
x x
x x
x x
x x Z

S-ar putea să vă placă și