All Topics  
Simplex algorithm

 

   Email Print
   Bookmark   Link






 

Simplex algorithm



 
 
In mathematical optimization theory
Optimization (mathematics)

In mathematics, the simplest case of optimization, or mathematical programming, refers to the study of problems in which one seeks to maxima and minima or maxima and minima a Function of a real variable by systematically choosing the values of Real number or integer variables from within an allowed set....
, the simplex algorithm, created by the American
United States

The United States of America is a Federal government constitutional republic comprising U.S. state and a federal district. The country is situated mostly in central North America, where its Contiguous United States and Washington, D.C., the Capital districts and territories, lie between the Pacific Ocean and Atlantic Oceans, Borders of the U...
 mathematician
Mathematician

A mathematician is a person whose primary area of study and/or research is the field of mathematics....
 George Dantzig
George Dantzig

George Bernard Dantzig was an United States mathematician, and the Professor Emeritus of Transportation Sciences and Professor of Operations Research and of Computer Science at Stanford....
 in 1947, is a popular algorithm
Algorithm

In mathematics, computing, linguistics and related subjects, an algorithm is a sequence of finite instructions, often used for calculation and data processing....
 for numerical
Numerical analysis

Numerical analysis is the study of algorithms for the problems of continuous mathematics .One of the earliest mathematical writings is the Babylonian tablet YBC 7289, which gives a sexagesimal numerical approximation of , the length of the diagonal in a unit square....
 solution of the linear programming
Linear programming

In mathematics, linear programming is a technique for optimization of a linear objective function, subject to linear equality and linear inequality Constraint ....
 problem. The journal Computing in Science and Engineering listed it as one of the top 10 algorithms of the century.

An unrelated, but similarly named method is the Nelder-Mead method
Nelder-Mead method

The Nelder-Mead method or downhill simplex method or amoeba method is a commonly used nonlinear Optimization algorithm. It is due to John Nelder & R....
 or downhill simplex method due to Nelder & Mead (1965) and is a numerical method for optimizing many-dimension
Dimension

In mathematics, the dimension of a space is roughly defined as the minimum number of coordinates needed to specify every point within it. For example: a point on the unit circle in the plane can be specified by two Cartesian coordinates but one can make do with a single coordinate , so the circle is 1-dimensional even though it exists in...
al unconstrained problems, belonging to the more general class of search algorithm
Search algorithm

In computer science, a search algorithm, broadly speaking, is an algorithm that takes a problem as input and returns a solution to the problem, usually after evaluating a number of possible solutions....
s.

In both cases, the method uses the concept of a simplex
Simplex

In geometry, a simplex or n-simplex is an n-dimensional analogue of a triangle. Specifically, a simplex is the convex hull of a set of affine transformation Point s in some Euclidean space of dimension n or higher ....
, which is a polytope
Polytope

In geometry, polytope is a generic term that can refer to a two-dimensional polygon, a three-dimensional polyhedron, or any of the various generalizations thereof, including generalizations to higher dimensions and other abstractions ....
 of N + 1 vertices in N dimensions: a line segment
Line segment

In geometry, a line segment is a part of a line that is bounded by two end Point , and contains every point on the line between its end points....
 in one dimension, a triangle
Triangle

A triangle is one of the basic shapes of geometry: a polygon with three corners or wikt:vertex and three sides or edges which are line segments....
 in two dimensions, a tetrahedron
Tetrahedron

A tetrahedron is a polyhedron composed of four triangle faces, three of which meet at each vertex . A regular tetrahedron is one in which the four triangles are regular, or "equilateral", and is one of the Platonic solids....
 in three-dimensional space and so forth.

ider a linear programming problem,
maximize
subject to


In geometric terms, each inequality specifies a half-space
Half-space

In geometry, a half-space is either of the two parts into which a plane divides the three-dimensional space. More generally, a half-space is either of the two parts into which a hyperplane divides an affine space....
 in n-dimensional Euclidean space
Euclidean space

Around 300 Before Christ, the Ancient Greece mathematician Euclid undertook a study of relationships among distances and angles, first in a plane and then in space....
, and their intersection is the set of all feasible values the variables can take.






Discussion
Ask a question about 'Simplex algorithm'
Start a new discussion about 'Simplex algorithm'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In mathematical optimization theory
Optimization (mathematics)

In mathematics, the simplest case of optimization, or mathematical programming, refers to the study of problems in which one seeks to maxima and minima or maxima and minima a Function of a real variable by systematically choosing the values of Real number or integer variables from within an allowed set....
, the simplex algorithm, created by the American
United States

The United States of America is a Federal government constitutional republic comprising U.S. state and a federal district. The country is situated mostly in central North America, where its Contiguous United States and Washington, D.C., the Capital districts and territories, lie between the Pacific Ocean and Atlantic Oceans, Borders of the U...
 mathematician
Mathematician

A mathematician is a person whose primary area of study and/or research is the field of mathematics....
 George Dantzig
George Dantzig

George Bernard Dantzig was an United States mathematician, and the Professor Emeritus of Transportation Sciences and Professor of Operations Research and of Computer Science at Stanford....
 in 1947, is a popular algorithm
Algorithm

In mathematics, computing, linguistics and related subjects, an algorithm is a sequence of finite instructions, often used for calculation and data processing....
 for numerical
Numerical analysis

Numerical analysis is the study of algorithms for the problems of continuous mathematics .One of the earliest mathematical writings is the Babylonian tablet YBC 7289, which gives a sexagesimal numerical approximation of , the length of the diagonal in a unit square....
 solution of the linear programming
Linear programming

In mathematics, linear programming is a technique for optimization of a linear objective function, subject to linear equality and linear inequality Constraint ....
 problem. The journal Computing in Science and Engineering listed it as one of the top 10 algorithms of the century.

An unrelated, but similarly named method is the Nelder-Mead method
Nelder-Mead method

The Nelder-Mead method or downhill simplex method or amoeba method is a commonly used nonlinear Optimization algorithm. It is due to John Nelder & R....
 or downhill simplex method due to Nelder & Mead (1965) and is a numerical method for optimizing many-dimension
Dimension

In mathematics, the dimension of a space is roughly defined as the minimum number of coordinates needed to specify every point within it. For example: a point on the unit circle in the plane can be specified by two Cartesian coordinates but one can make do with a single coordinate , so the circle is 1-dimensional even though it exists in...
al unconstrained problems, belonging to the more general class of search algorithm
Search algorithm

In computer science, a search algorithm, broadly speaking, is an algorithm that takes a problem as input and returns a solution to the problem, usually after evaluating a number of possible solutions....
s.

In both cases, the method uses the concept of a simplex
Simplex

In geometry, a simplex or n-simplex is an n-dimensional analogue of a triangle. Specifically, a simplex is the convex hull of a set of affine transformation Point s in some Euclidean space of dimension n or higher ....
, which is a polytope
Polytope

In geometry, polytope is a generic term that can refer to a two-dimensional polygon, a three-dimensional polyhedron, or any of the various generalizations thereof, including generalizations to higher dimensions and other abstractions ....
 of N + 1 vertices in N dimensions: a line segment
Line segment

In geometry, a line segment is a part of a line that is bounded by two end Point , and contains every point on the line between its end points....
 in one dimension, a triangle
Triangle

A triangle is one of the basic shapes of geometry: a polygon with three corners or wikt:vertex and three sides or edges which are line segments....
 in two dimensions, a tetrahedron
Tetrahedron

A tetrahedron is a polyhedron composed of four triangle faces, three of which meet at each vertex . A regular tetrahedron is one in which the four triangles are regular, or "equilateral", and is one of the Platonic solids....
 in three-dimensional space and so forth.

Overview

Simplex Description
Consider a linear programming problem,
maximize
subject to


In geometric terms, each inequality specifies a half-space
Half-space

In geometry, a half-space is either of the two parts into which a plane divides the three-dimensional space. More generally, a half-space is either of the two parts into which a hyperplane divides an affine space....
 in n-dimensional Euclidean space
Euclidean space

Around 300 Before Christ, the Ancient Greece mathematician Euclid undertook a study of relationships among distances and angles, first in a plane and then in space....
, and their intersection is the set of all feasible values the variables can take. The region is either empty, unbounded, or a convex
Convex set

In Euclidean space, an object is convex if for every pair of points within the object, every point on the straight line segment that joins them is also within the object....
 polytope
Polytope

In geometry, polytope is a generic term that can refer to a two-dimensional polygon, a three-dimensional polyhedron, or any of the various generalizations thereof, including generalizations to higher dimensions and other abstractions ....
.

The set of points where the objective function obtains a given value v is defined by the hyperplane . We are looking for the largest v such that the hyperplane still intersects the feasible region. As v increases, the hyperplanes translates in the direction of the vector c. Intuitively, and indeed it can be shown by convexity, the last hyperplane to intersect the feasible region will either just graze a vertex of the polytope, or a whole edge or face. In the latter two cases, its still the case that the endpoints of the edge or face will achieve the optimum value. Thus, the optimum value will always be achieved on one of the vertices of the polytope.

The simplex algorithm leverages this insight by rewriting the problem so that one of the vertices of the (possibly unbounded) polytope is easy to find, or it is revealed that the problem is infeasible. Then, the algorithm walks along edges of the polytope to vertices with higher objective function value until a local maximum is reached, or the problem is revealed to be unbounded. By convexity, a local maximum is also a global maximum, so the solution has been found. Usually there are more than one adjacent vertices which improve the objective function, so a pivot rule must be specified to determine which vertex to pick. The selection of this rule has a great impact on the runtime of the algorithm.

In 1972, Klee and Minty gave an example of a linear programming problem in which the polytope P is a distortion of an n-dimensional cube. They showed that the simplex method as formulated by Dantzig visits all 2n vertices before arriving at the optimal vertex. This shows that the worst-case complexity of the algorithm is exponential time
Exponential time

In computational complexity theory, exponential time is the computation time of a problem where the time to complete the computation, m, is bounded by an exponential function of the problem size, n....
. Since then it has been shown that for almost every deterministic rule there is a family of simplices on which it performs badly. It is an open question if there is a pivot rule with polynomial time
Polynomial time

In computational complexity theory, polynomial time refers to the computation time of a problem where the run time, , is no greater than a polynomial function of the problem size, n....
, or even sub-exponential worst-case complexity.

Nevertheless, the simplex method is remarkably efficient in practice. It has been known since the 1970s that it has polynomial-time average-case complexity
Best, worst and average case

In computer science, best, worst and average cases of a given algorithm express what the Resource usage is at least, at most and on average, respectively....
 under various distributions. These results on "random" matrices still didn't quite capture the desired intuition that the method works well on "typical" matrices. In 2001 Spielman and Teng introduced the notion of smoothed complexity to provide a more realistic analysis of the performance of algorithms.

Other algorithms for solving linear programming problems are described in the linear programming
Linear programming

In mathematics, linear programming is a technique for optimization of a linear objective function, subject to linear equality and linear inequality Constraint ....
 article.

Implementation

The simplex algorithm requires the linear programming problem to be in augmented form
Linear programming

In mathematics, linear programming is a technique for optimization of a linear objective function, subject to linear equality and linear inequality Constraint ....
. The problem can then be written as follows in matrix form:
Maximize Z in:
where x are the variables from the standard form, xs are the introduced slack variables from the augmentation process, c contains the optimization coefficients, A and b describe the system of constraint equations, and Z is the variable to be maximized.

Suppose in the standard form of the problem there are n variables and m constraints, not counting the n nonnegativity constraints. Generally, a vertex of the simplex corresponds to making n of the m+n total constraints tight, while adjacent vertices share n-1 tight constraints. There is a little subtlety when such a point in n-space does not fall in feasible region. Ignoring that, in the augmented form, this corresponds to setting n of the m+n variables (n original and m slack) to 0. We call such a setting of the variables a basic solution. The m variables which are purposely set to 0 are called the nonbasic variables. We can then solve for the remaining n constraints, called the basic variables, which will be uniquely determined, as we will be careful not to step out of the feasible region.

The simplex algorithm begins by finding a basic feasible solution. At each step, one basic and one nonbasic variable are chosen according to the pivot rule, and their roles are switched.

Matrix form of the simplex algorithm

At any iteration of the simplex algorithm, the tableau will be of this form:
where are the coefficients of basic variables in the c-matrix; and B consists of the columns of corresponding to the basic variables.

It is worth noting that B and are the only variables in this equation (except Z and x of course). Everything else is constant throughout the algorithm.

Algorithm

  • Choose a basic feasible solution (BF) as shown above
This implies that B is the identity matrix, and is a zero-vector.


  • While nonoptimal solution:
    • Determine direction of highest gradient
      Choose the variable associated with the coefficient in that has the highest negative magnitude. This nonbasic variable, which we call the entering basic, will be increased to help maximize the problem.
    • Determine maximum step length
      Use the subequation to determine which basic variable reaches zero first when the entering basic is increased. This variable, which we call the leaving basic then becomes nonbasic. This operation only involves a single division for each basic variable, since the existing basic-variables occur diagonally in the tableau.
    • Rewrite problem
      Modify B and to account for the new basic variables. This will automatically make the tableau diagonal for the existing and new basic variables.
    • Check for improvement
      Repeat procedure until no further improvement is possible, meaning all the coefficients of are positive. Procedure is also terminated if all coefficients are zero, and the algorithm has walked in a circle and revisited a previous state.


Implementation


The tableau form used above to describe the algorithm lends itself to an immediate implementation in which the tableau is maintained as a rectangular (m+1)-by-(m+n+1) array. It is straightforward to avoid storing the m explicit columns of the identity matrix that will occur within the tableau by virtue of B being a subset of the columns of . This implementation is referred to as the standard simplex method. The storage and computation overhead are such that the standard simplex method is a prohibitively expensive approach to solving large linear programming problems.

In each simplex iteration, the only data required are the first row of the tableau, the (pivotal) column of the tableau corresponding to the entering variable and the right-hand-side. The latter can be updated using the pivotal column and the first row of the tableau can be updated using the (pivotal) row corresponding to the leaving variable. Both the pivotal column and pivotal row may be computed directly using the solutions of linear systems of equations involving the matrix B and a matrix-vector product using A. These observations motivate the revised simplex method, for which implementations are distinguished by their invertible representation of B.

In large linear programming problems A is typically a sparse matrix
Sparse matrix

In the mathematics subfield of numerical analysis a sparse matrix is a matrix populated primarily with zeros .Conceptually, sparsity corresponds to systems which are loosely coupled....
 and, when the resulting sparsity of B is exploited when maintaining its invertible representation, the revised simplex method is a vastly more efficient solution procedure than the standard simplex method. Commercial simplex solvers are based on the primal (or dual) revised simplex method.

Common implementations of the revised simplex method

  • The Bartels-Golub Method
  • The Sparse Bartels-Golub Method
  • The Forrest-Tomlin Method
  • Reid’s Method


See also

  • Nelder-Mead method
    Nelder-Mead method

    The Nelder-Mead method or downhill simplex method or amoeba method is a commonly used nonlinear Optimization algorithm. It is due to John Nelder & R....
  • Fourier-Motzkin elimination
  • Bland's anti-cycling rule
    Bland's rule

    In applied mathematics, Bland's rule is a technique used in the simplex method for ensuring that a linear optimization problem always converges to an answer....
  • Karmarkar's algorithm
    Karmarkar's algorithm

    Karmarkar's algorithm is an algorithm introduced by Narendra Karmarkar in 1984 for solving linear programming problems. It was the first reasonably efficient algorithm that solves these problems in polynomial time....


Further reading

  • Greenberg, Harvey J., Klee-Minty Polytope Shows Exponential Time Complexity of Simplex Method University of Colorado at Denver (1997)
  • Frederick S. Hillier and Gerald J. Lieberman: Introduction to Operations Research, 8th edition. McGraw-Hill. ISBN 0-07-123828-X
  • Thomas H. Cormen
    Thomas H. Cormen

    Thomas H. Cormen is the co-author of Introduction to Algorithms, along with Charles Leiserson, Ron Rivest, and Clifford Stein. He is a Full Professor of computer science at Dartmouth College and currently Chair of the Dartmouth College Writing Program....
    , Charles E. Leiserson
    Charles E. Leiserson

    Charles Eric Leiserson is a computer scientist, specializing in the theory of parallel computing and distributed computing, and particularly practical applications thereof; as part of this effort, he developed the Cilk multithreaded language....
    , Ronald L. Rivest, and Clifford Stein
    Clifford Stein

    Clifford Stein, a computer scientist, is currently a professor of industrial engineering and operations research at Columbia University in New York, NY, where he also holds an appointment in the Department of Computer Science....
    . Introduction to Algorithms, Second Edition. MIT Press and McGraw-Hill, 2001. ISBN 0-262-03293-7. Section 29.3: The simplex algorithm, pp.790–804.
  • Hamdy A. Taha: Operations Research: An Introduction, 8th ed., Prentice Hall, 2007. ISBN 0-13-188923-0
  • Richard B. Darst: Introduction to Linear Programming: Applications and Extensions


External links

  • by Spyros Reveliotis of the Georgia Institute of Technology.
  • A Java-based tool which, for problems in two variables, relates the algebraic and geometric views of the tableau simplex method. Also illustrates the sensitivity of the solution to changes in the right-hand-side.
  • Solve your own LP problem. Note: this does not work well. Sample problem: minimize z=x1+x2 subject to 2x1+3x2<=6 and -x1+x2<=1 should give 0 as answer. This applet gives the same answer for both maximize and minimize problem.
  • Java-based hosted by Argonne National Laboratory.
  • by Stefan Waner, hofstra.edu. Interactive worked example.
  • by Mazoo's Learning Blog.
  • A good tutorial for Simplex Method with examples (also two-phase and M-method).
  • Other good tutorial for Simplex Method with the Two-Phase Simplex and Graphical methods, examples, and a tool to solve Simplex problems online.
  • Quick-loading JavaScript-based web page that solves Simplex problems