# Linear Programming (LP

)
Linear programming can be defined as the planning of activities represented by a linear mathematical model. – – Hence, in a linear programming problem, the objective and the constraints are all linear. Given this assumption of linearity, LP is used to find the best mix of activities. Applying Linear Programming to Those Investments in Which The Simplifying Assumptions of Basic LP Analysis Do Not Hold.

Simple Application of L. P.
Linear Programming was applied to those investments satisfying the following assumptions: 1. 2. 3. Additivity within activities: resource consumption is constant per unit of Divisibility within activities: partial investments can be implemented. Independence of activities: there is no recognition of productive or output; there are no economies of scale. There is no requirement to accept equipment in discrete sizes. financial interdependencies.

Extensions to the Basic Application of L.P.
These extensions include: 1. Allowing more activities and constraints : This notion deals with more complex resource mixes, and more constraints, or combinations of projects. 2. Recognizing indivisible investments: Most projects are not physically divisible. For example, power stations are not divisible, although they can vary in size as to scale. 3. Allowing inter-year resource borrowings and transfers : Capital and supplies may become available at different times, or surplus amounts may be able to be transferred between years.

4. Recognizing interdependent projects : Projects may provide mutual support and resources, or infrastructure to each other. 5. Treating mutually exclusive investments : A casino built on a site will preclude the construction of an hotel or sporting facility. Only one of these projects can appear in the LP solution. 6. Recognizing threshold investments, economies of scale, multiple goals and investment risk.

Other LP Applications :
1. 2. 3. 4. Threshold investment levels – the threshold level is set up as a binary Economies of Scale – particular scale levels are set up as independent Multiple Goals - each goal is set up as a constraint goal, or each goal Risk Analysis – risky alternatives could be constrained in the product constraint. activities with binary constraints. can be individually weighted in a total goal measure. mix; or an overall risk measure such as ‘variance could be targeted and minimized.

Linear Programming Models : Standard form of the model: sometimes referred to as the canonical form:
Maximize z =
n

∑c x
j =1 j ij j

n

j

(1) i = 1,…,m j = 1,…,n (2) (3)

subject to

∑a x
j =1

= bi ,

xj ≥ 0, 1. All RHS parameters bi ≥ 0 and n > m.

2. Use the n-dimensional vector x to represent the decision variables; i.e., x = (x1, …,xn). 3. Might have simple upper bounds, say, xj ≤ uj. 4. Convert inequalities to equalities in (2).

5. Vector form of constraint: ai1x1 + • • • + ainxn = bi ; aix = bi ; Ax = b Maximize {z = cx : Ax = b, x ≥ 0} Definition 1: Let P be a polyhedron in n-dimensional space, written P ⊂ ℜn. A vector x  P is an extreme point of P is we cannot find two vectors y, z  P, both different from x, and a scalar    [0, 1], such that x = y + (1 – )z. x • P • • • u Figure 1. Some points in a polyhedron Definition 2: Let a be a nonzero row vector in n-dimensional space, written a  ℜn, and let b be a scalar. (a) The set {x  ℜn : ax = b} is called a hyperplane. (b) The set {x  ℜn : ax ≥ b} is called a halfspace. Note that a hyperplane is the boundary of a corresponding halfspace. hyperplanes. Preparing the Model For a w v z •

y •

polyhedron in n-dimensional space, an extreme point is the intersection of n – 1

   

The objective must be to maximize The objective function must be linear in the variables and not contain any constant terms All variables must be restricted to be nonnegative Each constraint must be written as a linear equation with the variables on the left of the equality sign and a positive constant on the right

1. Minimize {c1x1 + c2x2 + … + cnxn}  Maximize {–c1x1 – c2x2 – … – cnxn} 2. Constant term in objective function ⇒ ignore 3. Nonzero lower bounds on variables: xj > lj ⇒ xj = j + lj where j > 0

y ≥ 0. At this point. si ≥ 0. where x ≥ 0 and x ≥ 0. x ≥ 0. 5.4.…. Unrestricted variables: xj = x – x. y = –10.…. + + − Maximize z = − x − y + 2x subject to x + + y + − 2x − + s1 − x − y + 2x + + − = 20 + s2 + s3 = 20 = 20 + s4 = 20 x+ – y+ − x+ + y+ x ≥ 0.4 Convert the objective to maximization by multiplying its coefficients by –1. s3 = 20. Feasible region for transformation example Make the substitutions: x = x+ – x– and y = y+ – x–. s1 = 40. y+ ≥ 0. Multiply both sides of the second and fourth constraint by –1. bi < 0: multiple by –1 Example y Minimize z = x + y subject to x + y ≤ 20 x + y ≥ –20 x – y ≤ 20 x – y ≥ –20 x and y unrestricted 20 10 -20 -10 -10 10 20 x -20 Figure 2. si ≥ 0. Any point on the line x + y = –20 yields the objective value z = –20. s4 = 20.4 + + – Solution: x– = 10. i = 1. Constraints not in correct form. y+ ≥ 0 and x– > 0. i = 1. with x+ ≥ 0. x– ≥ 0. z = – 20 Note that this problem has alternate optima. Geometric Properties of Linear Programs . z = 20 ⇒ x = –10. the model is Minimize subject to z = x + + y + − 2x − x + + y + − 2x − + s1 x + y − 2x + + − = 20 – s2 + s3 = –20 = 20 – s4 = –20 x+ – y+ x+ – y+ x+ ≥ 0.

We say that these vectors are linearly independent if it is not possible to find k real numbers 1. 2. the linear system Ax = b has a unique solution. For this system to have a unique solution.Linear Independence: Let us consider a system of m linear equations in m unknowns: a11x1 + a12x2 + • • • + a1mxm = b1 a21x1 + a22x2 + • • • + a2mxm = b2 M am1x1 + am2x2 + • • • + ammxm = bm 1. the matrix A must be invertible or nonsingular. The simplex algorithm is based on this approach. By putting x = (xB. Basic Solutions: Let the matrix B = (A1. d. Using vector notation. that is.…. The following statements are equivalent. Definition 3: Let A1.….A2. 3. where I is the m  m identity 4. 2.k not all zero such that  jAj = 0. where A is an m  m matrix and b is an mdimensional column vector.Ak be a collection of k column vectors. each of dimension m. It is denoted by A–1. This leads to the following definition. b. they are called linearly dependent. Equivalent definition Theorem 1: Let A be a square matrix.…. otherwise. we obtain a solution to Ax = b. Assuming that A–1 exists. For every vector b. Matrix D is called the inverse of A and is unique. The determinant of A is nonzero. c. Then we can uniquely solve the equations BxB = b for the m-dimensional vector xB = (x1.xm). Must exist another m  m matrix D such that AD = DA = I. where 0 is the kdimensional null vector.…. by setting the first m components of x to those of xB and the remaining n – m components to zero. a. . The rows and columns of A are linearly independent. a popular approach to solving the system Ax = b and thus obtaining the unique solution x = A–1b is Gauss-Jordan elimination. The matrix A is invertible as is its transpose AT. Ax = b. 0).Am) be nonsingular.

The components of x associated with columns of B are called basic variables. the solution to the resulting set of equations is said to be a basic solution to (2) with respect to the basis B. x4. a feasible solution that is also basic is said to be a basic feasible solution (BFS). it is called a degenerate basic feasible solution. If this solution is degenerate. If all the n – m components of x not associated with columns of B are set equal to zero. Foundations: We establish the relationship between optimality and basic feasible solutions in the fundamental theorem of linear programming. Definition 5: A degenerate basic solution is said to occur if one or more of the basic variables in a basic solution has value zero. The results tell us that when seeking a solution to an LP it is only necessary to consider basic feasible solutions. x5 have been added to the 3 constraints. there is a basic feasible solution. n Definition 6: A vector x  S = {x ℜ : Ax = b. let B be any nonsingular m  m matrix made up of columns of A. there is an optimal basic feasible solution. Example: Consider following linear program in standard form where slacks x3. x ≥ 0} is said to be feasible to the  linear programming problem in standard form. (i) if there is a feasible solution. = (4) .Definition 4: Given a set of m simultaneous linear equations (2) in n unknowns. Theorem 2: Given a linear program in standard form (1) – (3) where A is an m  n matrix of rank m. Number of bases: Many not feasible. (ii) if there is an optimal feasible solution.

A basic solution is found by selecting three variables as basic. let’s try x1. x2 = 5 and x3 = 20. x4 ≥ 0. with the remaining n – m = 2 as nonbasic. For instance. For the example. It is identified on Fig. and x4 and x5 as nonbasic. x2 ≥ 0. Geometry of example in (x1. This is evidently a BFS since all the variables are positive. x2 25 20 #9 = 5 + x4 = 35 + x5 = 20 (C1) (C2) (C3) C1 C3 15 #3 10 #10 #2 #1 0 5 10 15 #7 20 25 30 #8 z = 55 5 #5 -5 C2 #6 35 40 x1 Figure 3. Setting the nonbasic variables to zero.x2)-space • Problem size: n = 5 variables and m = 3 constraints. x5 ≥ 0 Each slack variable can be viewed as the distance from any point in the shadowed polyhedron to the constraint associated with that variable.Maximize z = 2x1 + 3x2 subject to –x1 + x2 + x3 x1 + 3x2 x1 x1 ≥ 0. x2 and x3 as basic. 3 as extreme point #10. the upper bound on the number of basic solutions is = = 10. . we obtain the equations – x1 + x2 x1 + 3x2 x1 + x3 = 5 = 35 = 20 which are easily solved to obtain x1 = 20. x3 ≥ 0.

Theorem 4: For a linear program in standard form (1) – (3). As the algorithm progresses.–6.4) (3.–60.5) (2.20) (1.5) (0.7.0) (5. otherwise go to Step 3.20.5. Define zl ≡ z(xl).20) No solution (–5.10) (20. Basic solutions to example Basic Point #1 #2 #3 #4 #5 #6 #7 #8 #9 #10 • Theorem 3: For any linear program. If zl ≥ zk for all k  E(l) then xl is an optimal BFS.5) (2.20.7.0.2.3) (2.0.0.25.3.0.0.x5) s (1.4) (1.5) (2. two basic feasible solutions are said to be adjacent if they have m – 1 basic variables in common.5) (3.4) (1.40.0.4) (1. variable s (3.2.5.5) (1. the most recent BFS will be called the incumbent. there is at least one BFS corresponding to each extreme point in S.0. Outline of Simplex Algorithm (max problem) Step 1 Find an initial BFS to the linear program. stop. let xl be a BFS and let E(l) be the index set of all BFSs adjacent to xl.10.3.4) (2. In addition.5.0.0) Feasibility Objective (yes.5) (1. Step 3 Move to an adjacent BFS that has a larger z value and return to Step 2 using the new BFS as the incumbent.3.4.35.20) (0.2.2) (0.4.4) (1. If so.0.3) (1.Table 1. x ≥ 0} corresponding to a BFS.–15) (20. Step 2 Determine if the incumbent is optimal.40. (First part obvious from example.0.5) (1.25.5) (2.….15.0.11.0) (20. no) Yes Yes No –– No No Yes Yes No Yes value 0 15 –– –– –– –– 40 40 –– 55 .5) (4.0.3.4.25) (35. not so for second part) Definition 7: For a linear program in standard form with m constraints.3) Nonbasi Solution c variable (x1. there is a unique extreme point in the feasible n region S = {xℜ : Ax = b.

the solution z = 0. x4. x5 = 20 is easily determined by observation. x4 and x5. x3.Simplex Tableau Previous model in slightly modified form → Simplex Form: Maximize z (E0) (E1) (E2) (E3) xj ≥ 0. x3) = (0. x4 = 35. it has the coefficient 1. x5) = (0. x4 and x5. x2. x4. 20) and z = 0 is still a solution to the new system. (x2. the equations are again in the simplex form where we identify the basic variables as x1. z = –10. Each equation includes only one basic variable. x5) = (–5. In the equation where the basic variable does appear. 35. 0.…. 5. The basic solution is thus (x1. x3 = 5. z appears only in (E0) with the coefficient 1. 0). 40. which is evidently infeasible because x1 < 0. Note that (x1. When x1 = x2 = 0.5 Conditions for the Simplex Form • • • • Every basic variable appears with a nonzero coefficient in one and only one equation and does not appear in (E0). 25). New system after algebraic manipulation (elementary row operations): (E0') = (E0) + 2(E1') (E1') = –(E1) (E2') = (E2) – (E1') (E3') = (E3) – (E1') z – 5x2– 2x3 x1 – x2 – x3 4x2 + x3 + x4 x2 + x3 = –10 = = + x5 = –5 40 25 These equations are entirely equivalent to the original set in that they have the same set of solutions. . z – 2x1 – 3x2 –x1 + x2 + x3 x1 + 3x2 x1 + x4 =0 =5 = 35 + x5 = 20 The above example happens to be in the simplex form if we identify the basic variables as x3. By design. j = 1.

as illustrated in Table 2 for the example problem. Algebraic Model (E0) (E1) (E2) (E3) z – 2x1 – 3x2 –x1 + x2 + x3 x1 + 3x2 x1 + x4 = = 0 5 = 35 + x5 = 20 .n. Tableau Description of Equations To organize the computations. it is common to convert the algebraic model to a tableau. The general form of the model is (E0) z + n They are the unit costs relative to the current set of nonbasic variables in the reduced model in which the ∑c x j =1 n j j =1 ij j = (Ei) xB(i) + ∑a x j = i. j indicate that these values are not in general the same as those in the original model (1) – (3). We use j in equation (E0) to denote the current value of the jth objective function coefficient. i.…. For minimization objective  values are known as reduced costs or relative costs.m and j = 1. i = 1.m The “bars” on the coefficients ij.….…. basic variables are fixed.General Simplex Form During the simplex computations. for i = 1. we will use ij to denote the current coefficient of xj in equation i.

. .…. xB(m) Coefficients z x1 1 0 . Similarly. Thus the marginal effects of increasing xk can be described by the following partial derivatives. m Basic z xB(1) . It is assumed that m variables have been singled out as basic. = – k and = – ik for i = 1. when xk increases by one unit. . . . z will increase by – k units). the equations in the simplex form are (E0) (Ei) z + kxk = xB(i) + ikxk = i.m (6) . . i = 1. . m RHS Interpretation of the Coefficients Written in terms of the basic variables and xk. .…. .m When xk increases by one unit. m2 … … … … … xn n 1n . . E(0) – E(3) Coefficients Row 0 1 2 3 Basic z 1 0 0 0 z x3 x4 x5 x1 –2 –1 1 1 x2 –3 1 3 0 x3 0 1 0 0 x4 0 0 1 0 x5 0 0 0 1 RHS 0 5 35 20 The tableau in Table 4 gives the general form for a problem with n variables and m constraints. . the value of z must decrease by k units (of course.Table 2. when k < 0. 0 1 11 . . . . m1 x2 2 12 . Tableau form of example problem. the value of xB(i) must decrease by ik. mn 1 . Table 4. General form of tableau Row 0 1 .

For x5 active.m? Is the feasible basic solution optimal? The objective function equation for the example is (E0) z – 2x1 – 3x2 = 0 For the current BFS. we have z = 0 + 2x1. when the basic variables are x3. Solution from tableau: x = (0. so decreasing either causes the solution to become infeasible. We therefore restrict attention to increases. where Q is the set of nonbasic variables.…. For x2 active.…. we have z = 0 + 3x2 . the equations are written as (E0) (Ei) z + xB(i) + = = i. 5. xB(i) = i for i = 1.…. x4 and x5.  Is the basic solution feasible? i ≥ 0 for i = 1. 0. Information from the Simplex Form Each row in Table 4 can be written as: xB(i) = i – jQ ijxj. x4).Referring to the example problem. and xj = 0 for j Q. When one of the nonbasic variables is held at zero.m. From the general expression of the simplex form we read the objective function value and the values of the basic variables as z = . both x1 and x2 are zero. 35. as given in Table 2. Table 5 gives the equations for the example in terms of the basic variables (x1. B(3) = 5. In general terms. 0) with z = 0. the coefficients in the column for the nonbasic variable x2 indicate the following effects when x2 is increased by one unit: z will increase by 3 x3 will decrease by 1 x4 will decrease by 3 x5 will not change. x3. i = 1. B(2) = 4.m For the example B(1) = 3. only z and the other nonbasic variable play a role in (E0).

20) Solution  #2... We wish to increase x1 and x2 because we want to maximize the objective function. when x1 is held at 0. Reason: most increase per unit (We can choose x1 as well. there is no finite optimum so the solution is said to be unbounded. How can a nonoptimal feasible solution be improved? In the general case. How much should the nonbasic variable be changed? • • • Let us choose x2 at this time. m   aij    It is possible that no positive value of ij exists for some nonbasic variable xk such that k < 0. This implies that xk and z can be increased indefinitely without the solution becoming infeasible.) From the example.. 5. An Adjacent . Let us what is the new solution: (0. When this occurs. i = 1.. 0. Minimum ratio test b     = minimum  i : aij > 0. x3 –> 0 which determines how much the nonbasic variable x2 can change. Optimality conditions: j ≥ 0 for all j Q Condition easily tested by examining equation (E0) in the simplex form or row 0 of the tableau. all nonbasic variables xj with j < 0 are candidates to become basic. we have x3 = 5 – x2 x4 = 35 – 2x2 x5 = 20 • As x2 –> 5. 20.

Original and subsequent tableaus Coefficients z x1 1 -2 0 -1 0 1 0 1 x2 -3 1 3 0 x3 0 1 0 0 x4 0 0 1 0 x5 0 0 0 1 Row 0 1 2 3 Basic z x3 x4 x5 RHS 0 5 35 20 Divide row 1 by 1 to obtain a new row 2. x5. Table 6. and so are all other rows Multiply the new row 1 by +3 and add it to row 0. • For the example. x1). The coefficient of a basic variable should be 1. .x5). 5. Now make sure the coefficient on row E0 is 0. to go to zero. When x2 is selected to increase.  change BFSs  pivot operation  move from one BFS to an adjacent BFS. causing the basic variable for the second row.x4. to obtain: Coefficients z x1 1 0 0 -1 0 4 0 1 Row 0 1 2 3 Basic z x2 x4 x5 x2 0 1 0 0 x3 3 1 -3 0 x4 0 0 1 0 x5 0 0 0 0 RHS 15 5 20 20 The third tableau in Table 6 is in the simplex form for the basic variables (x3. 0. 20) with z =15. x3. Multiply the new row 1 by -3 and add it to row 2. one (or more) of the basic variables goes to zero.How is a new simplex form obtained? When a nonbasic variable is increased by the value . The maximum increase for x5 is computed to be 5. The BFS is easily seen to be x = (0. we discover that the pivot row is 2. 20. the basic set identified in Table 5 is (x3.

We observe from row 0 that the solution is still not optimal. (i) divide row r by the pivot element rk. multiply the new row r by –ik and add it to row i.m. Now. Pivot operations: Let the variable entering the basis be xk and let the pivot row be r. i ≠ r). the objective value has improved by – 5 ×  = –3 × 5 = 15 to a value of 15. .As expected. (ii) for each row i. (i = 0.….

stop with the optimal solution. For row r (divide pivot row by pivot element) = / rs and = / rs For row i = 0. Let that variable be the entering variable and call the corresponding column of the tableau the pivot column. Step 2 (Iteration k) . Find the variable that must leave the basis. Let xs become the basic variable for row r and call rs the pivot element. Find the nonbasic variable that has the most negative reduced cost in row 0 (we are using the steepest ascent rule here). Transform the equations into the simplex form. Let be the vector of coefficients for the ith row in the new tableau with right-hand-side . b.….1. Let be the vector of coefficients for the ith row in the current tableau with right-hand-side . Compute the ratios between the right-hand-side i and the positive elements of the pivot column is > 0. c. a. Create a new tableau by performing the following operations. Find the row with the minimum ratio and call it the pivot row. Change the basis. Let the index of the entering variable be s. stop with the optimal solution. If row 0 has all nonnegative coefficients. Choose a subset of the variables that yields a BFS. Let the index of the pivot row be r. Otherwise return to Step 2.m and i ≠ r (multiply the new pivot row by the negative of the ith coefficient in the pivot column and add the result to row i) = (– × ) + and = (– × ) + Step 3 (Optimality test) If all reduced costs in row 0 are nonnegative.Simplex Method Using Tableaus Primal Simplex Algorithm Step 1 (Initialization) Express the linear program in the equation form. Select a variable to enter the basis. Create the first tableau using the coefficients from these equations.

Using the most negative rule. we show them in a column to the right of the tableau as in Table 8. we choose x2 as the entering variable (s = 2). Using the prescribed linear operations the new tableau appears in Table 9. This is a direct result of the original model having all (≤) constraints and positive constants on the right-hand side. Choosing the slacks x3. Initial tableau for simplex example Coefficients Row 0 1 2 3 Basic RHS 0 5 35 20 z 1 0 0 0 z x3 x4 x5 x1 -2 -1 1 1 x2 -3 1 3 0 x3 0 1 0 0 x4 0 0 1 0 x5 0 0 0 1 Step 1 (Initialization) Note that the initial tableau is in the simplex form. x4. In cases such as this. The tableau in Table 2 is repeated in Table 7 with slacks x3. We compute the ratios i / is for positive is. x4 and x5. The value of the pivot element 12 is 1. For convenience. . Step 3 (Optimality test) One of the reduced costs is negative so we return to Step 2. Iteration 1 Step 2 (Iterate .Example We will use as an example the problem considered in Section 3. Thus the initialization step is accomplished for the example.4. The index of the pivot row is r = 1. From row 0 we see that the solution is not optimal.update tableau) a b. the slack variables will always define a BFS and provide a convenient starting basis for the simplex method. x5 as the basic variables gives a BFS. c. Table 7.

Table 9 shows the results of iteration 1 and the selections for iteration 2.Table 8. Tableau after iteration 1 Coefficients Row 0 1 2 3 Basic z 1 0 0 0 z x2 x4 x5 x1 -5 -1 4 1 x2 0 1 0 0 x3 3 1 -3 0 x4 0 0 1 0 x5 0 0 0 1 RHS Ratio 15 --5 --20 5 20 20 To economize on tables. we show both the results of the current iteration and the selection of the entering and leaving variables for the next iteration in the same tableau. Iteration 2 Step 2 (Iterate .67 20 --- Table 9. Using the prescribed linear operations the new tableau appears in Table 10. Step 3 (Optimality test) One of the coefficients in row 0 is still negative so we return to Step 2. c. Only x1 has a negative coefficient in row 0 so it is selected to enter the basis (s = 1). Tableau with ratios computed Coefficients Row 0 1 2 3 Basic z 1 0 0 0 z x3 x4 x5 x1 -2 -1 1 1 x2 -3 1 3 0 x3 0 1 0 0 x4 0 0 1 0 x5 0 0 0 1 RHS Ratio 0 --5 5 35 11. For example. . b.update tableau) a. From the ratios we discover the pivot row is r = 2 and the pivot element 21 = 4.

75 0.25 0.Table 10.update tableau) a.33 1. 33 = 0.25 RHS Ratio 40 --10 40 5 --15 20 Step 2 (Iterate .75 1.75.75 -0.333 -0.25 0. Step 3 (Optimality test) All reduced costs are nonnegative so the current solution is optimal. Using the prescribed linear operations the new tableau is given in Table 11.333 RHS Ratio 55 --5 --20 --20 --- .25 0.25 -0. Tableau after iteration 2 Coefficients Row 0 1 2 3 Basic z 1 0 0 0 z x2 x1 x1 0 0 1 0 x2 0 1 0 0 x3 x4 x5 0 0 0 1 x5 Iteration 3 -0. Final tableau Coefficients Row 0 1 2 3 Basic z 1 0 0 0 z x2 x1 x3 x1 0 0 1 0 x2 0 1 0 0 x3 x4 x5 0 1 1 0 0. Now x3 has a negative coefficient in row 0 so we select it to enter the basis (s = 3). c. Table 11. b. From the ratio test we discover the pivot row is r = 3 and the pivot element.33 0 0 1 1 -0.

Special Situations Tie for the Entering Variable: Arbitrarily select one (the first). Initial tableau for degeneracy example Coefficients Row 0 1 2 3 Basic z 1 0 0 0 z x3 x4 x5 x1 -3 -1 1 1 x2 -4 1 3 0 x3 0 1 0 0 x4 0 0 1 0 x5 0 0 0 1 RHS Ratio 0 --5 5 15 5 20 --- After pivoting to obtain the tableau in Table 13 at iteration 1. the degenerate row.75). x4. The next solution. thus row 2 is the pivot row and x4 leaves the basis. x5) = (0. and there is no tie in the minimum ratio. 20 ) Now we must select x1 to enter the basis. x2. Tie for the Leaving Variable: this will lead to a degenerate BFS. Iteration 1 Coefficients Row 0 1 2 3 Basic z 1 0 0 0 z x2 x4 x5 x1 -7 -1 4 1 x2 0 1 0 0 x3 4 1 -3 0 x4 0 0 1 0 x5 0 0 0 1 RHS Ratio 20 --5 --0 0 20 20 Pivoting we obtain the tableau in Table 14 at iteration 2. is negative (–0. (x1. in three dimensions. The ratio is minimum in the degenerate row. Table 12. n Definition 8: A basic solution x ℜ is said to be degenerate if the number of  structural constraints and nonnegativity conditions active at x is greater than n. 0. we note that a degenerate solution has been realized due to the tie in the ratio test. In two dimensions. a degenerate basic solution occurs at the intersection of three or more lines. x3. 5. 0. is not degenerate because the coefficient of x3 in row 2. The entering variable is x3. in Table 15. a degenerate solution is at the intersection of four or more hyperplanes. The solution is the same but the basis has changed. . Table 13.

cycling can be eliminated by modifying the rules used to select the entering and leaving variables. Nevertheless.…. The rules are based on the indices of the problem variables. but if there is a tie in the ratio test.n) and are due to Bland (1977).…. Rule for selecting the entering variable: From all the variables having negative coefficients in row 0.Table 14.….25 0.67 Table 15.x are optimal BFSs. • Unbounded solution: = 1. 1 s If x .75 0. then so is where =. the possibility arises that the simplex algorithm will return to a previously encountered basis.75 x4 1. Rule for selecting the leaving variable: Use the standard ratio test to select the leaving variable.25 0. Optimal solution Coefficients Row 0 1 2 3 Basic z 1 0 0 0 z x3 x1 x5 x1 0 0 1 0 x2 5 4 3 -3 x3 0 1 0 0 x4 3 1 1 -1 x5 0 0 0 1 RHS 45 20 15 5 Cycling: When degeneracy occurs. select from the tied rows the variable having the smallest index.s . Iteration 2 Coefficients Row 0 1 2 3 Basic z 1 0 0 0 z x2 x1 x5 x1 0 0 1 0 x2 0 1 0 0 x3 -1.25 -0. • • Alternative optima: If the optimal tableau shows one or more nonbasic variables with zero coefficients in row 0.25 x5 0 0 0 1 RHS Ratio 20 --5 20 0 --20 26. xj (j = 1. there are alternative optimal solutions.75 0.25 -0. k = 1. select the one with the smallest index to enter the basis. k ≥ 0.

5 An unbounded solution is probably the result of a poorly specified model. 2 ≥ 0 We now have a BFS composed of artificial variables. the tableau in Table 18 is obtained.5 x4 0 0 1 0 x5 -3 0 -2 -0. Maximize z = –7x1+ 3x2 subject to 4x1 + 8x2 = 30 –2x1 + x2 ≥ 3 x1 ≥ 0. • 3. x3 ≥ 0. Variable x5 is slated to enter the basis but it is not possible to perform the ratio test.Maximize subject to z= 6x1+ 3x2 x2 ≤ 5 –4x1 + 3x2 ≤ 15 2x1 – 3x2 ≥ 2 x1 ≥ 0. 1 ≥ 0. • .8 The Initial BFS Add artificial variables: For constraint i the variables will be called i. Example of unboundedness Coefficients Row 0 1 2 3 Basic RHS 66 5 34 8. Table 18.5 Ratio --------- z 1 0 0 0 z x2 x4 x1 x1 0 0 0 1 x2 0 1 0 0 x3 12 1 3 1. x2 ≥ 0 The equality form of the constraints with slacks and artificial variables added is 4x1+ 8x2 + 1 + 2 = = 30 3 –2x1+ x2– x3 x1 ≥ 0. x2 ≥ 0 After several iterations. x2 ≥ 0.

x3 ≥ 0. the constraints for which they are basic are redundant and can be deleted. Let F be the set of constraints that have artificial variables. Example Phase 1: Maximize w = Phase 2: Maximize z =–7x1+ 3x2 subject to 4x1 + 8x2 – 2x1 + x2 – x3 + 1 = 30 – 1–  2 + 2 = 3 x1 ≥ 0. x j ≥ 0. 2 ≥ 0 In constructing the tableau in Table 19. m. To price out these coefficients we subtract row 1 and row 2 from row 0' with the result shown in row 0 which is now used for the Phase 1 computations..α i ≥ 0. Phase 1: Solve n  w = ∑ α i : ∑ aij x j + α i = bi . .. i = 1. x2 ≥ 0. we introduce row 0' for the phase 1 objective. use the simplex method to solve the original problem to optimality. 1 ≥ 0.Algorithm for the Two-Phase Method Initial step: Put the problem into equality form adding slack and artificial variables has necessary.. Phase 2: Delete the artificial variables from the problem and revert to the original objective function Maximize z = ∑ c j x j j =1 n Starting from the BFS obtained at the termination of phase 1.∀i. Minimize j =1  i∈F  j  where  i is present in constraint i only if i  F.. If some artificial variables remain in the basis at a zero level. Row 0' is not in the simplex form because the coefficients of the basic variables 1 and 2 are not zero.

Optimal solution for phase 1 Coefficients Row 0 1 2 Basic w 1 0 0 x1 0 1 0 x2 0 0 1 x3 0 0.4 -0.3. x3) = (0. .6 --- Phase 2 is initiated with the basic solution (x1.3 --3.2 w x1 x2 RHS Ratio 0 --0.4 0.6. x2. 0) found in phase 1.3 3 --- Table 21.2 α1 1 0. Again we find that the tableau is not in the simplex form so we price out the nonzero coefficients in the columns for the basic variables. 3.Table 19. As shown in Table 22. we put the phase 2 objective function in row 0'. The result is labeled row 0.1 α2 1 -0. Initial tableau for phase 1 Coefficients Row 0' 0 1 2 Basic w 1 1 0 0 x1 0 -2 4 -2 x2 0 -9 8 1 x3 0 1 0 -1 α1 1 0 1 0 α2 1 0 0 1 w w α1 α2 RHS Ratio 0 -33 --30 3. Iteration 1 Coefficients Row 0 1 2 Basic w 1 0 0 x1 -20 20 -2 x2 0 0 1 x3 -8 8 -1 α1 0 1 0 α2 9 -8 1 w α1 x2 RHS Ratio -6 --6 0.05 0.75 3 3 Table 20.

i. Find a row.6 Ratio -0. the solution is primal feasible. r < 0.3 3. Initial solution for phase 2 Coefficients x1 x2 7 –3 0 0 1 0 0 1 Row 0' 0 1 2 Basic z z x1 x2 z 1 1 0 0 x3 0 –3.. r = min{i : i = 1. • Step 1 (Initialization) Start with a dual feasible basis and let k = 1. If the right-hand side entries are all nonnegative. Let row r be the pivot row and let the leaving variable be xB(r). For each negative coefficient in the pivot row. with a negative right-hand-side constant.….75 --- • Dual Simplex Algorithm It is particularly useful for reoptimizing a problem after a The dual simplex algorithm is most suited for problems where an initial dual feasible solution available. compute the negative of the ratio between the . Select the leaving variable.75 -- Table 23. Create a tableau for this basis in the simplex form. constraint has been added or some parameters have been changed so that the previously optimal basis is no longer feasible. b.m}.2 RHS 0 8. call it r.e. A common rule for choosing r is to select the most negative RHS value.5 2.e.Table 22. i. so stop with the optimal solution. Optimum solution for phase 2 Coefficients Row 0 1 2 Basic z 1 0 0 z x3 x2 x1 8.25 --1 0..5 0.5 x2 0 0 1 x3 RHS Ratio 0 11. Step 2 (Iteration k) a.75 --0 3.4 0.4 –0. Determine the entering variable.7 0.

xn) c = (c1.  −c  = min  j : arj < 0. n     arj    c.1.10 Simplex Method Using Matrix Notation Decision variables: Objective coefficients: x = (x1. Let be the element in the ith row of the pivot column s. If there is no negative coefficient. be the pivot column. Its replacement will have a single 1 in row r and a zero in all other rows as required by the simplex form. Let be the vector of the ith row of the current tableau. Create a new tableau by performing the following operations (these are the same as for the primal simplex algorithm). j = 1. rj < 0. Replace xB(r) by xs in the basis. The pivot column is determined by the following ratio test. let xs is the entering variable. designated by the index s. put k ← k +1 and return to Step 2. The pivot row in the new tableau is = / and = /.….) Step 3 (Feasibility test) If all entries on the right-hand side are nonnegative the solution is primal feasible. i ≠ r (These operations have the effect of pricing out the pivot column. Otherwise. and let be the RHS of the new tableau. 3. Let the column with the minimum ratio. Change the basis. so stop with the optimal solution.m...cn) T . Let be the RHS for row i in the current tableau..….…..reduced cost in row 0 and the structural coefficient in row r. there is no feasible solution. stop. The other rows in the new tableau are = + and = + for i = 0. and let be the ith row in the new tableau.

. x4. (1) – (3) can be rewritten as x2 + 6x3 ≤ 9 x1 ≥ 0.…. xB = B –1 (b – NxN). –1 Multiplying through be B gives xB + B –1 NxN = B –1 b. x2. where xB and xN refer to the basic and nonbasic variables. 0. T Solving this set of equations allows us to express the basic variables in terms of the nonbasic variables. x2 ≥ 0. x3. x5. Eqs. x5 and x6 as slacks. respectively. 3. N). Let A = (B.Right-hand-side constants: b = (b1. xN).25x2+ 3x3 subject to 2x1 3x1 + x2 + 2x3 ≤ 7 + x2 ≤ 6 A= cx T Making use of this notation. where B is the m m basis matrix and N is m (n – m). N) = BxB + NxN = b.25. x3 ≥ 0 With x4. x6) c = (2. 0. the matrices and vectors defining the equality form of the model are: x = (x1.  The equations Ax = b can thus be written (B. 0) A = and b = Computing a Basic Solution Let x = (xB.bm) Structural coefficients: Maximize z = subject to Ax = b x≥0 Example Maximize z = 2x1 + 1. 1.

The column for xk in N is the same as the column for xk in A. 0) = (1. 1/6). we introduce the m-dimensional row vector of dual variables. 3.5 and dual solution –1 π = (π1. π. and observe the effect. xk. 0. call it Ak. one for the basic variables and the other for the nonbasic variables: –1 z = cBxB + cNxN = cBB (b – NxN) + cNxN (7) A basic solution is found by setting the nonbasic variables to zero. we will work with the above equation in the following form: z = c BB –1 b – (cBB –1 N – cN)xN We want to hold all the nonbasic variables to zero except one.The objective function can be written as the sum of two terms. 3. the basic solution is xB = B –1 b= = with objective value z = cBxB = (2. π3) = cBB = (2.x3. T For the example. so xB = B –1 –1 b and z = cBB b For convenience and later use in the section on the revised simplex method. 0) = 8.x5) . The objective value as a function of xk alone is . and define it as –1 π ≡ c BB so z = πb. when xB = (x1. xN = 0. Marginal Information Concerning the Objective From Eq. π2. (7) we see that the objective function value for a given basis can be written as z = c BB –1 b + (cN – cBB –1 N)xN For consistency with the material in the sections on the simplex tableau.

(Ei). 1. k ≥ 0 for all k  Q If this condition is not satisfied. 0. Matrix Representation of the Simplex Tableau Given a basis and basis inverse. 1/6) (1.25. x6) with cN =(1.1/6) (0.…. 1/6) (1. 0. The first term on the right of this expression is a constant for a given basis. every nonbasic variable with a negative marginal value is a candidate to enter the basis. 0. T for x4 we have 4 = (1. the marginal change k = c BB –1 Ak – ck = πAk – ck (8) where k is what we called the reduced cost of xk. 3. in Section 3. T for x6 we have 6 = (1. The RHS of (9) is ( z. 0. 0. 1) – 1. 1/6).m. Define for the general nonbasic variable xk. the matrix representation of an LP can be written as = (9) • which is equivalent to equations (E0). A sufficient condition for a given basis to be optimal is that increasing any nonbasic variable will cause the object to decrease or stay the same. The reduced cost for each of the nonbasic variables is computed using Eq.z = c BB –1 b – (cBB –1 Ak – ck)xk. i = 1.0. the nonbasic variables are xN = (x2.4. x4. (8) as follows: T for x2 we have 2 = (1. 1) – 0 = 1/6. For the example. 0) – 0 = 1. 0. The coefficient of xk in the second term (without the “–” sign) is the marginal change in the objective function for a unit increase in xk. 0) and π = (1. b ) .11 Revised Simplex Method .25 = –1/12.

167 0 0. π3) = (1. compute B and the primal and dual solutions –1 –1 xB = B b. . π2.083 1 0.10.Not necessary to keep track of the entire tableau. x3.5 0 -1. B = and B –1 = . 0). 0) π = (π1.1667 0 -0. –1 –1 For the example.5 z x1 x3 x5 RHS 8.5 x5 x6 0 0. x5) = (2. Compute the basic solution.5 0 Let. For the current basis B. we compute T T xB = (x1. 1/6). The starting tableau is given in Table 3. 3. Following information required • • • • –1 Primal variables: xB = B b –1 Dual variables: π = cBB Marginal cost for xk: k = πAk – ck (Ak is the kth column of A) –1 Pivot column: k = B Ak • Statement of the Algorithm Algorithm presented in parallel with the example introduced in Section 3. x3. using B above. Tableau for example Coefficients Row 0 1 2 3 Basic z 1 0 0 0 x1 x2 0 -0.1667 0 0 x3 0 0 1 0 x4 1 0.35. Step 1. T xB = (x1. cB = (2. x5) .3333 0 0. on current basis inverse. 3/2. π = cBB . Table 35.5 2 1. 0.1667 1 0.

0) . Compute the pivot column –1 T T –1 2 = B (1. 1) = (1/3.e. the pivot column is vector As. 0. 0. important to keep tract of this the basic variable xB(r) leaves the correspondence.1/6) (0. Step 4.  = xB(r) / rs with the minimum obtained for row 1. * compute z = cBxB. ratio is obtained. 1/6) (1. Find the row r for which the minimum At the current iteration. i.0. Find the variable to leave the basis. the reduced cost T = πAj – cj 2 = (1. Select the variable to enter the basis . 0.  is the amount that the variable xs is to increase in order drive xB(r) to zero. s = B As. = (1. basis. the basic variable for row 1. Compute the pivot column. for x2. compute As we have seen. Otherwise. Since the reduced cost for x2 is negative.25 = – j 1/12. T stop with the optimal solution and for x4. Note that x1 is If there are no rows that have is > 0. 1)T – 0 = 6 6 the variable with most negative 1/6. reduced cost to enter the basis.0) – 0 = 1. Let column s of the matrix A be the For s = 2. 1) – 1. the solution can be improved by allowing x2 to enter the basis (s = 2).Step 2. = min Thus x1 will leave the basis as x2 increases from 0 to 6. 4 = (1. 1. 1/6. Step 3. The entering variable is xs. For each nonbasic variable. . Otherwise. = min = 6. It is the solution is unbounded. select and for x . 1. 1/6) (1. If each of these values in nonnegative..0.

x5) . Change the basis.25.083 1 0. The algorithm continues until the optimality condition is met at Step 2 or an unbounded solution is discovered at Step 4.5 0 -1.5 x5 x6 0 0. Replace xB(r) by xs in set of basic For the new basis variables and replace cB(r) by cs in T xB = (x2. Table 35. the new BFS is T T xB = (x2.1667 0 0 x3 0 0 1 0 x4 1 0. as seen in Table 35. 0) with z = cBxB = 9.5 z x1 x3 x5 RHS 8. We now go to Step 1.5 0 . Update the basis inverse (this is equivalent to pivoting in the simplex The new basis inverse is tableau). which is an improvement over the initial basic BFS whose objective function value is z = 8. For the example problem.167 0 0. the new BFS is solution is discovered at Step 4.3333 0 0.5.5 2 1. For the example problem. Tableau for example Coefficients Row 0 1 2 3 Basic z 1 0 0 0 x1 x2 0 -0. 1/2. cB = (1. x3. 3. –1 B =. x5) = (6. x3.1667 0 -0. 0) cB.1667 1 0. Return to Step 1.Step 5.

Maximize z = 3x1+ 2x2 subject to –x1+ 2x2 ≤ 30 2x1 + x2 ≤ 40 x1 + 2x2 ≥ 10 x1 ≥ 0. x2 ≥ 0 x1 Adding slacks and so forth –x1+ 2x2+ x3 2x1 + x2 –x1– 2x2 Table 5. 0) with z = 30. 6 Coefficients z x1 1 0 0 0 0 0 0 1 x2 4 4 –3 2 x3 0 1 0 0 x4 0 0 1 0 x5 –3 –1 2 –1 + x4 = 30 = 40 (E1) (E2) (E3) Figure 4. Table 5 gives the equations for the example in terms of the basic variables (x1. x2 25 20 E1 15 10 5 E3 0 0 5 10 15 20 25 E2 As an example. the equations are written as (E0) (Ei) z + xB(i) + = = i.Additional Materials Information from the Simplex Form Each row in Table 4 can be written as: xB(i) = i – jQ ijxj. i = 1.…. 0. In general terms. we use the linear program given below with its graphical representation shown in Fig.m For the example B(1) = 3. B(2) = 4. x3. Tableau corresponding to origin in Fig. x4). B(3) = 1. 4. 40. 20. . where Q is the set of nonbasic variables. Feasible region + x5 = –10 Row 0 1 2 3 Basic z x3 x4 x1 RHS 30 40 20 10 Solution from tableau: x = (10.

When one of the nonbasic variables is held at zero. we have x3 = 40 + x5 x4 = 20 – 2x5 x1 = 10 + x5 • As x5 –> 10. How much should the nonbasic variable be changed? • From the example... x4 –> 0 which determines how much the nonbasic variable x5 can change. Minimum ratio test b     = minimum  i : aij > 0.m? Is the feasible basic solution optimal? The objective function equation for the example is (E0) z + 4x2 – 3x5 = 30 For the current BFS. For x2 active.…. and xj = 0 for j Q. we have z = 30 + 3x5  We wish to increase x5 because we want to maximize the objective function. we have z = 30 – 4x2. For x5 active. so decreasing either causes the solution to become infeasible. How can a nonoptimal feasible solution be improved? In the general case. when x2 is held at 0. both x2 and x5 are zero. only z and the other nonbasic variable play a role in (E0). Optimality conditions: j ≥ 0 for all j Q Condition easily tested by examining equation (E0) in the simplex form or row 0 of the tableau.  Is the basic solution feasible? i ≥ 0 for i = 1..From the general expression of the simplex form we read the objective function value and the values of the basic variables as z = . We therefore restrict attention to increases. xB(i) = i for i = 1. m   aij    .…. all nonbasic variables xj with j < 0 are candidates to become basic. i = 1.m..

x4. The maximum increase for x5 is computed to be 10. x4. When x5 is selected to increase.  change BFSs  pivot operation  move from one BFS to an adjacent BFS. • For the example.x1).It is possible that no positive value of ij exists for some nonbasic variable xk such that k < 0. Multiply the new row 2 by +1 and add it to row 1. When this occurs. This implies that xk and z can be increased indefinitely without the solution becoming infeasible. Coefficients z x1 1 0 0 0 0 0 0 1 Row 0 1 2 3 Basic z x3 x5 x1 x2 4 4 –3/2 2 x3 0 1 0 0 x4 0 0 1/2 0 x5 –3 –1 1 –1 RHS 30 40 10 10 Multiply the new row 2 by +3 and add it to row 0. causing the basic variable for the second row. to obtain: . we discover that the pivot row is 2. Original and subsequent tableaus Coefficients z x1 1 0 0 0 0 0 0 1 x2 4 4 –3 2 x3 0 1 0 0 x4 0 0 1 0 x5 –3 –1 2 –1 Row 0 1 2 3 Basic z x3 x4 x1 RHS 30 40 20 10 Divide row 2 by 2 to obtain a new row 2. one (or more) of the basic variables goes to zero. How is a new simplex form obtained? When a nonbasic variable is increased by the value . to go to zero. Multiply the new row 2 by +1 and add it to row 3. the basic set identified in Table 5 is (x3. Table 6. there is no finite optimum so the solution is said to be unbounded.

m. x5. (i) divide row r by the pivot element rk. 0. 0. . Now. multiply the new row r by –ik and add it to row i. 10) with z = 60. the objective value has improved by – 5 ×  = –3 × 10 = 30 to a value of 60. The BFS is easily seen to be x = (20. As expected. (i = 0. 50. i ≠ r). Pivot operations: Let the variable entering the basis be xk and let the pivot row be r. (ii) for each row i. x1). We observe from row 0 that the solution is still not optimal.Row 0 1 2 3 Basic z x3 x5 x1 Coefficients z x1 1 0 0 0 0 0 0 1 x2 –1/2 5/2 –3/2 1/2 x3 0 1 0 0 x4 3/2 –1/2 1/2 –1/2 x5 0 0 1 0 RHS 60 50 10 20 The third tableau in Table 6 is in the simplex form for the basic variables (x3.….