0% found this document useful (0 votes)
3 views12 pages

Simplex Method (Lec3)

The Simplex Method is an algebraic approach used to solve linear programming problems with more than two decision variables by finding extreme point solutions. It requires converting the problem into standard form with nonnegative constraints and decision variables, and utilizes slack and surplus variables to transform inequalities into equations. The algorithm iteratively improves the basic feasible solution by moving towards adjacent corner points that yield better objective values until an optimal solution is reached.

Uploaded by

Hassan Dader
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views12 pages

Simplex Method (Lec3)

The Simplex Method is an algebraic approach used to solve linear programming problems with more than two decision variables by finding extreme point solutions. It requires converting the problem into standard form with nonnegative constraints and decision variables, and utilizes slack and surplus variables to transform inequalities into equations. The algorithm iteratively improves the basic feasible solution by moving towards adjacent corner points that yield better objective values until an optimal solution is reached.

Uploaded by

Hassan Dader
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Simplex Method

· When decision variables are more than 2, we always use


Simplex Method
· It is a general algebraic method to solve a set of linear

Chapter 3 ·
equations.
We use simplex method to get extreme (or corner) point
solution.
· Before the simplex algorithm can be used to solve an LP
The Simplex Method problem, it must be converted into standard LP form.
· Two requirements on the standard form LP model
̶ All the constraints are expressed as equations with nonnegative
right-hand side.
̶ All the decision variables are nonnegative.

1 2

Standard LP Form Standard LP Form


· Slack Variable: Variable added to a (≤) constraint to convert it to =3 +2 =3 +2
1 2 1 2
an equation (=).
· A slack variable represents unused resources
2 1 + 2 £9 2 1 + 2 + 1 =9
· For example (6 ‫ݔ‬1 + 4 ‫ݔ‬2 ≤ 24) is equivalent to:
1 +2 2 £9 1 +2 2 + 2 =9
(6 ‫ݔ‬1 + 4 ‫ݔ‬2 + ‫ݏ‬1 = 24) provided that ‫ݏ‬1 ≥ 0
1 , 2 ³0 1 , 2 , 1, 2 ³0
· Surplus Variable: Variable subtracted from a (≥) constraint to
convert it to an equation (=).
· Represents an excess above a constraint requirement level. =3 1 +2 2 =3 1 +2 2

· For example (‫ݔ‬1 + ‫ݔ‬2 ≥ 800) is equivalent to:


(‫ݔ‬1 + ‫ݔ‬2 − ‫ݏ‬1 = 800) provided that ‫ݏ‬1 ≥ 0. 2 1 + 2 ³9 2 1 + 2 - 1 =9
· Unrestricted variable in sign: 1 +2 2 ³9 1 +2 2 - 2 =9
Replace it with a difference of two new variables. 1 , 2 ³0 1 , 2 , 1, 2 ³0
3 4
Simplex Method Simplex Method
· The development of the algebraic simplex method is · In all nontrivial LPs, the number of equations ݉ is
based on ideas conveyed by the graphical LP solution always less than the number of variables ݊, thus
· In graphical method, the solution space is the yielding an infinite number of solutions.
intersection of the half-spaces representing the · We divide the ݊ variables into 2 sets:
constraints. 1. (݊ - ݉ ) variables to which we assign zero values
· The graphical solution space has an infinite number of which are called non-basic variables.
solution points 2. Remaining ݉ variables whose values are determined
· In the simplex method, the solution space is by solving the resulting ݉ equations which is called
represented by ݉ simultaneous linear equations and ݊ basic variables.
nonnegative variables

5 6

Simplex Method Simplex Method


Basic Solutions (BS)
· Correspond to the corner points in the graphical solution
space.
· They are determined by setting non-basic variables equal to
zero and solving for remaining basic variables.
· The maximum number of possible basic solution for ݉
equations in ݊ unknowns is
!
=
!( - )!
Basic Feasible Solution (BFS)
· Basic solution satisfies the non negativity restrictions.

7 8
Simplex Graphical Explanation Simplex Graphical Explanation
· Example: Consider the following LP with two variables. · Algebraically, the solution space of the LP is represented
by the following ݉ = 2 equations and ݊ = 4 variables:
· Maximize

· Subject to
· The basic solutions are determined by setting ݊ - ݉ = 4 -
2 = 2 variables equal to zero and solving for the
remaining ݉ = 2 variables.

9 10

Simplex Graphical Explanation Simplex Graphical Explanation


· For example, if we set ‫ݔ‬1 = 0 and ‫ݔ‬2 = 0, the equations provide
Max the unique basic solution (‫ݏ‬1 = 4, ‫ݏ‬2 = 5)
s.t · This solution corresponds to point A in the figure
· Another point can be determined by setting ‫ݏ‬1 = 0 and ‫ݏ‬2 = 0,
the equations provide the unique basic solution (‫ݔ‬1 = 1, ‫ݔ‬2 = 2)
· This solution corresponds to point C in the figure.
· You probably are wondering which ݊ - ݉ variables should be
set equal to zero to target a specific corner point.
· Without the graphical solution space (which is available only
for at most three variables), we cannot specify the (݊ - ݉) zero
variables associated with a given corner point.

11 12
Simplex Graphical Explanation Simplex Graphical Explanation
· Solution: Consider all combinations in which ݊ - ݉ variables · Blind search can be time consuming (inefficient)
equal zero and solve the resulting equations · Say ݉ = 4 and ݊ = 8, then there are 70 solutions
· The optimum solution is the feasible basic solution (corner · Rather than enumerating all the basic solutions of the LP
point) with the best objective value. problem, the simplex method performs a “smarter” search by
· In the present example, the (maximum) number of corner points investigating only a “select few” of these solutions.
is 4!
2
4
= =6 · The solution space of the LP example is shown in the Figure.
2!(4 - 2)!
· The simplex method always starts at the origin where all the
decision variables ‫ݔ‬j are zero.
· In Figure, point A is the origin (‫ݔ‬1 = ‫ݔ‬2 = 0) and the
associated objective value, ‫ݖ‬, is zero.

13 14

Simplex Graphical Explanation Simplex Graphical Explanation


· An increase in ‫ݔ‬1 or ‫ݔ‬2 above their current zero values
will improve the value of ‫ݖ‬.
· The rate of improvement in the value of ‫ ݖ‬is 2 for ‫ݔ‬1 and
3 for ‫ݔ‬2
· We thus select to increase the variable with the largest
rate of improvement (‫ݔ‬2)
· The value of ‫ݔ‬2 must be increased until corner point B is
reached.
· At point B, the simplex method, as will be explained
later, will then increase the value of ‫ݔ‬1 to reach the
improved corner point C, which is the optimum.
15 16
Preview of the Simplex Algorithm Preview of the Simplex Algorithm

General description of the simplex algorithm solving an LP in a The Simplex Algorithm Procedure for maximization LPs
maximization problem. Step 1 Convert the LP to standard form.
Step 1 Find a BFS to the LP. We call this BFS the initial BFS. Step 2 Obtain a BFS (if possible) from the standard form.
In general, the most recent BFS will be called current Step 3 Determine whether the current BFS is optimal.
BFS, so at the beginning of the problem, the initial BFS Step 4 If the current BFS is not optimal, determine which
is the current BFS. nonbasic variable should become a basic variable and
Step 2 Determine if the current BFS is an optimal solution. If is which basic variable should become a nonbasic
not, find an adjacent BFS that has a larger z-value. variable to find a BFS with a better objective function
value.
Step 3 Return to step 2, using the new BFS as the current BSF.
Step 5 Use elementary row operations to find a new BFS with
a better objective function value.

17 18

Details of the Simplex Algorithm Simplex Concepts


· Concept 1: the simplex method focuses on CPF
· The simplex technique involves generating a series of solutions in
tabular form, called tableaus. solutions.
· By inspecting the top row of each tableau, one can immediately · Concept 2: the simplex method is an iterative
tell if it represents the optimal solution. algorithm (a systematic solution procedure that keeps
· Each tableau corresponds to a BFS. repeating a fixed series of steps, called, an iteration,
· The first tableau corresponds to the origin. until a desired result has been obtained)
· Subsequent tableaus are developed by shifting to an adjacent · concept 3: whenever possible, the initialization of the
corner point in the direction that yields the highest (smallest) rate simplex method chooses the origin point (all
of profit (cost). decision variables equal zero) to be the initial CPF
· This process continues as long as a positive (negative) rate of solution.
profit (cost) exists.

19 20
Simplex Concepts Simplex Concepts
· Concept 4: given a CPF solution, it is much quicker · Instead it simply identifies the rate of improvement in Z that
computationally to gather information about its adjacent CPF would be obtained by moving along the edge. And then
solutions than about other CPF solutions. Therefore, each time chooses to move along the one with largest positive rate of
the simplex method performs an iteration to move from the improvement.
current CPF solution to a better one, it always chooses a CPF · Concept 6: A positive rate of improvement in Z implies that the
solution that is adjacent to the current one. adjacent CPF solution is better than the current one, whereas a
· Concept 5: After the current CPF solution is identified, the negative rate of improvement in Z implies that the adjacent
simplex method examines each of the edges of the feasible CPF solution is worse.
region emanate from this CPF solution. · Therefore, the optimality test consists simply of checking
· Each of these edges leads to an adjacent CPF solution at the whether any of the edges give a positive rate of improvement
other end, but the simplex method doesn’t even take the time to in Z. If none do, then the current CPF solution is optimal.
solve for the adjacent CPF solution.

21 22

Definitions The simplex method in tabular form


· A basic solution has the following properties: Steps:
1. Each variable is designated as either a non-basic variable 1. Initialization:
or a basic variable.
2. The number of basic variables equals the number of a. transform all the constraints to equality by
functional constraints. Therefore, the number of non- introducing slack, surplus, and artificial variables as
basic variables equals the total number of variables minus follows:
the number of functional constraints.
3. The non-basic variables are set equal to zero.
Constraint type Variable to be added
4. The values of the basic variables are obtained as
simultaneous solution of the system of equations ≥ + slack (s)
(functional constraints in augmented form). The set of
basic variables are called “basis” ≤ - Surplus (s) + artificial (A)
5. If the basic variables satisfy the nonnegativity constraints,
the basic solution is a Basic Feasible Solution (BFS). = + Artificial (A)

23 24
Simplex method in tabular form Simplex method in tabular form
b. Construct the initial simplex tableau 2. Test for optimality:
Case 1: Maximization problem
Basic the current BF solution is optimal if every
X1 … Xn S1 …... Sn A1 …. An RHS
variable
coefficient in the objective function row is
Objective function coefficient nonnegative
Z Z value
in different signs
Case 2: Minimization problem
S b1
the current BF solution is optimal if every
Coefficient of the constraints coefficient in the objective function row is
A bm nonpositive

25 26

Simplex method in tabular form Simplex method in tabular form


3. Iteration 3. Identify the row that has the smallest of these ratios
Step 1: determine the entering basic variable by selecting the 4. The basic variable for that row is the leaving variable, so
variable (automatically a nonbasic variable) with the most
replace that variable by the entering variable in the basic
negative value (in case of maximization) or with the most
positive (in case of minimization) in the last row (Z-row). Put a variable column of the next simplex tableau. Put a box
box around the column below this variable, and call it the “pivot around this row and call it the “pivot row”
column” Step 3: Solve for the new BF solution by using elementary
Step 2: Determine the leaving basic variable by applying row operations (multiply or divide a row by a nonzero
the minimum ratio test as following: constant; add or subtract a multiple of one row to another
1. Pick out each coefficient in the pivot column that is strictly row) to construct a new simplex tableau, and then return
positive (>0)
2. Divide each of these coefficients into the right hand side entry
to the optimality test. The specific elementary row
for the same row operations are:

27 28
Simplex Method Simplex Method
Example: Reddy Mikks model (All constraints are £) Standard form
Solve the following problem using the simplex method · Maximize z = 5‫ݔ‬1+ 4‫ݔ‬2 + 0s1 + 0s2 + 0s3 + 0s4
Maximize · Subject to
z = 5‫ݔ‬1+ 4‫ݔ‬2 6‫ݔ‬1 + 4‫ݔ‬2 + s1 = 24 Sometimes it is called
the augmented form of
Subject to ‫ݔ‬1 + 2‫ݔ‬2 + s2 =6 the problem because
6‫ݔ‬1 + 4‫ݔ‬2 £ 24 - ‫ݔ‬1 + ‫ݔ‬2 + s3 =1 the original form has
‫ݔ‬1 + 2‫ݔ‬2 £ 6 ‫ݔ‬2 + s4 = 2 been augmented by
some supplementary
- ‫ݔ‬1 + ‫ݔ‬2 £ 1 ‫ݔ‬1 , ‫ݔ‬2, s1, s2, s3 , s4 ³ 0 variables needed to
‫ݔ‬2 £ 2 · Write the objective equation as apply the simplex
method
‫ݔ‬1 , ‫ݔ‬2 ³ 0 z - 5‫ݔ‬1- 4‫ݔ‬2 = 0
29 30

2. Initial Tableau Simplex tableau


Notes:
Basic · The basic feasible solution at the initial tableau is (0, 0,
‫ݔ‬1 ‫ݔ‬2 s1 s2 s3 s4 RHS Ratio
variables 24, 6, 1, 2) where: ‫ݔ‬1 = 0, ‫ݔ‬2 = 0, ‫ݏ‬1 = 24, ‫ݏ‬2 = 6, ‫ݏ‬3 = 1,
‫ݏ‬4 = 2 and z = 0
z -5 -4 0 0 0 0 0
· Where s1, s2, s3 and s4 are basic variables
s1 6 4 1 0 0 0 24
‫ݔ‬1 and ‫ݔ‬2 are non-basic variables
s2 1 2 0 1 0 0 6
· The solution at the initial tableau is associated to the
s3 -1 1 0 0 1 0 1
origin point at which all the decision variables are zero.
s4 0 1 0 0 0 1 2

31 32
Optimality Test
By investigating the top row of the initial tableau, we find that there
are some negative numbers. Therefore, the current solution is not
optimal

Basic
‫ݔ‬1 ‫ݔ‬2 s1 s2 s3 s4 RHS Ratio
variables

z -5 -4 0 0 0 0 0

s1 6 4 1 0 0 0 24

s2 1 2 0 1 0 0 6

s3 -1 1 0 0 1 0 1
Graphical interpretation of the simplex method ratios in the Reddy Mikks model
s4 0 1 1 0 0 1 2
33 34

Iteration 1 Iteration 1
Entering
variable
· Step 1: Determine the entering variable by selecting the
Basic
variable with the most negative in the last row. variable
‫ݔ‬1 ‫ݔ‬2 s1 s2 s3 s4 RHS Ratio

· From the initial tableau, in the z row, the coefficient of


z -5 -4 0 0 0 0 0
‫ݔ‬1 is −5 and the coefficient of ‫ݔ‬2 is −4; therefore, the
most negative is −5. Therefore, ‫ݔ‬1 is the entering s1 6 4 1 0 0 0 24
variable. s2 1 2 0 1 0 0 6
· ‫ݔ‬1 is surrounded by a box and it is called the pivot s3 -1 1 0 0 1 0 1
column
s4 0 0 1 0 0 1 2

Pivot column
35 36
Iteration 1 Iteration 1
Entering
· Step 2: Determining the leaving variable by using the minimum variable
ratio test as following:
Basic
‫ݔ‬1 ‫ݔ‬2 s1 s2 s3 s4 RHS Ratio
Entering variable ‫ݔ‬1 RHS Ratio variable
Basic variable
(1) (2) (2)¸(1)
z -5 -4 0 0 0 0 0
s1 4
6 24 s1 6 4 1 0 0 0 24 4
Leaving Smallest ratio
s2 1 2 0 1 0 0 6 6
s2 1 6 6
s3 -1 1 Negative, Ignore s3 -1 -1 0 0 1 0 1 -

s4 0 2 Infinity, Ignore s4 0 0 1 0 0 1 2 -

· s1 is the leaving variable. Leaving Pivot Pivot row


variable Pivot column number
37 38

Iteration 1 Iteration 1
· Replace the leaving variable in the Basic column with
the entering variable.
· New pivot row = old pivot row ¸ pivot number
Basic
‫ݔ‬1 ‫ݔ‬2 s1 s2 s3 s4 RHS
variable
z
‫ݔ‬1 1 2/3 1/6 0 0 0 4
‫ݏ‬2
‫ݏ‬3
‫ݏ‬4
Note that x1 becomes in the basic
variables list instead of s1 39 40
Iteration 1 Iteration 2
The new basic solution is (‫ݔ‬1, ‫ݏ‬2, ‫ݏ‬3, ‫ݏ‬4), and the new tableau becomes Apply the same rules we will obtain this solution:

This solution is optimal; since none of the z-row coefficients are


This solution is not optimal, since there is a negative numbers in z negative.
row
41 42

Solution Solution
The optimum solution can be read from the simplex tableau in the Basic
X1 X2 S1 S2 S3 S4 RHS Ratio
following manner. The optimal values of the variables in the Basic variables
Z -5 -4 0 0 0 0 0
column are given in the right-hand-side column as:
S1 6 4 1 0 0 0 24 4
S2 1 2 0 1 0 0 6 6
S3 -1 1 0 0 1 0 1 -1
S4 0 1 0 0 0 1 2
Z 0 - 2/3 5/6 0 0 0 20
X1 1 2/3 1/6 0 0 0 4 6
S2 0 1 1/3 - 1/6 1 0 0 2 1 1/2
S3 0 1 2/3 1/6 0 1 0 5 3
S4 0 1 0 0 0 1 2 2
Z 0 0 3/4 1/2 0 0 21
X1 1 0 1/4 - 1/2 0 0 3
X2 0 1 - 1/8 3/4 0 0 1 1/2
S3 0 0 3/8 -1 1/4 1 0 2 1/2
S4 0 0 1/8 - 3/4 0 1 1/2
43 44
Summary of the Simplex Method Simplex Method Steps
· In minimization problems, the optimality condition calls for · Determine a starting basic feasible solution.
selecting the entering variable as the nonbasic variable with the · Select an entering variable using the optimality condition. Stop if
most positive there is no entering variable.
· Optimality condition: The entering variable in a maximization · Select a leaving variable using the feasibility condition.
(minimization) problem is the nonbasic variable with the most
· Determine the new basic solution by using the appropriate Gauss
negative (positive) coefficient in the z-row. Ties are broken
Jordan operations:
arbitrarily.
· The optimum is reached at the iteration where all the z-row
coefficients are nonnegative (nonpositive).
· Feasibility Condition: for both the maximum and minimum
problems the leaving variables is the basic variables associated
with the smallest non-negative ratio. Ties are broken arbitrarily · Go to step 1.

45 46

You might also like