Preparing An LP For Solution by The Simplex
Preparing An LP For Solution by The Simplex
An LP is in standard form if all constraints are equality constraints and all variables are
nonnegative. To place an LP in standard form, we do the following:
Step 1 If the ith constraint is a _ constraint, then we convert it to an equality constraint
by adding a slack variable si and the sign restriction si _ 0.
Step 2 If the ith constraint is a _ constraint, then we convert it to an equality constraint
by subtracting an excess variable ei and adding the sign restriction ei _ 0.
Step 3 If the variable xi is unrestricted in sign (urs), replace xi in both the objective function
and constraints by xi_ _ xi_, where xi_ _ 0 and xi_ _ 0.
Suppose that once an LP is placed in standard form, it has m constraints and n variables.
A basic solution to Ax _ b is obtained by setting n _ m variables equal to 0 and solving
for the values of the remaining m variables. Any basic solution in which all variables
are nonnegative is a basic feasible solution (bfs) to the LP.
For any LP, there is a unique extreme point of the LP’s feasible region corresponding to
each bfs. Also, at least one bfs corresponds to each extreme point of the feasible region.
If an LP has an optimal solution, then there is an extreme point that is optimal. Thus,
in searching for an optimal solution to an LP, we may restrict our search to the LP’s basic
feasible solutions.
If the LP is in standard form and a bfs is readily apparent, then the simplex algorithm (for
a max problem) proceeds as follows:
Step 1 If all nonbasic variables have nonnegative coefficients in row 0, then the current
bfs is optimal. If any variables in row 0 have negative coefficients, then choose the variable
with the most negative coefficient in row 0 to enter the basis.
Step 2 For each constraint in which the entering variable has a positive coefficient, compute
the following ratio:
Any constraint attaining the smallest value of this ratio is the winner of the ratio test. Use
EROs to make the entering variable a basic variable in any constraint that wins the ratio
test. Return to step 1.
If the LP (a max problem) is unbounded, then we eventually reach a tableau in which
a nonbasic variable has a negative coefficient in row 0 and a nonpositive coefficient in
each constraint. Otherwise (barring the extremely rare occurrence of cycling), the simplex
algorithm will find an optimal solution to an LP.
If a bfs is not readily apparent, then the Big M method or the two-phase simplex
method must be used to obtain a bfs.
The Two-Phase Method
Step 1 Modify the constraints so that the right-hand side of each constraint is nonnegative.
Step 1_1 Identify each constraint that is now (after step 1) an _ or _ constraint. In step
3, we will add an artificial variable to each of these constraints.
Step 2 Convert each inequality constraint to the standard form.
Step 3 If (after step 1_) constraint i is a _ or _ constraint, then add an artificial variable
ai and the sign restriction ai _ 0.
Right-hand side of constraint
Step 4 For now, ignore the original LP’s objective function. Instead, solve an LP whose
objective function is min w_ _ (sum of all the artificial variables). This is called the Phase
I LP.
Because each ai _ 0, solving the Phase I LP will result in one of the following three
cases:
Case 1 The optimal value of w_ is greater than zero. In this case, the original LP has no
feasible solution.
Case 2 The optimal value of w_ is equal to zero, and no artificial variables are in the optimal
Phase I basis. In this case, drop all columns in the optimal Phase I tableau that correspond
to the artificial variables and combine the original objective function with the
constraints from the optimal Phase I tableau. This yields the Phase II LP. The optimal
solution to the Phase II LP and the original LP are the same.
Case 3 The optimal value of w_ is equal to zero, and at least one artificial variable is in
the optimal Phase I basis. In this case, we can find the optimal solution to the original LP
if, at the end of Phase I, we drop from the optimal Phase I tableau all nonbasic artificial
variables and any variable from the original problem that has a negative coefficient in row
0 of the optimal Phase I tableau.
Unrestricted-in-Sign Variables
If we replace a urs variable xi with xi_ _ xi_, the LP’s optimal solution will have xi_, xi_ or
both xi_ and xi_ equal to zero