SlideShare a Scribd company logo
Muhammad Kashif Nawaz
MS(CS) Batch # 3
Kashif.rpb@gmail.com
Contents Overview
• AGENDA
– Introduction
• KEY TERMINOLOGIES
• SIMPLEX ALGORITHM
• Software Simulation
• SIMPLEX ALGORITHM VARIATIONS
• REFERENCES
6/3/2014 Simplex Algorithm 2
Introduction(Background)
• Linear programming is the process of taking various linear inequalities
relating to some situation, and finding the "best" value obtainable under
those conditions.
• Linear programming is part of a very important area of mathematics called
optimization techniques.
• The graphical method is useful only for problems involving two decision
variables and relatively few problem constraints.
6/3/2014 Simplex Algorithm 3
Introduction
• Question:
– Can we solve all LP problems using graphical approach ?
• NO
– WHY ???
» Real life systems can have dozens or hundreds of variables, or
more.
• What happens when we need more decision variables and more problem
constraints?
– Thus we need another systematic approach to solve the LP Problem.
– Simplex Algorithm
6/3/2014 Simplex Algorithm 4
Introduction
• Simplex method which was developed by George B. DANTZIG (1914-2005)
in 1947.
• The most popular method used for the solution of Linear Programming
Problems (LPP) is the simplex method.
• The journal Computing in Science and Engineering listed it as one of the
top 10 algorithms of the twentieth century.
• Simplex Algorithm can solve an equation for many variables (dimensions).
6/3/2014 Simplex Algorithm 5
Key Terminologies
• Standard Form & Slack Variable
• Basic & Non basic Variables
• Simple Tableau
• Pivoting
6/3/2014 Simplex Algorithm 6
Standard Maximization Problems in
Standard Form
• A linear programming problem is said to be a standard maximization
problem in standard form if its mathematical model is of the following
form:
• Maximize the objective function
• Subject to problem constraints of the form
• With non-negative constraints
6/3/2014 Simplex Algorithm 7
Slack Variables
• A mathematical representation of surplus resources.
• In real life problems, it’s unlikely that all resources will be used completely,
so there usually are unused resources.
• Slack variables represent the unused resources between the left-hand side
and right-hand side of each inequality.
6/3/2014 Simplex Algorithm 8
x1 + 2x2 < 32
3x1 + 4x2 < 84
x1 + 2x2 + s1 = 32
3x1 + 4x2 + s2 = 84
Basic and Nonbasic Variables
• Basic variables are selected arbitrarily with the restriction that there be as
many basic variables as there are equations. The remaining variables are
non-basic variables.
• This system has two equations, we can select any two of the four variables
as basic variables. The remaining two variables are then non-basic
variables.
• A solution found by setting the two non-basic variables equal to 0 and
solving for the two basic variables is a basic solution. If a basic solution has
no negative values, it is a basic feasible solution.
6/3/2014 Simplex Algorithm 9
Simple tableau
• Simplex Tableau: Most real-world problems are too complex to solve graphically.
They have too many corners to evaluate, and the algebraic solutions are lengthy. A
simplex tableau is a way to systematically evaluate variable mixes in order to find
the best one.
• Pivot Column: The column of the tableau representing the variable to be entered
into the solution mix.
• Pivot Row: The row of the tableau representing the variable to be replaced in the
solution mix.
• Pivot Number: The element in both the pivot column and the pivot row.
6/3/2014 Simplex Algorithm 10
All Variables Solutions
Basic Variables Coefficients
0
Pivoting
• Pivoting :
– To transform a current tableau into the next one and increase the
value of the objective function to the next feasible solutions. To get to
that feasible solution several steps are performed and those steps are
called pivoting.
– Steps:
• First, divide all the entries of the pivot row by the pivot, its entry in the pivot column, to obtain
Rownew
• Then, replace each of the other rows, including the objective row, by the difference row − c
.Rownew
• where c is the row’s entry in the pivot column
6/3/2014 Simplex Algorithm 11
Simplex Algorithm
• Diagram
• Steps
• Example
• Cycling & Bland’s rule
• Efficiency
6/3/2014 Simplex Algorithm 12
SIMPLEX METHOD
6/3/2014 Simplex Algorithm 13
Step-1
Write the
standard
maximization
problem in
standard form,
introduce slack
variables to form
the initial
system, and
write the initial
tableau.
Step-3
Select
the
pivot
column
Step-5
Select
the pivot
element
and
perform
the pivot
operatio
n
STOP
The optimal solution has been
found.
STOP
The linear programming problem
has no optimal solution
Step 2
Are there
any
negative
indicators
in the
bottom
row?
Step 4
Are there
any positive
elements in
the pivot
column
above the
dashed
line?
Simplex algorithm for standard maximization problems
YESYES
NONO
To Solve A Linear Programming Problem In Standard Form,
Use The Following Steps
• Convert each inequality in the set of constraints to an equation by adding slack
variables.
• Create the initial simplex tableau.
• Select the pivot column. ( The column with the “most negative value” element in
the last row.)
• Select the pivot row. (The row with the smallest non-negative result when the last
element in the row is divided by the corresponding in the pivot column.)
• Use elementary row operations calculate new values for the pivot row so that the
pivot is 1 (Divide every number in the row by the pivot number.)
• Use elementary row operations to make all numbers in the pivot column equal to
0 except for the pivot number. If all entries in the bottom row are zero or positive,
this the final tableau. If not, go back to step 3.
• If you obtain a final tableau, then the linear programming problem has a maximum
solution, which is given by the entry in the lower-right corner of the tableau.
6/3/2014 Simplex Algorithm 14
Example(Step 1)
6/3/2014 Simplex Algorithm 15
Example(Step 2)
6/3/2014 Simplex Algorithm 16
u
v
z
1 1 1 0 4
1 3 0 1 6
-3 -5 0 0 0
Initialized by the coefficients of the
objective function. The signs are
reversed in this row (objective row)
We have constraints + 1
rows and variables +1
columns
Pivot Column/Entering Variable.
In our example, its Y
Example(Step 3)
x y u v
u 1 1 1 0 4
v 1 3 0 1 6
z -3 -5 0 0 0
6/3/2014 Simplex Algorithm 17
Pivot Column/Entering Variable
The row with the smallest θ-ratio determines the
departing variable. For our example, it is variable v.
The intersecting element of Pivot Column and Pivot
Row is the pivot.
In the next tableau the intersected element will
become 1 and the rest of elements will become 0 in
the pivot column.
Departing Variable / Leaving Variable/ Pivot Row
Example(Step 4 Iteration 1)
x y u v
u 1 1 1 0 4
v 1 3 0 1 6
z -3 -5 0 0 0
6/3/2014 Simplex Algorithm 18
x y u v
u 1 1 1 0 4
y 1/3 1 0 1/3 2
z -3 -5 0 0 0
x y u v
u 2/3 0 1 -1/3 2
y 1/3 1 0 1/3 2
z -4/3 0 0 5/3 10
The pivot row will be replaced by the Rownew we
calculated.
Row 1 and 3 will be calculated using the formula :
Row = Row – c.Rownew
Row1 –c.Rownew where c = 1
1-(1)(1/3), 1-(1)(1), 1-(1)(0), 0-(1)(1/3), 4-(1)(2)
2/3, 0, 1, -1/3, 2
Row3- c.Rownew where c = -5
-3-(-5)(1/3), -5-(-5)(1), 0-(-5)(0), 0-(-5)(1/3),
0-(-5)(2)
-4/3, 0, 0, 5/3, 10
All the values in the last row are nonnegative ??
Example(Step 4 Iteration 2)
x y u v
u 2/3 0 1 -1/3 2
y 1/3 1 0 1/3 2
z -4/3 0 0 5/3 10
6/3/2014 Simplex Algorithm 19
x y u v
x 1 0 3/2 -1/2 3
y 0 1 -1/2 1/2 1
z 0 0 2 1 14
x y u v
x 1 0 3/2 -1/2 3
y 1/3 1 0 1/3 2
z -4/3 0 0 5/3 10
ϴ-Ratio: 3
ϴ-Ratio: 6
Row = Row – c.Rownew
Row2 –c.Rownew where c = 1/3
1/3-(1/3)(1), 1-(1/3)(0), 0-(1/3)(3/2),
1/3-(1/3)(-1/2), 2-(1/3)(3)
0, 1, -1/2, 1/2, 1
Row3- c.Rownew where c = -4/3
-4/3-(-4/3)(1), 0-(-4/3)(0), 0-(-4/3)(3/2),
5/3-(-4/3)(-1/2), 10-(-4/3)(3)
0, 0, 2, 1, 14
All the values in the last row are nonnegative ??
Rownew : 1, 0, 3/2, -1/2, 3
Example(Optimal Solution)
• x = 3
• y = 1
• u = 0
• v = 0
• z = 14
• We choose u and v equal to 0, because their column has all distinct values.
If they were like x and y, they’d have some value.
6/3/2014 Simplex Algorithm 20
Cycling & Bland’s Rule
• When an objective function’s values “stall” for several iterations in a row
and that the algorithm cycles back to a previously considered point and
hence never terminate. This phenomenon is called cycling.
• Although, it rarely happens, but when it does ,a simple modification of the
simplex method, called Bland’s rule, eliminates even the theoretical
possibility of cycling.
• Assuming that the variables are denoted by a subscripted letter (e.g., x1,
x2,..., xn), this rule can be stated as follows:
– Among the columns with a negative entry in the objective row, select the
column with the smallest subscript in choosing pivot column.
– Resolve a tie among the smallest θ-ratios by selecting the row labeled by the
basic variable with the smallest subscript in choosing pivot row.
6/3/2014 Simplex Algorithm 21
Software Simulation
• Simplex Method has became so efficient that its calculation
packages are even available online. One of them is as follows:
• For ease, we will copy the same problem to the online tool and
check whether it gives us the same result:
maximize z = 3x +5y
subject to :
x + y = 4
x+3y = 6
• Simplex Method Online Tool
http://www.zweigmedia.com/RealWorld/simplex.html
6/3/2014 Simplex Algorithm 22
Efficiency of Simplex Algorithm
• Since we know that the algorithm progresses through a sequence of
adjacent points of a feasible region. Right?
• So, one should probably expect bad news because the number of extreme
points is known to grow exponentially with the problem size.
• The worst-case efficiency of the simplex method has been shown to be
exponential.
• But Fortunately!
• More than half a century of practical experience with the algorithm has
shown that the number of iterations in a typical application ranges
between m and 3m, with the number of operations per iteration
proportional to mn, where m and n are the numbers of equality
constraints and variables, respectively.
6/3/2014 Simplex Algorithm 23
Other Variants of the Algorithm
• Ellipsoid Method:
– An important mile- stone in the history of such algorithms was the
proof by L. G. Khachian showing that the ellipsoid method can solve
any linear programming problem in polynomial time.
– However, ellipsoid method was much slower than the simplex method
in practice
• Karmarker’s Method
– Narendra Karmarkar published an algorithm that not only had a
polynomial worst-case efficiency but also was competitive with the
simplex method. This method generates a sequence of feasible
solutions that lie within the feasible region rather than going through
a sequence of adjacent extreme points as the simplex method does.
(Interior Point Methods).
6/3/2014 Simplex Algorithm 24
Reference(s)
• The material presented in this lecture is adopted from:
• Introduction to Design and Analysis of Algorithms, 3rd Edition,
Anany Levitin.
• Introduction to Algorithms, Second Edition,
Thomas.H.Cormen
• www.iftikharahmad.org/teachings/Lec_16_Simplex_Algorith
m.pdf
6/3/2014 Simplex Algorithm 25

More Related Content

PDF
Unit.2. linear programming
PPTX
Goal Programming
PPTX
Nonlinear programming 2013
PPTX
Solving linear programming model by simplex method
PPTX
Simplex method concept,
PPTX
NON LINEAR PROGRAMMING
PPT
simplex method
PPT
L20 Simplex Method
Unit.2. linear programming
Goal Programming
Nonlinear programming 2013
Solving linear programming model by simplex method
Simplex method concept,
NON LINEAR PROGRAMMING
simplex method
L20 Simplex Method

What's hot (20)

PDF
Simplex method
PPT
Simplex Method
PPTX
Simplex algorithm
PPSX
Linear programing
PPTX
Transportation problems
PDF
simplex method for operation research .pdf
PPTX
Big-M Method Presentation
PPT
simplex method
PDF
NONLINEAR PROGRAMMING - Lecture 1 Introduction
PPT
Simplex Method
PPTX
The False-Position Method
PPTX
Fibonacci Heaps
PPTX
Linear Programming
PPTX
Sensitivity analysis linear programming copy
PDF
Chapter 4 Simplex Method ppt
PPTX
Operation research unit 1: LPP Big M and Two Phase method
PDF
Big m method
PPTX
LP special cases and Duality.pptx
PPTX
graphical method
PPS
Applications of linear programming
Simplex method
Simplex Method
Simplex algorithm
Linear programing
Transportation problems
simplex method for operation research .pdf
Big-M Method Presentation
simplex method
NONLINEAR PROGRAMMING - Lecture 1 Introduction
Simplex Method
The False-Position Method
Fibonacci Heaps
Linear Programming
Sensitivity analysis linear programming copy
Chapter 4 Simplex Method ppt
Operation research unit 1: LPP Big M and Two Phase method
Big m method
LP special cases and Duality.pptx
graphical method
Applications of linear programming
Ad

Viewers also liked (11)

DOCX
Simplex method - Maximisation Case
PPTX
Simplex Algorithm
PPT
Lp simplex 3_
PDF
Lesson 31: The Simplex Method, I
PPTX
Operations research
PPT
Simplex Algorithm
PDF
Linear programming using the simplex method
PDF
Numerical analysis dual, primal, revised simplex
PPT
Linear Programming 1
PPTX
Linear programming - Model formulation, Graphical Method
PPTX
Special Cases in Simplex Method
Simplex method - Maximisation Case
Simplex Algorithm
Lp simplex 3_
Lesson 31: The Simplex Method, I
Operations research
Simplex Algorithm
Linear programming using the simplex method
Numerical analysis dual, primal, revised simplex
Linear Programming 1
Linear programming - Model formulation, Graphical Method
Special Cases in Simplex Method
Ad

Similar to Simplex Algorithm (20)

PDF
Senior Project4-29
PPTX
SIMPLEX METHOD.pptx
PPT
370_13735_EA221_2010_1__1_1_Simplex method.ppt
PPTX
Linear programming
PDF
Chapter 3.Simplex Method hand out last.pdf
PDF
PPT
4-The Simplex Method.ppt
PPTX
3. Linear Programming The Simplex Method.pptx
PPT
n7-LP-simplex.ppt
PDF
Ch06_1-2_Simplex_Method.pdf
PPT
Solving Linear programming problem by Simplex method.ppt
PDF
Quant-Report-Final.pdf
PPTX
Simplex Method.pptx
PPTX
performance management and Resource optimization part-2.pptx
PPTX
Scientific Computing and linear programming
PPTX
Chapter 2 II SIMPLEX METHOD OF SOLVING LPP.pptx
PDF
Combinatorial optimization CO-7
PPTX
Solution of LPP by Simplex Method with Examples
PPTX
Linear Programming - Simplex Algorithm by Yunus Hatipoglu
Senior Project4-29
SIMPLEX METHOD.pptx
370_13735_EA221_2010_1__1_1_Simplex method.ppt
Linear programming
Chapter 3.Simplex Method hand out last.pdf
4-The Simplex Method.ppt
3. Linear Programming The Simplex Method.pptx
n7-LP-simplex.ppt
Ch06_1-2_Simplex_Method.pdf
Solving Linear programming problem by Simplex method.ppt
Quant-Report-Final.pdf
Simplex Method.pptx
performance management and Resource optimization part-2.pptx
Scientific Computing and linear programming
Chapter 2 II SIMPLEX METHOD OF SOLVING LPP.pptx
Combinatorial optimization CO-7
Solution of LPP by Simplex Method with Examples
Linear Programming - Simplex Algorithm by Yunus Hatipoglu

Recently uploaded (20)

PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Pre independence Education in Inndia.pdf
PPTX
master seminar digital applications in india
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Cell Types and Its function , kingdom of life
PDF
Computing-Curriculum for Schools in Ghana
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Insiders guide to clinical Medicine.pdf
Final Presentation General Medicine 03-08-2024.pptx
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Pre independence Education in Inndia.pdf
master seminar digital applications in india
Microbial disease of the cardiovascular and lymphatic systems
O5-L3 Freight Transport Ops (International) V1.pdf
Microbial diseases, their pathogenesis and prophylaxis
FourierSeries-QuestionsWithAnswers(Part-A).pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
TR - Agricultural Crops Production NC III.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Cell Types and Its function , kingdom of life
Computing-Curriculum for Schools in Ghana
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPH.pptx obstetrics and gynecology in nursing
Insiders guide to clinical Medicine.pdf

Simplex Algorithm

  • 1. Muhammad Kashif Nawaz MS(CS) Batch # 3 Kashif.rpb@gmail.com
  • 2. Contents Overview • AGENDA – Introduction • KEY TERMINOLOGIES • SIMPLEX ALGORITHM • Software Simulation • SIMPLEX ALGORITHM VARIATIONS • REFERENCES 6/3/2014 Simplex Algorithm 2
  • 3. Introduction(Background) • Linear programming is the process of taking various linear inequalities relating to some situation, and finding the "best" value obtainable under those conditions. • Linear programming is part of a very important area of mathematics called optimization techniques. • The graphical method is useful only for problems involving two decision variables and relatively few problem constraints. 6/3/2014 Simplex Algorithm 3
  • 4. Introduction • Question: – Can we solve all LP problems using graphical approach ? • NO – WHY ??? » Real life systems can have dozens or hundreds of variables, or more. • What happens when we need more decision variables and more problem constraints? – Thus we need another systematic approach to solve the LP Problem. – Simplex Algorithm 6/3/2014 Simplex Algorithm 4
  • 5. Introduction • Simplex method which was developed by George B. DANTZIG (1914-2005) in 1947. • The most popular method used for the solution of Linear Programming Problems (LPP) is the simplex method. • The journal Computing in Science and Engineering listed it as one of the top 10 algorithms of the twentieth century. • Simplex Algorithm can solve an equation for many variables (dimensions). 6/3/2014 Simplex Algorithm 5
  • 6. Key Terminologies • Standard Form & Slack Variable • Basic & Non basic Variables • Simple Tableau • Pivoting 6/3/2014 Simplex Algorithm 6
  • 7. Standard Maximization Problems in Standard Form • A linear programming problem is said to be a standard maximization problem in standard form if its mathematical model is of the following form: • Maximize the objective function • Subject to problem constraints of the form • With non-negative constraints 6/3/2014 Simplex Algorithm 7
  • 8. Slack Variables • A mathematical representation of surplus resources. • In real life problems, it’s unlikely that all resources will be used completely, so there usually are unused resources. • Slack variables represent the unused resources between the left-hand side and right-hand side of each inequality. 6/3/2014 Simplex Algorithm 8 x1 + 2x2 < 32 3x1 + 4x2 < 84 x1 + 2x2 + s1 = 32 3x1 + 4x2 + s2 = 84
  • 9. Basic and Nonbasic Variables • Basic variables are selected arbitrarily with the restriction that there be as many basic variables as there are equations. The remaining variables are non-basic variables. • This system has two equations, we can select any two of the four variables as basic variables. The remaining two variables are then non-basic variables. • A solution found by setting the two non-basic variables equal to 0 and solving for the two basic variables is a basic solution. If a basic solution has no negative values, it is a basic feasible solution. 6/3/2014 Simplex Algorithm 9
  • 10. Simple tableau • Simplex Tableau: Most real-world problems are too complex to solve graphically. They have too many corners to evaluate, and the algebraic solutions are lengthy. A simplex tableau is a way to systematically evaluate variable mixes in order to find the best one. • Pivot Column: The column of the tableau representing the variable to be entered into the solution mix. • Pivot Row: The row of the tableau representing the variable to be replaced in the solution mix. • Pivot Number: The element in both the pivot column and the pivot row. 6/3/2014 Simplex Algorithm 10 All Variables Solutions Basic Variables Coefficients 0
  • 11. Pivoting • Pivoting : – To transform a current tableau into the next one and increase the value of the objective function to the next feasible solutions. To get to that feasible solution several steps are performed and those steps are called pivoting. – Steps: • First, divide all the entries of the pivot row by the pivot, its entry in the pivot column, to obtain Rownew • Then, replace each of the other rows, including the objective row, by the difference row − c .Rownew • where c is the row’s entry in the pivot column 6/3/2014 Simplex Algorithm 11
  • 12. Simplex Algorithm • Diagram • Steps • Example • Cycling & Bland’s rule • Efficiency 6/3/2014 Simplex Algorithm 12
  • 13. SIMPLEX METHOD 6/3/2014 Simplex Algorithm 13 Step-1 Write the standard maximization problem in standard form, introduce slack variables to form the initial system, and write the initial tableau. Step-3 Select the pivot column Step-5 Select the pivot element and perform the pivot operatio n STOP The optimal solution has been found. STOP The linear programming problem has no optimal solution Step 2 Are there any negative indicators in the bottom row? Step 4 Are there any positive elements in the pivot column above the dashed line? Simplex algorithm for standard maximization problems YESYES NONO
  • 14. To Solve A Linear Programming Problem In Standard Form, Use The Following Steps • Convert each inequality in the set of constraints to an equation by adding slack variables. • Create the initial simplex tableau. • Select the pivot column. ( The column with the “most negative value” element in the last row.) • Select the pivot row. (The row with the smallest non-negative result when the last element in the row is divided by the corresponding in the pivot column.) • Use elementary row operations calculate new values for the pivot row so that the pivot is 1 (Divide every number in the row by the pivot number.) • Use elementary row operations to make all numbers in the pivot column equal to 0 except for the pivot number. If all entries in the bottom row are zero or positive, this the final tableau. If not, go back to step 3. • If you obtain a final tableau, then the linear programming problem has a maximum solution, which is given by the entry in the lower-right corner of the tableau. 6/3/2014 Simplex Algorithm 14
  • 16. Example(Step 2) 6/3/2014 Simplex Algorithm 16 u v z 1 1 1 0 4 1 3 0 1 6 -3 -5 0 0 0 Initialized by the coefficients of the objective function. The signs are reversed in this row (objective row) We have constraints + 1 rows and variables +1 columns Pivot Column/Entering Variable. In our example, its Y
  • 17. Example(Step 3) x y u v u 1 1 1 0 4 v 1 3 0 1 6 z -3 -5 0 0 0 6/3/2014 Simplex Algorithm 17 Pivot Column/Entering Variable The row with the smallest θ-ratio determines the departing variable. For our example, it is variable v. The intersecting element of Pivot Column and Pivot Row is the pivot. In the next tableau the intersected element will become 1 and the rest of elements will become 0 in the pivot column. Departing Variable / Leaving Variable/ Pivot Row
  • 18. Example(Step 4 Iteration 1) x y u v u 1 1 1 0 4 v 1 3 0 1 6 z -3 -5 0 0 0 6/3/2014 Simplex Algorithm 18 x y u v u 1 1 1 0 4 y 1/3 1 0 1/3 2 z -3 -5 0 0 0 x y u v u 2/3 0 1 -1/3 2 y 1/3 1 0 1/3 2 z -4/3 0 0 5/3 10 The pivot row will be replaced by the Rownew we calculated. Row 1 and 3 will be calculated using the formula : Row = Row – c.Rownew Row1 –c.Rownew where c = 1 1-(1)(1/3), 1-(1)(1), 1-(1)(0), 0-(1)(1/3), 4-(1)(2) 2/3, 0, 1, -1/3, 2 Row3- c.Rownew where c = -5 -3-(-5)(1/3), -5-(-5)(1), 0-(-5)(0), 0-(-5)(1/3), 0-(-5)(2) -4/3, 0, 0, 5/3, 10 All the values in the last row are nonnegative ??
  • 19. Example(Step 4 Iteration 2) x y u v u 2/3 0 1 -1/3 2 y 1/3 1 0 1/3 2 z -4/3 0 0 5/3 10 6/3/2014 Simplex Algorithm 19 x y u v x 1 0 3/2 -1/2 3 y 0 1 -1/2 1/2 1 z 0 0 2 1 14 x y u v x 1 0 3/2 -1/2 3 y 1/3 1 0 1/3 2 z -4/3 0 0 5/3 10 ϴ-Ratio: 3 ϴ-Ratio: 6 Row = Row – c.Rownew Row2 –c.Rownew where c = 1/3 1/3-(1/3)(1), 1-(1/3)(0), 0-(1/3)(3/2), 1/3-(1/3)(-1/2), 2-(1/3)(3) 0, 1, -1/2, 1/2, 1 Row3- c.Rownew where c = -4/3 -4/3-(-4/3)(1), 0-(-4/3)(0), 0-(-4/3)(3/2), 5/3-(-4/3)(-1/2), 10-(-4/3)(3) 0, 0, 2, 1, 14 All the values in the last row are nonnegative ?? Rownew : 1, 0, 3/2, -1/2, 3
  • 20. Example(Optimal Solution) • x = 3 • y = 1 • u = 0 • v = 0 • z = 14 • We choose u and v equal to 0, because their column has all distinct values. If they were like x and y, they’d have some value. 6/3/2014 Simplex Algorithm 20
  • 21. Cycling & Bland’s Rule • When an objective function’s values “stall” for several iterations in a row and that the algorithm cycles back to a previously considered point and hence never terminate. This phenomenon is called cycling. • Although, it rarely happens, but when it does ,a simple modification of the simplex method, called Bland’s rule, eliminates even the theoretical possibility of cycling. • Assuming that the variables are denoted by a subscripted letter (e.g., x1, x2,..., xn), this rule can be stated as follows: – Among the columns with a negative entry in the objective row, select the column with the smallest subscript in choosing pivot column. – Resolve a tie among the smallest θ-ratios by selecting the row labeled by the basic variable with the smallest subscript in choosing pivot row. 6/3/2014 Simplex Algorithm 21
  • 22. Software Simulation • Simplex Method has became so efficient that its calculation packages are even available online. One of them is as follows: • For ease, we will copy the same problem to the online tool and check whether it gives us the same result: maximize z = 3x +5y subject to : x + y = 4 x+3y = 6 • Simplex Method Online Tool http://www.zweigmedia.com/RealWorld/simplex.html 6/3/2014 Simplex Algorithm 22
  • 23. Efficiency of Simplex Algorithm • Since we know that the algorithm progresses through a sequence of adjacent points of a feasible region. Right? • So, one should probably expect bad news because the number of extreme points is known to grow exponentially with the problem size. • The worst-case efficiency of the simplex method has been shown to be exponential. • But Fortunately! • More than half a century of practical experience with the algorithm has shown that the number of iterations in a typical application ranges between m and 3m, with the number of operations per iteration proportional to mn, where m and n are the numbers of equality constraints and variables, respectively. 6/3/2014 Simplex Algorithm 23
  • 24. Other Variants of the Algorithm • Ellipsoid Method: – An important mile- stone in the history of such algorithms was the proof by L. G. Khachian showing that the ellipsoid method can solve any linear programming problem in polynomial time. – However, ellipsoid method was much slower than the simplex method in practice • Karmarker’s Method – Narendra Karmarkar published an algorithm that not only had a polynomial worst-case efficiency but also was competitive with the simplex method. This method generates a sequence of feasible solutions that lie within the feasible region rather than going through a sequence of adjacent extreme points as the simplex method does. (Interior Point Methods). 6/3/2014 Simplex Algorithm 24
  • 25. Reference(s) • The material presented in this lecture is adopted from: • Introduction to Design and Analysis of Algorithms, 3rd Edition, Anany Levitin. • Introduction to Algorithms, Second Edition, Thomas.H.Cormen • www.iftikharahmad.org/teachings/Lec_16_Simplex_Algorith m.pdf 6/3/2014 Simplex Algorithm 25