Basic feasible solution Created 2026-09-24 Updated 2026-11-05
For a full-row-rank system with rows and variables , choose linearly independent columns as a simplex basis. Set all nonbasic variables to zero and solve . If , the resulting vector is a basic feasible solution. Redundant equality rows can first be removed.
Equivalently, a feasible vector is basic when the columns indexed by its strictly positive coordinates are linearly independent. Those columns can be extended to a basis of the full column space because has row rank . The extension may have zero-valued basic variables; this is degeneracy in linear programming.
For and , the two basic feasible solutions are and . The feasible midpoint is not basic: its two positive columns are dependent. In this standard form, basic feasible solutions are exactly the extreme points of the feasible polyhedron, connecting basis algebra to the Fundamental theorem of linear programming.
Nonbasic variable 2026-10-14
A nonbasic variable corresponds to a column outside the current simplex basis. In standard nonnegative linear programming, it is set to zero at the basic solution. With explicit finite bounds, it is normally fixed at one of its bounds.
Using the standard maximum form of a linear program, write
where , , , and . The inequalities are coordinatewise, and is the objective function. General linear programs can be put in this form: reverse the sign of a minimization objective function, reverse lower-bound linear inequalities, replace an equality by two opposite linear inequalities, and replace each unrestricted variable by the difference of two nonnegative variables. Some conventions instead call the equality-constraint version standard form; the convention here is the maximum-with-upper-bounds convention.
Introduce nonnegative slack variables . The equivalent slack form of a linear program is
The original variables are initially nonbasic and the slack variables basic. More generally, a slack form of a linear program specifies disjoint index sets and writes
Thus each basic variable and the objective function are expressed using only nonbasic variables. Setting all nonbasic variables to zero gives the associated basic solution, which is a feasible solution exactly when the resulting basic values are nonnegative. The slack form of a linear program does not itself require that initial basic solution to be feasible.
Introduce slack variables . The initial simplex dictionary is
All six variables are nonnegative. The given rule is the Dantzig pivot rule: select the nonbasic variable with the largest positive reduced cost. It applies to slack variables too once they become nonbasic. At each step the simplex ratio test limits how far that entering variable can increase before a basic variable reaches zero.
The successive objective rows of the simplex dictionary, expressed in the current nonbasic variables, are
These rows identify each entering variable unambiguously. Performing the corresponding simplex ratio tests gives the complete pivot sequence:
For example, after pivot two the dictionary has , and . Although increasing improves the objective at rate four, reaches zero first at , giving pivot three. After pivot four, and ; the upper bound gives pivot five.
In the final objective row every reduced cost is nonpositive. Since , it also directly certifies the upper bound , attained only when all three vanish. Thus
A greatest improvement pivot rule uses the total feasible increase in the objective, rather than its increase per unit of the entering variable. At the origin, the three candidate edge moves have improvements , and . It therefore brings into the simplex basis first, with leaving, and immediately reaches the optimum. This rule solves this instance in one pivot.
This is a three-dimensional Klee-Minty cube example: the specified Dantzig pivot rule visits every vertex before reaching the optimum. Higher-dimensional versions require pivots, so that rule has exponential worst-case running time despite its strong practical performance. Each pivot requires only polynomially many arithmetic operations. An anti-cycling rule such as the Bland pivoting rule ensures finite termination; without one, degenerate pivots can cycle. A crude terminating bound is the number of possible bases, for constraints and original variables, which can be exponential. This does not show that every conceivable pivot rule must take exponential time. Linear programming itself has polynomial-time algorithms, including the ellipsoid method and suitable interior-point methods.
Simplex algorithm Created 2026-09-24 Updated 2026-11-05
The simplex algorithm solves a linear program by moving among basic feasible solutions. For subject to , , a basis selects enough columns of to solve for the basic variables. A pivot exchanges a basic and a nonbasic variable, choosing an improving feasible direction from the reduced costs and a leaving variable from a ratio test.
For with , , , one improving vertex path is , ending at value ten. Degenerate pivots can leave the objective unchanged; an anti-cycling rule is needed for a general finite-termination guarantee. Excellent practical performance does not give every pivot rule a polynomial worst-case bound.
Simplex method Created 2026-09-24 Updated 2026-11-05
The simplex method solves a standard-form linear program by changing a simplex basis. A feasible basis expresses basic coordinates and the objective in terms of nonnegative nonbasic variables. An improving reduced cost selects a candidate entering variable, and the simplex ratio test chooses the largest step preserving nonnegative basic coordinates.
If this step is positive, the objective improves along an edge. Under degeneracy in linear programming, the step can be zero: the basis changes while the basic feasible solution and objective remain fixed. A negative reduced cost alone therefore does not promise strict improvement in that pivot. If the improving direction has no finite ratio limit, it gives an unbounded feasible ray.
When all reduced costs have the optimal sign, the simplex optimality criterion proves global optimality. Two-phase simplex supplies an initial feasible basis or an infeasibility certificate. A rule such as the Bland pivoting rule prevents cycling; arbitrary improving pivot choices need not terminate, and even terminating rules can require exponentially many steps on a Klee-Minty cube.
An equality representation of a linear program in which each basic variable and the objective function are expressed using nonbasic variables, and all variables are nonnegative. Introducing slack variables into gives . Setting the nonbasic variables to zero yields its basic solution; nonnegative resulting basic values make this a basic feasible solution. A simplex algorithm pivot exchanges a basic and nonbasic index and rewrites these expressions.