Simplex New
Simplex New
Rajiv Raman
February 18, 2026
min c⊤ x
s.t.
Ax = b
x ≥0
We let P denote the polyhedron defined by the constraints of the
LP. We have established that if this LP has a finite optimal solution,
then this solution occurs at a vertex. In brief, the simplex algorithm
starts at a vertex and repeatedly moves to an adjacent vertex with
lower cost, until no such move is possible. At this point, we would
have found an optimal solution.
So, suppose we are given a BFS x of the LP above. At a BFS, there
are n active constraints. Since m of them come from the system of lin-
ear equations, n − m of the variables must be 0. Therefore, there are
at most m non-zero variables at x. We use B(1), . . . , B(m) to denote
the indices of these m (potentially) non-zero variables at x.
We call the set B(1), . . . , B(m) of the indices of the potentially non-
zero variables the basic indices. The set x B(1) , . . . , x B(m) are called the
basic variables. The set N of zero variables the non-basic variables at
x. The m × m matrix B of columns corresponding to the variables in
B(1), . . . , B(m) is called the basis matrix. Notation:
By the definition of a BFS, the basis matrix B is invertible. Thus, • { B(1), . . . , B(m)}: basic indices.
the values of the basic variables is given by • { x B(1) , . . . , x B(m) }: basic variables.
• B: m × m matrix of columns of A
x B = B −1 b corr. to basic indices.
• A B(1) , . . . , A B(m) : columns of B.
Note that at x, since x N = 0, the objective function value at x is • N: non-basic variables.
c⊤B B.
x
In order to decrease the objective function value, our goal is to
find a direction in which to move so that the objective function value A BFS looks like the following:
decreases. A feasible direction is a direction d along which we can
move so that we are still in the feasible region P.
xB
xB
=
0
xN .
.
.
0
simplex algorithm 2
y = x + θd ∈ P
θ > 0.
Each choice of j ∈ N along which we can move is called a basic
direction (although we are really increasing a non-basic variable. So
may be we should call this the jth non-basic direction, but this is a bit
unweildy. So we’ll stick to the standard definition and call this the jth
basic direction.)
If we move to y = x + θd, and we want y ∈ P, then the values of
the basic variables must change. How should they change?
Since y ∈ P,
Ay = b ⇒ A(x + θd) = Bx B + θd = b + θd = b
Thus, Ad = 0
!
dB
Let d = . We have chosen d⊤
N = (0, . . . , 0, 1, 0 . . . , 0), with 1
dN
at position j and 0 elsewhere. Then,
Ad = Bd B + A j = 0
⇒ d B = − B −1 A j (1)
c⊤ y = c⊤ (x + θd) = c⊤ ⊤ ⊤
B x B + θc B d B + c j
= c⊤ −1
B x B − θB A j + θc j [Plugging in the value of d B from (1)]
c⊤ y − c⊤ x = c⊤ −1 ⊤
B x B − θB A j + θc j − c B x B
= θ c j − B −1 A j
c j = c j − θB−1 A j (2)
Clearly, if moving along jth basic direction reduces the cost of the
objective function value, then we must have c j < 0.
Note: If x were non-degenerate, x B > 0. Thus, we can pick θ > 0 small
enough so that y ̸= x. However, if x were degenerate, there is an i ∈ B Reduced cost along the jth basic
direction: c j − θB−1 A j
such that xi = 0. In this case, for any θ > 0 we will have yi < 0, an
infeasible solution. Thus, in effect, we can not move from x. We will
restrict ourselves to the non-degenerate setting initially, and then
describe how we can deal with degeneracy.
Suppose, starting from a BFS x, we have moved to a point y ∈
P as described above. How large can we set θ? The value of θ is
determined by the sign and magnitude of (d B )i , i ∈ B, i.e., the entries
of d B . If d B ≥ 0, then, one can easily check that for any θ > 0, we
remain in P. It follows that the LP is unbounded. Suppose we have
i ∈ B such that (d B )i < 0. Then, we obtain an upper bound:
xi
θ∗ ≤ min (3)
i ∈ B:(d B )i <0 −( d B )i
Simplex Algorithm
Theorem 1. If we start with a BFS x with basis B, and in one step we move
to y = x + θ ∗ d as in the Simplex algorithm above. Then, we claim that
2. y is a BFS.
m
∑ λk Ak = 0
k =1
m
∑ λ k B −1 A k = 0
k =1
| |
Ad = A(y − x) = b − b = 0 (4)
Ad = Bd B + ∑ Ai di = 0
i∈ N
dB = − ∑ B −1 A i d i (5)
i∈ N
simplex algorithm 6
Thus,
c⊤ (y − x) = c⊤ d
= c⊤
B (d B ) + ∑ ci di
i∈ N
= c⊤
B (− ∑B −1
Ai di ) + ∑ ci di [from Eqn.(5)]
i∈ N i∈ N
= ∑ ci − c ⊤ −1
B B Ai di
i∈ N
= ∑ ci di
i∈ N
≥0
Proof. The number of basic solutions is finite, and hence, so are the
number of BFS. In each iteration, the algorithm moves to a new BFS
of lower cost. Therefore, after a finite number of steps the algorithm
halts with an optimal solution. The algorithm halts at a BFS x if
c ≥ 0, or if d B ≥ 0. In the first case, by Theorem 2, we obtain an
optimal solution. In the second case, the algorithm returns that the
optimal solution is unbounded.
Note:
min c⊤ x
s.t.
Ad = 0
di ≥ 0, i ∈ Z
has an optimal cost of zero. In this sense, deciding optimality is equiva-
lent to solving a new linear programming problem.
Exercise 7. This exercise deals with the problem of deciding whether a given
degenerate basic feasible solution is optimal and shows that this is essentially
as hard as solving a general linear programming problem. Consider the
linear programming problem of minimizing c⊤ x over all x ∈ P, where
P = {x ∈ Rn : Ax ≤ b} is a given bounded and nonempty polyhedron.
Let Q = {( x, t) ∈ Rn+1 : Ax ≤ tb, t ∈ [0, 1]}.
1. Give an example of P and Q, with n = 2, for which the zero vector (in
Rn+1 ) is a degenerate basic feasible solution in Q; show the example in a
figure.
2. Show that the zero vector in Rn+1 minimizes (c, 0)⊤ y over all y ∈ Q if
and only if the optimal cost in the original linear programming problem
is greater than or equal to zero.
Implementation
A basic implementation
Let us now analyze the complexity of an iteration of the simplex
algorithm. Suppose we have an initial BFS. At each iteration, we
compute, for each of the n − m basic directions, the reduced cost.
Each computation of the reduced cost invovles computing
c j = c j − c⊤ −1
B B Aj
simplex algorithm 8
Revised Simplex
The biggest time-suck in each iteration is the computation of B−1 .
At the end of an iteration, we obtain a basis B and we re-compute
−1
B from scratch. However, note that the columns of B and B dif-
fer in only one column. So it seems likely that we could use B−1 to
compute B. Let us see how we can use this.
B −1 A B = e 1 ... e i −1 B −1 A j e i +1 ... em
Consider the vector (B)−1 A j . There is a sequence of row-
operations that converts this vector into the vector ei . This sequence
of row-operations can be represented by a matrix, say Q. Then, it
follows that:
Q B −1 A j = e i
Thus,
−1
B = QB−1 (6)
−1
In other words, we can compute B in time required to pre-
multiply with Q. This is a sequence of row operations, and hence
takes only O(m2 ) time to compute. Therefore, we can reduce the run-
ning time of each iteration of the simplex algorithm to O(m2 + mn).
Since we have an initial BFS for the auxiliary LP, we can solve
it optimally using the Simplex algorithm. Let ( x, s) be the optimal
solution returned and let B be the basis matrix corresponding to this
solution. If all the columns of B come from A, then it follows that B
is also a basis for the original LP and x is a BFS for the original LP.
On the other hand, if B contains some columns corresponding to s,
then we proceed as follows:
Suppose there are k < m columns from A, namely A1 , . . . , Ak
in B. By assumption A has rank m. Therefore, we can add an addi-
tional m − k columns from A to obtain a linearly independent set of
columns. For the added columns, set the corresponding variables for
the original LP to 0. We claim that this is a BFS for the original LP.
Observe that this is a degenerate BFS. Therefore, we obtain an initial
BFS for the original LP and we can now solve the original LP via the
Simplex algorithm. This method of removing the artifical variables
from the basis is called driving out the artificial variables.
Running the Simplex algorithm on the auxiliary LP to obtain an
initial BFS for the original LP is called the 2-phase simplex method.
Big-M method A second method that does not use two distinct runs
of the simplex algorithm is the so called big-M method. Given an LP
min{c⊤ x : Ax = b, x ≥ 0} in standard form. As before, we augment
the LP with auxiliary variables. But, this time, we add the auxiliary
simplex algorithm 10
Full tableau
We now describe the simplex algorithm in a form that is described
in most textbooks. The simplex algorithm was invented in the 1940s.
Since there were hardly any computers then, the computation had
to be done by hand. The tableau therefore, is a presentation of the
algorithm that enables one to find solutions to small LPs by hand.
Nevertheless, the tableau also makes it easy to track the change in
the variables as the algorithm progresses and also helps us in the
analysis of the algorithm when we deal with degeneracies.
The tableau stores the values as described in the table. This is a
full tableau since we also store the columns B−1 Ai for the columns
corresponding to the basic variables as well as the ones correspond-
ing to the non-basic variables. The first column, also called the zeroth
column stores the values of the basic variables. The first row is called
the zeroth row and stores the objective function value at the current
BFS as well as the reduced costs. Note that we store the reduced costs
for all basic directions, i.e., corresponding to the non-basic variables,
as well as the ones corresponding to the basic variables (which is 0).
The simplex algorithm chooses a column with negative reduced-
cost, and picks a row that restricts the increase the most. The oper-
ations as described in the revised simplex method above yield the
tableau with the new basis B.
c ⊤ B −1 b c⊤ − c⊤ −1
BB A
B −1 b −
B A1
is called the pivot column. Once the pivot column is chosen, our goal
is to find θ ∗ . Observe that the values of the basic variables is in the
0th column. Hence, we only need to find the ratios of the 0th column
with the positive entries in the pivot column and pick the minimum
of these ratios. Among the rows achieving the minimum, we choose
one row. This the row corresponding to an exiting variable. This row
is called the pivot row. The entry in the tableau lying in both the pivot
row and pivot column is called the pivot element.
We now need to update the tableau corresponding to the new
basis - the entering variable is in the new basis B and the exiting
variable is removed from the basis.
How do we update the tableau? First, consider the columns
1, . . . , n and the rows 1, . . . , m (that is, we ignore the 0th row and 0th
−1
column for now). We want to compute the columns B A j . From
the description of the revised simplex algorithm, we know that
−1
B = QB−1 . That is, Q is the sequence of row operations that con-
−1
vert BB to the identity matrix. That is, the sequence of elementary
row operations that transform the pivot column into the identity. It
follows that in order to do this, we multiply the pivot row by −ui /uℓ
and add it to the ith row, where we use u = B−1 A j , where j is the
pivot column. We then scale the pivot row by uℓ so that the pivot
column becomes the unit vector eℓ .
How are the entries in the 0th column changed? The entries were
−1 −1
−
B 1 b under basis B and are now B b. Since B = QB−1 , it follows
that we apply the same operations as for the other columns to obtain
the new 0th column.
Finally, we need to update the 0th row. It turns out that this update
is also just an elementary row operation as the other rows of the
tableau.
In the following, we present some linear programming problems
solved via the simplex algorithm using the tableau.
Example.
Consider the following minimization problem:
x1 + x2 ≤ 4
2x1 + x2 ≤ 6
x1 , x2 ≥ 0
x2
min z = −3x1 − 2x2 + 0x3 + 0x4
s.t. x1 + x2 + x3 = 4
2x1 + x2 + x4 = 6 (0, 4)
x1 , x2 , x3 , x4 ≥ 0
Optimal
Initial Tableau (Iteration 0) (z = −(2,
10)2)
The initial basic variables are the slack variables { x3 , x4 }.
• We choose the entering variable based on the most negative re- Iter 2
duced cost (x1 with −3).
x1
• We choose the leaving variable based on the minimum ratio test: (0, 0) Start Iter 1 (3, 0)
x1 + x2 = 4
min{4/1, 6/2}. (z = 0)
2x1 + x2 = 6
Basic Value x1 x2 x3 x4
z 0 − 3 −2 0 0
x3 4 1 1 1 0
x4 6 2 1 0 1
Pivot Element: 2 (Row x4 , Column x1 ).
Leaving Variable: x4 .
3. Iteration 1
We perform row operations to convert the pivot column into a unit
vector.
1
• New x1 Row: 2 R2
Basic Value x1 x2 x3 x4
z −9 0 −0.5 0 1.5
x3 1 0 0.5 1 −0.5
x1 3 1 0.5 0 0.5
Pivot Selection:
Basic Value x1 x2 x3 x4
z −10 0 0 1 1
x2 2 0 1 2 −1
x1 2 1 0 −1 1
5. Conclusion
All reduced costs in the top row are non-negative (0, 0, 1, 1). There-
fore, we have reached the optimal solution.
Optimal Solution:
x1 = 2, x2 = 2, zmin = −10
Example 2
We consider the following minimization problem where the feasible
region allows for infinite improvement of the objective function.
min z = − x1 − 4x2
Subject to:
−2x1 + x2 ≤ 2
x1 − x2 ≤ 1
x1 , x2 ≥ 0
x2
Standard Form:
−2x1 + x2 = 2
min z = − x1 − 4x2 + 0x3 + 0x4
s.t. − 2x1 + x2 + x3 = 2 x1 − x2 =
Unbounded
x1 − x2 + x4 = 1
x1 , x2 , x3 , x4 ≥ 0
(0, 2)
Iteration 0 ( Tableau)
The initial basis is { x3 , x4 }.
Iter 1
• Entering Variable: x2 (Reduced cost −4 is the most negative). Start
x1
(0, 0)
simplex algorithm 14
• Leaving Variable:
Variable x3 leaves.
Basic Value x1 x2 x3 x4
z 0 −1 − 4 0 0
x3 2 −2 1 1 0
x4 1 1 −1 0 1
Basic Value x1 x2 x3 x4
z −8 −9 0 4 0
x2 2 −2 1 1 0
x4 3 −1 0 1 1
Stopping Condition:
A cycling example
This example shows that if we are not careful about the entering and
exiting variables, then the Simplex algorithm may not terminate. We
use the standard pivot rule (most negative reduced cost) and break
ties for leaving variables by choosing the smallest index (topmost
row).
simplex algorithm 15
Minimize:
z = −10x1 + 57x2 + 9x3 + 24x4
Subject to:
Standard Form
Iteration 0
Basic Val x1 x2 x3 x4 x5 x6
z 0 −10 57 9 24 0 0
x5 0 0.5 −5.5 −2.5 9 1 0
x6 0 0.5 −1.5 −0.5 1 0 1
Iteration 1
Basic Val x1 x2 x3 x4 x5 x6
z 0 0 −53 −41 204 20 0
x1 0 1 −11 −5 18 2 0
x6 0 0 4 2 −8 −1 1
simplex algorithm 16
Iteration 2
Basic Val x1 x2 x3 x4 x5 x6
z 0 0 0 −14.5 98 6.75 13.25
x1 0 1 0 0.5 −4 −0.75 2.75
x2 0 0 1 0.5 −2 −0.25 0.25
Iteration 3
Basic Val x1 x2 x3 x4 x5 x6
z 0 29 0 0 −18 −15 93
x3 0 2 0 1 −8 −1.5 5.5
x2 0 −1 1 0 2 0.5 −2.5
Iteration 4
Basic Val x1 x2 x3 x4 x5 x6
z 0 20 9 0 0 −10.5 70.5
x3 0 −2 4 1 0 0.5 −4.5
x4 0 −0.5 0.5 0 1 0.25 −1.25
Iteration 5
Basic Val x1 x2 x3 x4 x5 x6
z 0 −22 93 21 0 0 −24
x5 0 −4 8 2 0 1 −9
x4 0 0.5 −1.5 −0.5 0 0 1
Basic Val x1 x2 x3 x4 x5 x6
z 0 −10 57 9 24 0 0
x5 0 0.5 −5.5 −2.5 9 1 0
x6 0 0.5 −1.5 −0.5 1 0 1
simplex algorithm 17
Exercise 8. Solve the following LP both graphically and via the tableau
method.
2x1 + x2 ≤ 6
x1 + 2x2 ≤ 6
x1 , x2 ≥ 0
x1 − x2 ≤ 2
x1 ≤ 3
x1 , x2 ≥ 0
x1 ≤ 4
2x2 ≤ 12
3x1 + 2x2 ≤ 18
x1 , x2 ≥ 0
x1 − x2 ≤ 1
− x1 + x2 ≤ 1
x1 , x2 ≥ 0
min 2x1 − x2
s.t.
x1 − x2 ≤ 2
x1 + x2 ≤ 6
x1 , x2 ≥ 0
(i) Convert the problem into standard form and construct a basic feasible
solution at which ( x1 , x2 ) = (0, 0).
(ii) Carry out the ful tableau implementation of the simplex method, start-
ing with the basic feasible solution of part (i ).
Exercise 10. Show how Phase 1 of the simplex method can be used to solve
n simultaneous linear equations in n unknowns. Show how the following
cases can be detected:
3. Unique solution.
x1 + 2x2 + x3 ≥4
2x1 + x2 + x3 ≥5
2x1 + 3x2 + 2x3 ≥6
x1 , x2 , x3 ≥ 0
Degeneracy
Proof. In order to prove that simplex with the lex-pivot rule con-
verges, it is sufficient to prove that the bases do not repeat. Since
the number of different bases is finite, the algorithm must terminate
in finite time. In order to show that the bases do not cycle, we will
show that with each pivoting operation, the o th row, i.e., the row with
reduced costs is monotonically lex-increasing. i.e., If c was the row
of reduced costs before the pivot, and c′ is the row of reduced costs
after the pivot, then c < L c′ .
We show this as follows. First, if at the start of the pivot operation,
each row is lex-positive, then this property holds after the pivot step.
Suppose at a pivot step, the entering variable is x j and the exiting
variable chosen by the lex-pivot rule is xi . To obtain the new tableau,
we do the following. For each row k ̸= i, we apply the following.
( B −1 A j ) k
Multiply row i by ( B −1 A j ) i
Subtract from row k
• Bland’s Rule: To avoid cycling, this rule selects variables with the
smallest indices. Avis and Chvátal 2 proved this requires exponen- 2
D. Avis and V. Chvátal. Notes on
tial time (2d/2 steps) on specific examples. bland’s pivoting rule. Mathematical
Programming Study, 8:24–34, 1978
• Steepest-Edge: This rule, efficient in practice, moves in the di-
rection closest to the gradient. Goldfarb and Sit 3 showed it also 3
D. Goldfarb and W. Y. Sit. Worst case
suffers from exponential worst-case complexity. behavior of the steepest edge simplex
method. Discrete Applied Mathematics,
1(4):277–285, 1979
• Lexicographic Rule: Designed to resolve degeneracy and prevent
cycling, this rule maintains a lexicographically positive order of
tableau rows. Despite this guarantee, it does not escape exponen-
tial behavior on Klee-Minty style cubes.
Kalai’s Algorithm
In 1992, Gil Kalai proposed a randomized algorithm that selects
entering variables based on a random permutation of the facets.
√
• Complexity: Kalai proved an expected time bound of eO( d log n) ,
where d is the dimension and n is the number of constraints 4 . 4
G. Kalai. A randomized simplex
algorithm with subexponential number
of pivots. In Proceedings of the 24th
Matousek, Sharir, and Welzl (MSW) Annual ACM Symposium on Theory of
Computing (STOC), pages 475–482, 1992
Independently, Matousek, Sharir, and Welzl developed a randomized
algorithm with nearly the same bounds as Kalai’s algorithm
These results represented the first theoretical evidence that the
Simplex algorithm could beat purely exponential bounds, though the
question of a polynomial-time pivot rule (deterministic or random-
ized) remains one of the greatest open problems in optimization.
For over five decades, the conjecture held for all known classes of
polytopes. However, in a landmark result in 2010, **Francisco San-
tos** disproved the Hirsch Conjecture.
• The best known upper bound for the diameter of general poly-
topes is quasi-polynomial, provided by Kalai and Kleitman 6 : 6
G. Kalai and D. J. Kleitman. A quasi-
polynomial bound for the diameter
δ( P) ≤ nlog2 d+1 of graphs of polyhedra. Bulletin of the
American Mathematical Society, 26(2):315–
316, 1992
• If the Polynomial Hirsch Conjecture is true, it leaves open the
possibility that a version of the Simplex algorithm could run in
polynomial time. If the diameter is exponential, then the Simplex
algorithm must be exponential in the worst case regardless of the
pivot rule.
Exercise 13. A meat packing plant produces 480 hams, 400 pork bellies,
and 230 picnic hams every day; each of these products can be sold either
fresh or smoked. The total number of hams, bellies, and picnics that can be
smoked during a normal working day is 420; in addition, up to 250 products
can be smoked on overtime at a higher cost. The net profits are as follows:
Exercise 14. An oil refinery produces four types of raw gasoline: alkylate,
catalytic-cracked, straight-run, and isopentane. Two important characteris-
tics of each gasoline are its performance number PN (indicating antiknock
properties) and its vapor pressure RVP (indicating volatility). These two
characteristics, together with the production levels in barrels per day, are as
follows:
• Blend 2,666 barrels of alkylate and 2,666 barrels of catalytic into 5,332
barrels of Avgas A with [cite: 29]
(5, 332 × 6.45) + (6, 188 × 5.91) + (276 × 4.83) = 572, 296.
The refinery aims for the plan that yields the largest possible profit. For-
mulate as an LP problem in the standard form.
This program, leading to a total net profit of $113,000, is one of many possi-
ble programs. The company’s aim is to maximize the total net profit. Formu-
late as an LP problem (not necessarily in the standard form).
Exercise 16. The bicycle problem involves n people who have to travel a
distance of ten miles, and have one single-seat bicycle at their disposal. [cite:
71] The data are specified by the walking speed w j and the bicycling speed
b j of each person j (j = 1, 2, . . . , n); the task is to minimize the arrival
time of the last person. (Can you solve the case of n = 3 and w1 = 4,
simplex algorithm 25
minimize t
subject to t − x j − x ′j − y j − y′j ≥ 0 ( j = 1, 2, . . . , n)
n n
∑ y j − ∑ y′j ≥ 0
j =1 j =1
w j x j − w j x ′j + b j y j − b j y′j = 10 ( j = 1, 2, . . . , n)
n n
∑ bj y j − ∑ bj y′j ≤ 10
j =1 j =1
x j , x ′j , y j , y′j ≥ 0 ( j = 1, 2, . . . , n)
maximize − x1 + x2
subject to x1 − x2 ≤ 1
x1 + x2 ≤ 6
x1 , x2 ≥ 0
maximize x1 + x2
subject to − 2x1 + x2 ≤ 1
x1 − x2 ≤ 1
x1 , x2 ≥ 0
Exercise 19. For the linear program of Exercise 18 a) How much can the
elements of b = (4, 3, 3) T be changed without changing the optimal basis?
b) How much can the elements of c = (2, 4, 1, 1) T be changed without
changing the optimal basis? c) What happens to the optimal cost for small
changes in b? d) What happens to the optimal cost for small changes in c?
simplex algorithm 26
References