0% found this document useful (0 votes)
5 views

Lec5-Regular Simplex Method and Dual Simplex Method

The document discusses the Regular Simplex Method in Operations Research, outlining key solution concepts and the iterative process of the simplex algorithm. It details the steps for initialization, optimality testing, and iterations using a tabular form, including examples of maximization and minimization problems. Additionally, it addresses special cases in linear programming and the Big M method for handling artificial variables.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Lec5-Regular Simplex Method and Dual Simplex Method

The document discusses the Regular Simplex Method in Operations Research, outlining key solution concepts and the iterative process of the simplex algorithm. It details the steps for initialization, optimality testing, and iterations using a tabular form, including examples of maximization and minimization problems. Additionally, it addresses special cases in linear programming and the Big M method for handling artificial variables.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

Operations Research

Lecture 5
Regular Simplex Method

Prof. Dr. Safaa Amin


Dr. Doaa Ezzat
Simplex Algorithm
The key solution concepts
• Solution Concept 1: the simplex method focuses on BFS solutions.

• Solution concept 2: the simplex method is an iterative algorithm


(a systematic solution procedure that keeps repeating a fixed series of
steps, called, an iteration, until a desired result has been obtained) with
the following structure:
Simplex Algorithm
Initialization: setup to start iterations, including
finding an initial BFS solution

Optimality test: Is the current BFS solution optimal?

if yes stop
if no

Iteration: Perform an iteration to find a better BFS solution


Simplex algorithm

• Solution concept 3: whenever possible, the initialization of the


simplex method chooses the origin point (all decision variables equal
zero) to be the initial BFS solution.

• Solution concept 4: Each time the simplex method performs an


iteration to move from the current BFS solution to a better one, it
always chooses a BFS solution that is adjacent to the current one.
Simplex algorithm
• Solution concept 5: After the current BFS solution is identified,
the simplex method examines each of the edges of the feasible
region that emanate from this BFS solution. Each of these
edges leads to an adjacent BFS solution at the other end, but
the simplex method doesn’t even take the time to solve for the
adjacent BFS solution. Instead it simply identifies the rate of
improvement in Z that would be obtained by moving along the
edge. And then chooses to move along the one with largest
positive rate of improvement.
The simplex method in tabular form
• Steps:
1. Initialization:
a. transform all the constraints to equality by
introducing slack, surplus, and artificial variables as
follows:

Constraint type Variable to be added

≤ + slack (s)

≥ - Surplus (s) + artificial (A)

= + Artificial (A)
Simplex method in tabular form
2. Construct the initial simplex tableau

Basic X1 … Xn S1 …... Sn A1 …. An RHS


variable
S b1
Coefficient of the constraints
A
A bm
Z 𝐶0𝑡 𝐴 − 𝐶 𝑡 (Maximization) Z=𝐶0𝑡 𝑏
𝐶 𝑡 − 𝐶0𝑡 𝐴 (Minimization) -Z=-𝐶0𝑡 𝑏
Simplex method in tabular form
2. Test for optimality:

Case 1: Maximization problem


the current BF solution is optimal if every coefficient in
the 𝐶0𝑡 𝐴 − 𝐶 𝑡 row is nonnegative
Case 2: Minimization problem
the current BF solution is optimal if every coefficient in
the𝐶 𝑡 − 𝐶0𝑡 𝐴row is nonnegative
Or We can Solve Min as Max Because Min Z=Max (-z)
Simplex method in tabular form
3. Iteration

Step 1: determine the entering basic variable by selecting


the variable (automatically a nonbasic variable) with
the most negative value
or with the most positive (in case of minimization) in the
last row (𝐶0𝑡 𝐴 − 𝐶 𝑡 ). Put a box around the column
below this variable, and call it the “pivot column”
Simplex method in tabular form
• Step 2: Determine the leaving basic variable by applying the minimum ratio
test as following:
1. Pick out each coefficient in the pivot column that is strictly positive (> 0)
2. Divide each of these coefficients into the right hand side entry for the same
row
3. Identify the row that has the smallest of these ratios
4. The basic variable for that row is the leaving variable, so replace that
variable by the entering variable in the basic variable column of the next
simplex tableau. Put a box around this row and call it the “pivot row”
Simplex method in tabular form
• Step 3: Solve for the new BF solution by using elementary row operations –
✓multiply or divide a row by a nonzero constant;
✓add or subtract a multiple of one row to another row)
to construct a new simplex tableau, and then return to the optimality test. The
specific elementary row operations are:
1. Divide the pivot row by the “pivot number” (the number in the intersection of
the pivot row and pivot column)
2. For each other row that has a negative coefficient in the pivot column, add to
this row the product of the absolute value of this coefficient and the new pivot
row.
3. For each other row that has a positive coefficient in the pivot column, subtract
from this row the product of the absolute value of this coefficient and the new
pivot row.
Simplex method
• Example (All constraints are )
Solve the following problem using the simplex method
• Maximize
Z = 3X1+ 5X2
Subject to
X1  4
2 X2  12
3X1 +2X2  18
X1 , X 2  0
Simplex method
1. Standard form

Maximize Z = 3X1+ 5X2 +0 S1 + 0S2 + 0S3


Subject to
X1 + S1 = 4
2 X2 + S2 = 12
3X1 +2X2 + S3 = 18
X1 , X2, S1, S2, S3  0
Initial Basic Feasible solution:
S1 = 4 Basic The solution at the initial tableau is associated to
S2 = 12 Variables
the origin point at which all the decision variables
S3 = 18 are zero.
X1= X2= 0 Non-Basic Variables
Initial tableau
2. Initial tableau Entering
variable
Basic X1 X2 S1 S2 S3 RHS ratio
variable 3 5 0 0 0

S1 0 1 0 1 0 0 4 -
Initial Basic S2 0 0 2 0 1 0 12 6
Variables
S3 0 3 2 0 0 1 18 9
-3 -5 0 0 0 0

Leaving Pivot Pivot Min ratio


Most Pivot row
variable column
negative number
Optimality test
• By investigating the last row of the initial tableau, we find that there
are some negative numbers. Therefore, the current solution is not
optimal
First Iteration
• Step 1: Determine the entering variable by selecting the variable with
the most negative in the last row.
• From the initial tableau, in the last row ,the coefficient of X1 is -3 and
the coefficient of X2 is -5; therefore, the most negative is -5.
consequently, X2 is the entering variable.
• X2 is surrounded by a box and it is called the pivot column
First Iteration
• Step 2: Determining the leaving variable by using the
minimum ratio test as following:

Basic Entering RHS Ratio


variable variable X2
(1) (2) (2)(1)
S1 0 4 None
S2 2 12 6
Leaving Smallest ratio
S3 2 18 9
First Iteration
• Step 3: solving for the new BF solution by using the
eliminatory row operations as following:
1. New pivot row = old pivot row  pivot number

Basic X1 X2 S1 S2 S3 RHS
variable 3 5 0 0 0
Note that X2
becomes in the S1 0 0
basic variables list
instead of S2 X2 5 0 1 0 1/2 0 6
S3 0 0
Z 0
𝟎
SO its coefficient in the Tableau must be 𝟏
𝟎
First Iteration Basic X1 X2 S1 S2 S3 RHS
variable 3 5 0 0 0

For S3
S1 0 1 0 1 0 0 4
X2 5 0 1 0 1/2 0 6
3 2 0 0 1 18
-
S3 0 3 2 0 0 1 18
2 (0 1 0 1/2 0 6)

3 0 0 -1 1 6
Basic X1 X2 S1 S2 S3 RHS
variable 3 5 0 0 0
S1 0 1 0 1 0 0 4
X2 5 0 1 0 1/2 0 6
Substitute this values S3 0 3 0 0 -1 1 6
in the table
Second Iteration
This solution is not optimal, since there is a negative
numbers in the last row
Basic X1 X2 S1 S2 S3 RHS ratio
variable 3 5 0 0 0

S1 0 1 0 1 0 0 4 4
X2 5 0 1 0 1/2 0 6 -
S3 0 3 0 0 -1 1 6 2
Z -3 0 0 5/2 0 30

The most negative The smallest ratio is


value; therefore, X1 is 6/3 =2; therefore, S3 is
the entering variable the leaving variable
Second Iteration
• Apply the same rules we will obtain this solution:

Basic X1 X2 S1 S2 S3 RHS
variable 3 5 0 0 0

S1 0 0 0 1 1/3 -1/3 2
X2 5 0 1 0 1/2 0 6
X1 3 1 0 0 -1/3 1/3 2
Z 0 0 0 3/2 1 36
This solution is optimal; since there is no negative numbers in the last row:
basic variables are X1 = 2, X2 = 6 and S1 = 2; the non-basic variables are
S2 = S3 = 0 then Z = 36
This Solution is Unique Since the 𝑵𝒖𝒎𝒃𝒆𝒓 𝒐𝒇 𝒁𝒆𝒓𝒐𝒆𝒔 𝒊𝒏 𝒕𝒉𝒆 𝑳𝒂𝒔𝒕 𝑹𝒐𝒘 =
𝑻𝒉𝒆 𝒏𝒖𝒎𝒃𝒆𝒓 𝒐𝒇 𝑩𝒂𝒔𝒊𝒄 𝑽𝒂𝒓𝒊𝒂𝒃𝒍𝒆𝒔
Special cases of linear programming
• Infeasible solution
• Multiple solution (infinitely many solution)
• Unbounded solution
• Degenerated solution
Special cases
• In the final tableau, if one or more artificial variables (A1, A2, …)
still basic and has a nonzero value, then the problem has an
infeasible solution
• When determining the leaving variable of any tableau, if there is
no positive ratio (all the entries in the pivot column are negative
and zeroes), then the solution is unbounded.
• A Solution that has a basic variable with zero value is called a
“degenerate solution”.
• If there is a zero under one or more nonbasic variables in the last
tableau (optimal solution tableau), then there is a multiple
optimal solution.
Simplex method incase of Artificial variables
“Big M method”
• Solve the following linear programming problem by using
the simplex method:
• Min Z =2 X1 + 3 X2
Subject to
½ X1 + ¼ X2 ≤ 4
X1 + 3X2  20
X1 + X2 = 10
X1, X2  0
Big M method
• Solution
Step 1: standard form
Min : Z =2 X1 + 3 X2 +0 S1 + 0 S2 + M A1 +M A2
Subject to
½ X1 + ¼ X 2 + S 1 =4
X1 + 3X2 - S2 + A1 = 20
X1 + X 2 + A2 = 10
X1, X2 ,S1, S2, A1, A2  0
Where: M is a very large number
Big M method
• Step 2: Initial tableau

Basic X1 X2 S1 S2 A1 A2 RHS
variables 2 3 0 0 M M

S1 0 ½ ¼ 1 0 0 0 4
A1 M 1 3 0 -1 1 0 20
A2 M 1 1 0 0 0 1 10
Z 2-2M 3-4M 0 M 0 0
Big M method
• The initial tableau will be:

Basic X1 X2 S1 S2 A1 A2 RHS Ratio


variable 2 3 0 0 M M
s
S1 0 1/2 1/4 1 0 0 0 4 16
Min Ratio
A1 M 1 3 0 -1 1 0 20 6.6
A2 M 1 1 0 0 0 1 10 10
Z 2-2M 3-4M 0 M 0 0
Pivot
Most negative
• Since there is a negative value in the last row, this solution is not optimal
• The entering variable is X2 (it has the most negative value in the last row)
• The leaving variable is A1 (it has the smallest ratio)
Big M method
• First iteration
Basic X1 X2 S1 S2 A1 A2 RHS
variables 2 3 0 0 M M

S1 0 5/12 0 1 1/12 -1/12 0 7/3

X2 1/3 1 0 -1/3 1/3 0 20/3


3
A2 2/3 0 0 1/3 -1/3 1 10/3
M

Z 1-2/3M 0 0 1-1/3M 4/3M-1 0

Most negative

• Since there is a negative value in the last row, this solution is not optimal
• The entering variable is X1 (it has the most negative value in the last row)
• The leaving variable is A2 (it has the smallest ratio)
Big M method
• Second iteration
Basic X1 X2 S1 S2 A1 A2 RHS
variables 2 3 0 0 M M

S1 0 0 0 1 -1/8 1/8 -5/8 1/4

X2 0 1 0 -1/2 1/2 -1/2 5


3
X1 1 0 0 1/2 -1/2 3/2 5
2

Z 0 0 0 1/2 M-1/2 M-3/2 25

This solution is optimal, since there is no negative value in the


last row. The optimal solution is:
X1 = 5, X2 = 5, S1 = ¼
A1 = A2 = 0 and Z = 25
Note for the Big M method
• In the final tableau, if one or more artificial variables (A1, A2, …) still
basic and has a nonzero value, then the problem has an infeasible
solution.
• All other notes are still valid in the Big M method.
Regular Simplex Method Using of Artificial Variables
3. The Tableau:-
Note: If
Max: z = 2𝑥1 + 2𝑥2 + 4𝑥3 + 0𝑠1 + 0𝑠2 - 𝑀𝐴1 𝑨𝟏 becomes a
Sub. To: departing
2𝑥1 + 𝑥2 +𝑥3 + 𝑠1 = 2 variable, remove
it from the whole
3𝑥1 + 4𝑥2 + 2𝑥3 - 𝑠2 + 𝐴1 = 8
tableau
𝑥1 , 𝑥2 , 𝑥3 , 𝑠1 , 𝑠2 , 𝐴1 ≥ 0
WC
𝑥1 𝑥2 𝑥3 𝑠1 𝑠2 𝐴1 RHS Ratio
2 2 4 0 0 -M
𝑠1 0 2 1 1 1 0 0 2 2
WR
𝐴1 -M 3 4* 2 0 -1 1 8 2
-3M-2 -4M-2 -2M-4 0 M 0
Regular Simplex Method Using of Artificial Variables
5- Improving the optimality:-
𝑥1 𝑥2 𝑥3 𝑠1 𝑠2 𝐴1 RHS Ratio
2 2 4 0 0 -M
+ 𝑠1 0 2 1 1 1 0 0 2 2
Multiply by 1/4 𝐴1 -M 3 4* 2 0 -1 1 8 2
-3M-2 -4M-2 -2M-4 0 M 0

𝑥1 𝑥2 𝑥3 𝑠1 𝑠2 RHS Ratio
2 2 4 0 0
𝑠1 0 5/4 0 1/2* 1 1/4 0 0
Multiply by -1 𝑥2 2 3/4 1 1/2 0 -1/4 2 4
-1/2 0 -3 0 -1/2
Regular Simplex Method (Using of Artificial Variables)
5- Improving the optimality:-
𝑥1 𝑥2 𝑥3 𝑠1 𝑠2 RHS Ratio
2 2 4 0 0
Multiply by 2 𝑠1 0 5/4 0 1/2* 1 1/4 0 0
+ 𝑥2 2 3/4 1 1/2 0 -1/4 2 4
-1/2 0 -3 0 -1/2

𝑥1 𝑥2 𝑥3 𝑠1 𝑠2 RHS
2 2 4 0 0
Multiply by -1/2 𝑥3 4 5/2 0 1 2 1/2 0
𝑥2 2 -1/2 1 0 -1 -1/2 2
7 0 0 6 1
Regular Simplex Method
Using of Artificial Variables
• The optimal solution is at :
𝑥1 = 0, 𝑥2 = 2, 𝑥3 = 0, 𝑠1 = 0, 𝑠2 = 0, 𝐴1 = 0

Z* = 2 (0) + 2(2)+ 4(0) +0+0+0 = 4


6s-35 Linear Programming

Notes on the Simplex tableau

1. In any Simplex tableau, the intersection of any basic variable with itself is always
one and the rest of the column is zeroes.
2. In any simplex tableau, the objective function row (Z row) is always in terms of
the nonbasic variables. This means that under any basic variable (in any tableau)
there is a zero in the last row. For the non basic there is no condition ( it can take
any value in this row).
3. If there is a tie (more than one variables have the same most negative or positive)
in determining the entering variable, choose any variable to be the entering one.
6. If there is a tie in determining the leaving variable, choose any one to be the
leaving variable. In this case a zero will appear in RHS column; therefore, a
“cycle” will occur, this means that the value of the objective function will be the
same for several iterations.
Regular Simplex Method
Number of zeroes in the
last row = Number of basic
variables
(Unique Solution)

The artificial
Number of zeroes in
variable has a non
the last row > Number
zero value in the
final tableau
RSM of basic variables

(Infeasible Cases (Infinite number of


solutions)
Solution)

There is no positive
numbers in the
work column
(Unbounded
Solution)
Definitions
• A basic solution is an augmented corner point solution.
• A basic solution has the following properties:
1. Each variable is designated as either a nonbasic variable or a basic variable.
2. The number of basic variables equals the number of functional constraints.
Therefore, the number of nonbasic variables equals the total number of
variables minus the number of functional constraints.
3. The nonbasic variables are set equal to zero.
4. The values of the basic variables are obtained as simultaneous solution of
the system of equations (functional constraints in augmented form). The set
of basic variables are called “basis”
5. If the basic variables satisfy the nonnegativity constraints, the basic solution
is a Basic Feasible (BF) solution.
How to be efficient?
Dual Simplex Method
Dual Simplex Method condition
Case1: If it is maximize then all the cost coefficient must be negative
Example:
Maximize: 𝒁 = −𝟐𝒙𝟏 − 𝟓𝒙𝟐 − 𝟏𝟐𝒙𝟑 so the super optimal solution for Z is Zero
which is satisfied from the initial basic solution where
𝑥1 = 𝑥2 = 𝑥3 = 0
OR
Case2: If it is Minimize then all the cost coefficient must be Positive
Minimize: 𝒁 = 𝟐𝒙𝟏 + 𝟓𝒙𝟐 + 𝟏𝟐𝒙𝟑 so the super optimal solution for Z is Zero
which is satisfied from the initial basic solution where
𝑥1 = 𝑥2 = 𝑥3 = 0
Dual Simplex Method Steps
1. Turn all constraints into less than or equal constraints.
2. Determine the output variable which has the most negative number
in RHS.
3. Determine the input variable by calculating the ratio between the
last row and the magnitude of negative numbers only in the pivot
row, then consider the input variable is the one that has the smallest
ratio.
4. Apply the same rules as in the regular simplex method until RHS has
no negative numbers.
-- -

-
Example 1 cont…
=

Entering Variable

Leaving Variable 0
0
4 6 18 0 0
6/1=6 18/2=9
Min ratio
Entering Variable

Ci -6 -4 -18 0 0
Leaving
Variable 0
-4
6 0 10 0 4
Ratio 6/1 10/3
R1*-1/3
R2+2/3R1 Min Ratio

Ci -6 -4 -18 0 0
Example 2: Dual Simplex Method
Entering
Variable

𝑿𝟏 𝑿𝟐 𝑠1 𝑠2
-3 -1 0 0
𝑠1 0 -1 -1 1 0 -1
Most
Departing 𝑠2 0 -2 −𝟑∗ 0 1 -2 negative
Variable 3 1 0 0
Ratio 3/2 1/3

Min Ratio

Select the pivot from the work column


pivot must be negative
we get the ration for -2 and -3 the one with min ratio will be the pivot
since -3 give the min ratio then 𝑿𝟐 will be the entering variable
Example 2: Cont…
The pivot to be 1… we will make row operation divide
the complete row R2 by -3
𝑿𝟏 𝑿𝟐 𝑠1 𝑠2
-3 -1 0 0
𝑠1 0 -1 -1 1 0 -1
𝑿𝟐 -1 2/3 𝟏 0 -1/3 2/3
3 1 0 0
𝑿𝟏 𝑿𝟐 𝑠1 𝑠2
-3 -1 0 0
Then to get 0 up the pivot R2+R2 𝑠1 0 -1/3 0 1 -1/3 -1/3

𝑿𝟐 -1 2/3 𝟏 0 -1/3 2/3

7/3 0 0 1/3
Entering
Variable

𝑿𝟏 𝑿𝟐 𝑠1 𝑠2
-3 -1 0 0 Most

𝑠1 0 -1/3 0 1 −𝟏/𝟑 -1/3 negative
Departing
Variable 𝑿𝟐 -1 2/3 1 0 -1/3 2/3
7/3 0 0 1/3
This is the final table where the solution
Ratio 7 1 is optimal feasible
The soln is 𝑿𝟏 =0 , 𝑿𝟐 =1 , 𝑠1 = 0, 𝑠2 =1,
Min Ratio Z=-1

𝑿𝟏 𝑿𝟐 𝑠1 𝑠2 𝑿𝟏 𝑿𝟐 𝑠1 𝑠2
-3 -1 0 0 -3 -1 0 0
R1*-3
𝑠2 0 1 0 -3 1 1 R2+1/3R1 𝑠2 0 1 0 -3 𝟏 1
𝑿𝟐 -1 2/3 1 0 -1/3 2/3 𝑿𝟐 -1 1 1 -1 0 1
2 0 1 0

You might also like