Vous êtes sur la page 1sur 15

Linear Programming: The Simplex Method

„ The Essence of the Simplex Method


„ An Overview of the Simplex Method
„ Standard Form
„ Tableau Form
„ Setting Up the Initial Simplex Tableau
„ Improving the Solution
„ Calculating the Next Tableau
„ Solving a Minimization Problem LINEAR PROGRAMMING:
Special Cases
THE SIMPLEX METHOD
„

Slide 1 Slide 2

The Essence of the Simplex Method Working Example

„ The simplex method is an algebraic procedure, its


underlying concepts are geometric.
Maximize Z = 3X1 + 5X2
„ Understanding these geometric concepts provides a Subject to:
strong intuitive feeling for how the simplex method
operates and what makes it so efficient. X1 ≤ 4
„ To illustrate the general geometric concepts consider 2X2 ≤ 12
the following problem: 3X1 + 2X2 ≤ 18

Slide 3 Slide 4
Corner Point Feasible Solutions

„ The points of intersection are the corner-point


solutions (CPF solutions) that lie on the corners of the
feasible region (0, 0), (0, 6), (2, 6), (4, 3), and (4, 0)
„ each corner-point solution lies at the intersection of
two constraint boundaries.
„ In general for a linear programming problem with n
decision variables, each of its corner-point solutions
lies at the intersection of n constraint boundaries

„ Each CPF solution has two adjacent CPF solutions

Slide 5 Slide 6

Adjacent feasible solutions

(0,0) and (0,6) adjacent


For any linear programming model with n (0,6) and (2,6) adjacent
decision variables, two CPF solutions are (2,6) and (4,3) adjacent
(4,3) and (4,0) adjacent
2, 6
adjacent to each other if they share n-1 0, 6 (4,0) and (0,0) adjacent
constraints. The two adjacent CPF solutions There are 5 edges.
are connected by a line segment that lies
4,3 From each CPF solution,
on the same shared constraint boundaries. 2 edges emanate.
Such a constraint boundary is referred to as
Each CPF solution has 2
an edge of the feasible region. adjacent solutions.

0,0 4,0

Slide 7 Slide 8
The Essence of the Simplex Method (Cont.) Solving the Example

„ Optimality test: „ Here is an outline of what the simplex method does


If a CPF solution has no adjacent CPF solutions that are (from a geometric viewpoint) to solve the problem
better (as measured by Z), then it must be an optimal „ Initialization: Choose (0, 0) as the initial CPF solution to
solution. examine.
„ Optimality Test: Conclude that (0, 0) is not an optimal
solution. (Adjacent CPF solutions are better.)
„ Iteration 1: Move to a better adjacent CPF solution, (0,
Direction of increase Z 6), by performing the following three steps.
1. Considering the two edges of the feasible region
that emanate from (0, 0), choose to move along
the edge that leads to maximizing Z (i.e., x2 axis)
2. Stop at the first new constraint boundary: 2x2= 12.
3. Solve for the intersection of the new set of
Slide 9 constraint boundaries: (0, 6) Slide 10

Solving the Example The Key Solution Concepts

„ Optimality Test: Conclude that (0, 6) is not an optimal „ Solution concept 1: The simplex method focuses only on
solution. (An adjacent CPF solution is better.) CPF solutions. (i.e., finding a best CPF solution)
„ Solution concept 2: The simplex method is an iterative
„ Iteration 2: Move to a better adjacent CPF solution, (2, 6), algorithm
• Considering the two edges of the feasible region that
emanate from (0, 6), choose to move along the edge
that leads to the right.
• Stop at the first new constraint boundary encountered
when moving in that direction: 3x +2x = 12.
1 2

• Solve for the intersection of the new set of constraint „ Solution concept 3: Whenever possible, the initialization of
boundaries: (2, 6). the simplex method chooses the origin (all decision variables
„ Optimality Test: Conclude that (2, 6) is an optimal equal to zero) to be the initial CPF solution.
solution, so stop
Slide 11 Slide 12
The Key Solution Concepts
Setting up the Simplex Method
„ Solution concept 4: in the following iteration move from the
current CPF solution to a better one, it always chooses a CPF
solution that is adjacent to the current one. We convert the inequalities to equalities by use
„ Solution concept 5: examines each of the edges of the of slack variables (and artificial variables for
feasible region that emanate from this CPF solution, move GE constraints).
along the one with the largest rate of improvement in Z.
„ Solution concept 6: optimality test consists simply of Let X3 be a slack for the first constraint
checking whether any of the edges give a positive rate of
improvement in Z. If none do, then the current CPF solution X1 ≤ 4 becomes X1 + X3 = 4
is optimal.
With X3 ≥ 0

Slide 13

Working Example: Augmented Form Augmented Solution

Maximize Z = 3X1 + 5X2 The augmented solution contains values for


Subject to: the decision variables AND values for the
slacks. So if we augment the solution (3, 2)
X1 + X3 = 4 in this example by the values of the slacks we
2X2 +X4 = 12 get (3, 2, 1, 8, 5).
3X1 + 2X2 +X5 = 18
A basic solution is an augmented corner-point
all X variables non-negative solution.
Properties of a basic solution Example: BF Solution
z Each variable is either basic or non-basic
z The number of basic variables equals the number of X1 + X3 = 4
functional constraints. 2X2 +X4 = 12
z The number of non-basic variables equals the total 3X1 + 2X2 +X5 = 18
number of variables minus the number of functional
constraints.
Set X1 and X4 = 0 (non-basic). From
z The non-basic variables are set equal to zero.
first constraint, X3 =4. From second
z The values of the basic variables are found by solving
the simultaneous equation system. constraint, X2 = 6. From third constraint,
z If the basic solution satisfies the non-negativity X5 =6.
consideration, it is called a basic feasible solution.
(0, 6, 4, 0, 6)

Test for adjacent points Algebra of the Simplex


Initialization: X1 = 0 and X2 = 0
Two BF solutions are adjacent if all but
one of their non-basic variables are the same. Yields: X3 = 4, X4 = 12, and X5 = 18
BFS (0, 0, 4, 12, 18)
All but one of the basic variables would correspond
in the two points, but perhaps with different X1(0) + X3 =4
values. 2X2(0) + X4 =12
3X1(0) + 2X2(0) + X5 = 18
Moving to an adjacent point means we swap one Notice that the BFS can be read immediately
basic variable for a non-basic one. One variable from RHS. The simplex used a procedure
enters; the other leaves. (Gaussian elimination) to convert the equations
to the same convenient form with each iteration.
Geometric Algebraic Geometric Algebraic
z Choose (0,0) as initial z Choose X1and X2 to be z Iteration 1, step 2; z Iteration 1, step 2:
CPF solution. non-basic for initial BFS Stop when the first Stop when the first
z Optimality test: not (0,0,4,12,18)
new constraint basic variable (X3,
optimal because moving z Not optimal because boundary (X2=6) is X4, or X5) drops to
along either edge increasing either non-
increases Z. basic variable increases reached. zero.
z Iteration 1, step 1: Move Z. z Iteration 1, step 3: z Iteration 1, step 3.
up the edge lying on the z Iteration 1, step 1: Find the intersection With X2 now basic
X2 axis. Increase X2 while of the new pair of and X4 non-basic,
adjusting other variable constraint boundaries: solve the system of
values to satisfy the (0,6) is the new CPF equations to find the
system of equations.
solution. new BFS (0,6,4,0,6)

Geometric Algebraic Direction of Movement


z Optimality test: Not z Optimality test: Not Z = 3X1 + 5X2
optimal because moving optimal because
along the edge from (0,6) increasing one non-basic
to the right increases Z. variable (X1) increases Z. If we increase X1 rate of improvement is 3.
z Iteration 2: Move along z Iteration 2: Increase X1, If we increase X2 rate of improvement is 5.
the edge to the right and while adjusting other Choose X2.
stop when the new variables and stop when
constraint boundary is the first basic variable X2 is the entering basic variable for iteration 1.
reached. reaches 0.
z Optimality test : (optimal) z Optimality test: (optimal)
Where to stop Minimum Ratio Test
Increasing X2 increases Z. We want to go as
The objective of the test is to determine which
far as possible without leaving the feasible
currently basic variable will drop to zero
region.
and become non-basic. We can rule out the
basic variable in any equation where the
Check the constraints.
coefficient of the entering variable is zero
X3 = 4 ≥ 0 No upper bound on X2
or negative since such a basic feasible variable
X4 = 12 – 2X2 ≥ 0 X2 ≤ 6 to keep X4 non-neg
would not decrease as the entering variable
X5 = 18 – 2X2 ≥ 0 X2 ≤ 9 to keep X5 non-neg
increases.
Thus, X2 can be increased to 6, at which point
X4 drops to zero (non-basic). This is the
minimum ratio test.

Our Pivot Using Matrix Algebra Solving for the new BFS

zWe found the largest entry in the Objective Step 3 of the iteration is finding the new BFS.
row (greatest increase in Z).
We know that X1=0, X2=6, and X4=0.
zThe variable in that column was the We need to solve for X3 and X5.
entering variable.
z We did the minimum ratio test by dividing Z – 3X1 – 5X2 =0
X1 +X3 =4
the RHS entries by the positive entries in
2X2 + X4 = 12
the column. The current basic variable is 3X1 +2X2 +X5 = 18
determined by this equation.
Current coefficients on X4 are (0,0,1,0). We
want to make this the pattern of coefficients for X2.
Solving for new BF Solution, Continued Transformed Equations

To get the desired pattern of coefficients for Z - 3X1 + 5/2X4 = 30


X2, we use matrix algebra. Multiple or divide X1 +X3 =4
by a non-zero constant. Add or subtract X2 + ½ X4 =6
multiples of one equation from another. 3X1 - X4 + X5 =6

The current coefficients on X2 are Since X1 = 0 and X4 = 0, the equations in


(-5,0,2,3) and we want them to be this form give the BFS
(0,0,1,0) (0, 6, 4, 0, 6)

Optimality test for new BF solution Tabular form


The current objective function gives the
value of Z in terms of only the current zTabular form provides a summary of
nonbasic variables. important information
zThe simplex tableau is a compact display
Z = 30 + 3X1 – 5/2 X4
of the system of equations
If X1 increases, Z will increase.
In iteration 2, we let X1 enter and find a
variable to leave. Or minimum ratio test
indicates X5 will leave. We repeat the algebraic
manipulations to reproduce the pattern of coefficients
for X5 (0,0,0,1) as the new coefficients of X1.
Simplex Tableau Pivots
Z – 3X1 – 5X2 =0
X1 +X3 =4
2X2 + X4 = 12
3X1 +2X2 +X5 = 18

Optimality test: The current BFS is optimal if


every coefficient in Obj row is non-negative.
Otherwise pivot to obtain a new tableau.

Pivots Multiple Optimal Solutions


In this case, the objective function has the
same slope as one of the constraints.

If we change the objective function for the


Working Example problem to:

Z = 3X1 + 2X2

The new objective function has the same


coefficients as the third constraint. The simplex
stops after one optimal solution is found.
How to tell if there are more optimal
solutions
Multiple Optimal Solutions
It may be desirable to identify other optimal
solutions. Some programs tell you they exist.

Whenever a problem has more than one optimal


BFS, at least one of the non-basic variables
will have a coefficient of zero in the final
objective function. Other solutions can be
found by pivoting and using the variable with the
zero coefficient in the objective row as the
entering variable.

Unbounded Z Other Model Forms

If Z is unbounded, there will be no candidate zEquality Constraints


for the leaving basic variable. zNegative Right Hand Sides
In these cases, the constraints don’t keep the
zFunctional Constraints in ≥ form
value of the objective function from increasing zMinimization problems
indefinitely.
1- Equality Constraints
Figure 4.3
Solution: Use Modified Problem
The BFS is now a
Change the last constraint so that line between the two
3X1 + 2X2 = 18 points.
2, 6

Z - 3X1 – 5X2 =0
X1 + X3 =4
2X2 + X4 = 12 4,3

3X1 + 2X2 = 18

There is no obvious BFS because there is


0
no slack in the third constraint.

Use an artificial variable Example


Z - 3X1 – 5X2 +MX5 =0
X1 + X3 =4 zConsider the working example with the
2X2 + X4 = 12 only resulting change in the linear
3X1 + 2X2 + X5 = 18 programming model is that the third
constraint, 3x1+2X2 <18, instead becomes
X5= 18 – 3x1 – 2X2
an equality constraint 3x1+2X2 =18
• X5 is introduced to be the initial basic variable
• The objective function is modified to impose
• an exorbitant penalty on X5 having values > zero.
• The large M ensures that the artificial variable
• will be driven to zero.
Do not have an obvious initial BF solution because there is no longer
a slack variable to use as the initial basic variable for Eq. (3).
where the initial basic variables (x3, x4, x 5)
Recall that all basic variables must be algebraically
eliminated from Eq. (0) before the simplex method can either
apply the optimality test or find the entering basic variable

To algebraically eliminate x5 from Eq. (0), we need to subtract from Eq.


(0) the product, M times Eq. (3).
2- Negative Right Hand Sides Functional Constraints as ≥
We introduce both a surplus variable and
To eliminate the negative value in the
an artificial variable so that we can have
RHS, multiply through by -1. This operation
a BFS.
reverses the sign of the equality.
Here we will look at an alternative method to
In doing simplex by hand, all RHS variables
solving minimization problems, the two phase
must be positive. Not required for computer
method.
algorithms.

Minimization Radiation Example


Minimize Z = ∑jcjXj zMinimize Z = 0.4X1 + 0.5X2 where X1
and X2 represent doses of two beams
Same as z 0.3X1 + 0.1X2 ≤ 2.7
z 0.5X1 + 0.5X2 = 6
Maximize -Z= ∑j (-cj)Xj
z 0.6X1 + 0.4X2 ≥ 6
z2nd and 3rd constraint will require artificial
variables.
z1st constraint takes a slack and third takes
a surplus
Problem

-Z + 0.4X1 + 0.5X2 +MX4 + MX6


0.3X1 + 0.1X2 +X3 = 27
0.5X1 + 0.5X2 +X4 =6
0.6X1 + 0.4X2 -X5 + X6 = 6

X3 is a slack variable
X4 and X6 are artificial variables
X5 is a surplus variable

Post-Optimality Analysis Re-optimization

zRe-optimization If we have found an optimal solution for one


version of an LP and then want to run a
zShadow prices (we’ve covered) slightly different version, it is inefficient to
zSensitivity analysis start from scratch. Re-optimization involves
deducing how changes in the original model
zParametric programming
get carried into the final solution (our original
optimal solution). The final tableau is then
revised in light of the new information and the
iterations start from there. (If the tableau that
emerges is not feasible, a dual method can
be applied. )
Sensitivity Analysis Parametric Programming

Sensitivity parameters are those that can’t be zRelated to sensitivity analysis


changed without changing the optimal solution. z Involves the systematic study of how the
If a shadow price on a constraint is positive, then
optimal solution changes as many
an increase in the RHS of that constraint will
change the optimal solution. If it is zero, there parameters change simultaneously over
is a range over which it can be changed with some range
no change in the optimal solution. z Trade-offs in parameter values can be
studied, e.g. some resources (bi) can be
Also, if a reduced cost is non-zero, there will
increased if others are reduced
be a range over which the related Cj can be
changed without affecting the solution.

Vous aimerez peut-être aussi