The simplex algorithm. The simplex algorithm is the classical method for solving linear programs. Its running time is not polynomial in the worst case. It does yield insight into linear programs, however, and is often remarkably fast in practice.
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Gaussian elimination begins with a system of linear equalities whose solution is unknown.
2x + y - z = 8 ----- (1)
-3x - y - 2z = -11 ----- (2)
-2x + y + 2z = -3 ----- (3)
Eliminate x in both (2) and (3):
(2) + 3/2(1) (2)
0x + 1/2 y + 1/2 z = 1 ----(2)
(3) + (1) (3)
0x + 2 y + z = 5 ----(3)
(3) - 4 (2) (3)
0x + 0y – z = 1 -----(3)
We have that (upper triangle)
2x + y – z = 8 ----(1)
0x + 1/2 y + 1/2 z = 1 ----(2)
0x + 0y – z = 1 ----(3)
Then, we have z = -1 from (3), y = 3 from (2) and z=-1, and x = 2 from (1) and y=3,z=-1
We first convert the linear program from standard form into slackform.
X4 = 30 – x1 – x2 – 3x3
X5 = 24 – 2x1 – 2x2 – 5x3
X6 = 36 – 4x1 – x2 – 2x3
x1 , x2 ,x3 are called non-basic variables.
Therefore, we have
x1 , x2 ,x3 , x4 , x5 ,x6 >= 0
2. Let the object function be in slack form.
z = 0 + 2x1 – 3x2 + 3x3
as well as the value of object function z.
thebasic solution: set all the (non-basic) variables on the right-hand side to 0and then compute the values of the (basic) variables on the left-hand side.
1.We choose a non-basic variable with positive
coefficient in objective function.
2. We increase the value of this variable to a
limit that will violate any of these constraints.
3. Then the non-basic variable as entering
variable and the basic variable as leaving
variable in this constraint will exchange places. This is pivoting.
increasing the value of x1. As we increase x1, the values of x4, x5, and x6 all decrease.
To rewrite the other constraints with x6 on the right-hand side, we substitute x6 for x1
The linear program described in eq-3 is equivalent to the linear program described in eq-2.
different. If we set zero to non-basic variables
and calculate the values for basic variables and finally find the value for z, we have
(9, 0, 0, 21, 6, 0) and z = (3*9) + (1*0) + (2*0) = 27.
z= 111/4. (27.75)
The only way to increase the value of z
is to increase x2. since it is positive term.
At this point, all coefficients in the objective function are negative. As we shall see later in this chapter, this situation occurs only when we have rewritten the linear program so that the basic solution is an optimal solution.
form with the final solution for x1 , x2 ,x3
= 8, 4, 0, we have that
x4 , x5 ,x6 = 18, 0, 0. That is, only slack
variable x4has big slack.
The coefficients intermediate form and the solution may also be real numbers.
PIVOT(N, B, A, b, c, v, l, e) in which
ale ≠ 0. Let the values returned fromthe call be , and let denote the basic solution after the call. Then
• How do we determine if a linear program is feasible?
• What do we do if the linear program is feasible, but the initial basic solution is not feasible?
• How do we determine if a linear program is unbounded?
• How do we choose the entering and leaving variables?
We therefore assume that we have a procedure INITIALIZE-SIMPLEX(A, b, c) that takes as input a linear program instandard form, that is, an m × n matrix A = (aij), an m-dimensionalvector b = (bi), andan n-dimensionalvector c = (cj).
Sumj=1 to n aij xj - x0 <= bi for i=1,…, m
xj >= 0 for j=0,…,n.
Then, L is feasible iff the optimal objective solution for Lmaxis 0.
negative the coefficients of the objective
function to obtain the maximize form.
replace occurrences of xi with x’I - x’’I, and
add constraints: x’I >= 0 and x’’I >= 0 .
‘>= ‘ and ‘<=‘
the constraint by -1 to obtain a ‘<=‘ form.
In line 1, it calls the procedure INITIALIZESIMPLEX(A, b, c), described above, which either determines that the linear program isinfeasible or returns a slack form for which the basic solution is feasible.
The main part of the algorithm is given in the while loop in lines 2–11. If all the coefficients in the objective function are negative, then the while loop terminates. Otherwise, in line 3, we select a variable xewhose coefficient in the objective function is positive to be the entering variable.
Next, in lines 4–8, we check each constraint, and we pick the one that most severely limits the amount by which we can increase xe without violating any of the non-negativity constraints.
Lines 12–15 compute a solution for the original linear-programming variables
by setting all the nonbasic variables to 0 and each basic variable to bi .
Finally, we can show that the solution returned is optimal.
Lemma 29.2: Given a linear program (A, b, c), suppose that the call to INITIALIZE-SIMPLEX in line 1 ofSIMPLEX returns a slack form for which the basic solution is feasible. Then if SIMPLEX returns a solution in line 16, that solution is a feasible solution to the linear program.
If SIMPLEX returns "unbounded" in line 10, the linear program is unbounded.
At each iteration, SIMPLEX maintains A, b, c, and v in addition to the sets N and B.
Althoughexplicitly maintaining A, b, c, and v is essential for the efficient implementation of the simplex algorithm, it is not strictly necessary.
Before proving this fact, we prove a useful algebraic lemma.
Lemma 29.3: Let I be a set of indices. For each i Є I, let αiand βibe real numbers, and let xibe a real-valued variable. Let γ be any real number. Suppose that for any settings of the xi, we have
Then αi = βifor each i Є I, and γ = 0.
Lemma 29.4: Let (A, b, c) be a linear program in standard form. Given a set B of basic variables, theassociated slack form is uniquely determined.
This phenomenon is called degeneracy
The objective value is changed by the assignment in line 13 of PIVOT.
At this point, our only choice is to pivot with x3 entering and x5 leaving. Since b5 = 0, the objective value of 8 remains unchanged after pivoting:
We say that SIMPLEX cycles if the slack forms at two different iterations are identical, in which case, since SIMPLEX is a deterministic algorithm, it will cycle through the same series of slack forms forever.
Lemma 29.6: If in lines 3 and 8 of SIMPLEX, ties are always broken by choosing the variable with the smallest index, then SIMPLEX must terminate.