Linear programming 1 Basics, Schemes and Mind Maps of Linear Programming

When trying to formulate a problem as a linear program, the first step is to decide which decision variables to use. These variables represent ...

Typology: Schemes and Mind Maps

2021/2022

Uploaded on 09/27/2022

kitriotak
kitriotak 🇮🇳

4.5

(13)

220 documents

1 / 33

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
18.310A lecture notes March 17, 2015
Linear programming
Lecturer: Michel Goemans
1 Basics
Linear Programming deals with the problem of optimizing a linear objective function subject to
linear equality and inequality constraints on the decision variables. Linear programming has many
practical applications (in transportation, production planning, ...). It is also the building block for
combinatorial optimization. One aspect of linear programming which is often forgotten is the fact
that it is also a useful proof technique. In this first chapter, we describe some linear programming
formulations for some classical problems. We also show that linear programs can be expressed in a
variety of equivalent ways.
1.1 Formulations
1.1.1 The Diet Problem
In the diet model, a list of available foods is given together with the nutrient content and the cost
per unit weight of each food. A certain amount of each nutrient is required per day. For example,
here is the data corresponding to a civilization with just two types of grains (G1 and G2) and three
types of nutrients (starch, proteins, vitamins):
Starch Proteins Vitamins Cost ($/kg)
G1 5 4 2 0.6
G2 7 2 1 0.35
Nutrient content and cost per kg of food.
The requirement per day of starch, proteins and vitamins is 8, 15 and 3 respectively. The problem
is to find how much of each food to consume per day so as to get the required amount per day of
each nutrient at minimal cost.
When trying to formulate a problem as a linear program, the first step is to decide which
decision variables to use. These variables represent the unknowns in the problem. In the diet
problem, a very natural choice of decision variables is:
x1: number of units of grain G1 to be consumed per day,
x2: number of units of grain G2 to be consumed per day.
The next step is to write down the objective function. The objective function is the function to be
minimized or maximized. In this case, the objective is to minimize the total cost per day which is
given by z= 0.6x1+ 0.35x2(the value of the objective function is often denoted by z).
Finally, we need to describe the different constraints that need to be satisfied by x1and x2.
First of all, x1and x2must certainly satisfy x10 and x20. Only nonnegative amounts of
LP-1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21

Partial preview of the text

Download Linear programming 1 Basics and more Schemes and Mind Maps Linear Programming in PDF only on Docsity!

18.310A lecture notes March 17, 2015

Linear programming

Lecturer: Michel Goemans

1 Basics

Linear Programming deals with the problem of optimizing a linear objective function subject to linear equality and inequality constraints on the decision variables. Linear programming has many practical applications (in transportation, production planning, ...). It is also the building block for combinatorial optimization. One aspect of linear programming which is often forgotten is the fact that it is also a useful proof technique. In this first chapter, we describe some linear programming formulations for some classical problems. We also show that linear programs can be expressed in a variety of equivalent ways.

1.1 Formulations

1.1.1 The Diet Problem

In the diet model, a list of available foods is given together with the nutrient content and the cost per unit weight of each food. A certain amount of each nutrient is required per day. For example, here is the data corresponding to a civilization with just two types of grains (G1 and G2) and three types of nutrients (starch, proteins, vitamins):

Starch Proteins Vitamins Cost ($/kg) G1 5 4 2 0. G2 7 2 1 0. Nutrient content and cost per kg of food.

The requirement per day of starch, proteins and vitamins is 8, 15 and 3 respectively. The problem is to find how much of each food to consume per day so as to get the required amount per day of each nutrient at minimal cost. When trying to formulate a problem as a linear program, the first step is to decide which decision variables to use. These variables represent the unknowns in the problem. In the diet problem, a very natural choice of decision variables is:

  • x 1 : number of units of grain G1 to be consumed per day,
  • x 2 : number of units of grain G2 to be consumed per day.

The next step is to write down the objective function. The objective function is the function to be minimized or maximized. In this case, the objective is to minimize the total cost per day which is given by z = 0. 6 x 1 + 0. 35 x 2 (the value of the objective function is often denoted by z). Finally, we need to describe the different constraints that need to be satisfied by x 1 and x 2. First of all, x 1 and x 2 must certainly satisfy x 1 ≥ 0 and x 2 ≥ 0. Only nonnegative amounts of

food can be eaten! These constraints are referred to as nonnegativity constraints. Nonnegativity constraints appear in most linear programs. Moreover, not all possible values for x 1 and x 2 give rise to a diet with the required amounts of nutrients per day. The amount of starch in x 1 units of G1 and x 2 units of G2 is 5x 1 + 7x 2 and this amount must be at least 8, the daily requirement of starch. Therefore, x 1 and x 2 must satisfy 5x 1 + 7x 2 ≥ 8. Similarly, the requirements on the amount of proteins and vitamins imply the constraints 4x 1 + 2x 2 ≥ 15 and 2x 1 + x 2 ≥ 3. This diet problem can therefore be formulated by the following linear program:

Minimize z = 0. 6 x 1 + 0. 35 x 2 subject to: 5 x 1 + 7x 2 ≥ 8 4 x 1 + 2x 2 ≥ 15 2 x 1 + x 2 ≥ 3 x 1 ≥ 0 , x 2 ≥ 0.

Some more terminology. A solution x = (x 1 , x 2 ) is said to be feasible with respect to the above linear program if it satisfies all the above constraints. The set of feasible solutions is called the feasible space or feasible region. A feasible solution is optimal if its objective function value is equal to the smallest value z can take over the feasible region.

1.1.2 The Transportation Problem

Suppose a company manufacturing widgets has two factories located at cities F1 and F2 and three retail centers located at C1, C2 and C3. The monthly demand at the retail centers are (in thousands of widgets) 8, 5 and 2 respectively while the monthly supply at the factories are 6 and 9 respectively. Notice that the total supply equals the total demand. We are also given the cost of transportation of 1 widget between any factory and any retail center.

C1 C2 C F1 5 5 3 F2 6 4 1 Cost of transportation (in 0.01$/widget).

In the transportation problem, the goal is to determine the quantity to be transported from each factory to each retail center so as to meet the demand at minimum total shipping cost. In order to formulate this problem as a linear program, we first choose the decision variables. Let xij (i = 1, 2 and j = 1, 2 , 3) be the number of widgets (in thousands) transported from factory Fi to city Cj. Given these xij ’s, we can express the total shipping cost, i.e. the objective function to be minimized, by 5 x 11 + 5x 12 + 3x 13 + 6x 21 + 4x 22 + x 23.

We now need to write down the constraints. First, we have the nonnegativity constraints saying that xij ≥ 0 for i = 1, 2 and j = 1, 2 , 3. Moreover, we have that the demand at each retail center must be met. This gives rise to the following constraints:

x 11 + x 21 = 8,

simply, the cost coefficient of xj. bi is known as the right-hand-side (RHS) of equation i. Notice that the constant term c 0 can be omitted without affecting the set of optimal solutions. A linear program is said to be in standard form if

  • it is a maximization program,
  • there are only equalities (no inequalities) and
  • all variables are restricted to be nonnegative.

In matrix form, a linear program in standard form can be written as:

Max z = cT^ x subject to: Ax = b x ≥ 0.

where

c =

c 1 .. . cn

 , b^ =

b 1 .. . bm

 , x^ =

x 1 .. . xn

are column vectors, cT^ denote the transpose of the vector c, and A = [aij ] is the m × n matrix whose i, j−element is aij. Any linear program can in fact be transformed into an equivalent linear program in standard form. Indeed,

  • If the objective function is to minimize z = c 1 x 1 +... + cnxn then we can simply maximize z′^ = −z = −c 1 x 1 −... − cnxn.
  • If we have an inequality constraint ai 1 x 1 +... + ainxn ≤ bi then we can transform it into an equality constraint by adding a slack variable, say s, restricted to be nonnegative: ai 1 x 1 + ... + ainxn + s = bi and s ≥ 0.
  • Similarly, if we have an inequality constraint ai 1 x 1 +... + ainxn ≥ bi then we can transform it into an equality constraint by adding a surplus variable, say s, restricted to be nonnegative: ai 1 x 1 +... + ainxn − s = bi and s ≥ 0.
  • If xj is unrestricted in sign then we can introduce two new decision variables x+ j and x− j restricted to be nonnegative and replace every occurrence of xj by x+ j − x− j. For example, the linear program

Minimize z = 2x 1 − x 2 subject to: x 1 + x 2 ≥ 2 3 x 1 + 2x 2 ≤ 4 x 1 + 2x 2 = 3 x 1 ≷ 0 , x 2 ≥ 0.

is equivalent to the linear program

Maximize z′^ = − 2 x+ 1 + 2x− 1 + x 2 subject to: x+ 1 − x− 1 + x 2 − x 3 = 2 3 x+ 1 − 3 x− 1 + 2x 2 + x 4 = 4 x+ 1 − x− 1 + 2x 2 = 3 x+ 1 ≥ 0 , x− 1 ≥ 0 , x 2 ≥ 0 , x 3 ≥ 0 , x 4 ≥ 0.

with decision variables x+ 1 , x− 1 , x 2 , x 3 , x 4. Notice that we have introduced different slack or surplus variables into different constraints. In some cases, another form of linear program is used. A linear program is in canonical form if it is of the form:

Max z = cT^ x subject to: Ax ≤ b x ≥ 0.

A linear program in canonical form can be replaced by a linear program in standard form by just replacing Ax ≤ b by Ax + Is = b, s ≥ 0 where s is a vector of slack variables and I is the m × m identity matrix. Similarly, a linear program in standard form can be replaced by a linear program

in canonical form by replacing Ax = b by A′x ≤ b′^ where A′^ =

[

A

−A

]

and b′^ =

b −b

2 The Simplex Method

In 1947, George B. Dantzig developed a technique to solve linear programs — this technique is referred to as the simplex method.

2.1 Brief Review of Some Linear Algebra

Two systems of equations Ax = b and Ax¯ = ¯b are said to be equivalent if {x : Ax = b} = {x : Ax¯ = ¯b}. Let Ei denote equation i of the system Ax = b, i.e. ai 1 x 1 +... + ainxn = bi. Given a system Ax = b, an elementary row operation consists in replacing Ei either by αEi where α is a nonzero scalar or by Ei + βEk for some k 6 = i. Clearly, if Ax¯ = ¯b is obtained from Ax = b by an elementary row operation then the two systems are equivalent. (Exercise: prove this.) Notice also that an elementary row operation is reversible. Let ars be a nonzero element of A. A pivot on ars consists of performing the following sequence of elementary row operations:

  • replacing Er by E¯r = (^) a^1 rs Er,
  • for i = 1,... , m, i 6 = r, replacing Ei by E¯i = Ei − ais E¯r = Ei − (^) aaisrs Er.

Max z = 10 + 20 x 1 + 16 x 2 + 12 x 3 subject to x 1 + x 4 = 4 2 x 1 + x 2 + x 3 +x 5 = 10 2 x 1 + 2 x 2 + x 3 + x 6 = 16 x 1 , x 2 , x 3 , x 4 , x 5 , x 6 ≥ 0. In this example, B = {x 4 , x 5 , x 6 }. The variables in B are called basic variables while the other variables are called nonbasic. The set of nonbasic variables is denoted by N. In the example, N = {x 1 , x 2 , x 3 }. The advantage of having AB = I is that we can quickly infer the values of the basic variables given the values of the nonbasic variables. For example, if we let x 1 = 1, x 2 = 2, x 3 = 3, we obtain

x 4 = 4 − x 1 = 3,

x 5 = 10 − 2 x 1 − x 2 − x 3 = 3, x 6 = 16 − 2 x 1 − 2 x 2 − x 3 = 7.

Also, we don’t need to know the values of the basic variables to evaluate the cost of the solution. In this case, we have z = 10 + 20x 1 + 16x 2 + 12x 3 = 98. Notice that there is no guarantee that the so-constructed solution be feasible. For example, if we set x 1 = 5, x 2 = 2, x 3 = 1, we have that x 4 = 4 − x 1 = −1 does not satisfy the nonnegativity constraint x 4 ≥ 0. There is an assignment of values to the nonbasic variables that needs special consideration. By just letting all nonbasic variables to be equal to 0, we see that the values of the basic variables are just given by the right-hand-sides of the constraints and the cost of the resulting solution is just the constant term in the objective function. In our example, letting x 1 = x 2 = x 3 = 0, we obtain x 4 = 4, x 5 = 10, x 6 = 16 and z = 10. Such a solution is called a basic feasible solution or bfs. The feasibility of this solution comes from the fact that b ≥ 0. Later, we shall see that, when solving a linear program, we can restrict our attention to basic feasible solutions. The simplex method is an iterative method that generates a sequence of basic feasible solutions (corresponding to different bases) and eventually stops when it has found an optimal basic feasible solution. Instead of always writing explicitely these linear programs, we adopt what is known as the tableau format. First, in order to have the objective function play a similar role as the other constraints, we consider z to be a variable and the objective function as a constraint. Putting all variables on the same side of the equality sign, we obtain:

−z + 20x 1 + 16x 2 + 12x 3 = − 10.

We also get rid of the variable names in the constraints to obtain the tableau format: −z x 1 x 2 x 3 x 4 x 5 x 6 1 20 16 12 - 1 0 0 1 4 2 1 1 1 10 2 2 1 1 16

Our bfs is currently x 1 = 0, x 2 = 0, x 3 = 0, x 4 = 4, x 5 = 10, x 6 = 16 and z = 10. Since the cost coefficient c 1 of x 1 is positive (namely, it is equal to 20), we notice that we can increase z by increasing x 1 and keeping x 2 and x 3 at the value 0. But in order to maintain feasibility, we must

have that x 4 = 4 − x 1 ≥ 0, x 5 = 10 − 2 x 1 ≥ 0, x 6 = 16 − 2 x 1 ≥ 0. This implies that x 1 ≤ 4. Letting x 1 = 4, x 2 = 0, x 3 = 0, we obtain x 4 = 0, x 5 = 2, x 6 = 8 and z = 90. This solution is also a bfs and corresponds to the basis B = {x 1 , x 5 , x 6 }. We say that x 1 has entered the basis and, as a result, x 4 has left the basis. We would like to emphasize that there is a unique basic solution associated with any basis. This (not necessarily feasible) solution is obtained by setting the nonbasic variables to zero and deducing the values of the basic variables from the m constraints. Now we would like that our tableau reflects this change by showing the dependence of the new basic variables as a function of the nonbasic variables. This can be accomplished by pivoting on the element a 11. Why a 11? Well, we need to pivot on an element of column 1 because x 1 is entering the basis. Moreover, the choice of the row to pivot on is dictated by the variable which leaves the basis. In this case, x 4 is leaving the basis and the only 1 in column 4 is in row 1. After pivoting on a 11 , we obtain the following tableau: −z x 1 x 2 x 3 x 4 x 5 x 6 1 16 12 -20 - 1 0 0 1 4 1 1 -2 1 2 2 1 -2 1 8

Notice that while pivoting we also modified the objective function row as if it was just like another constraint. We have now a linear program which is equivalent to the original one from which we can easily extract a (basic) feasible solution of value 90. Still z can be improved by increasing xs for s = 2 or 3 since these variables have a positive cost coefficient^2 c¯s. Let us choose the one with the greatest ¯cs; in our case x 2 will enter the basis. The maximum value that x 2 can take while x 3 and x 4 remain at the value 0 is dictated by the constraints x 1 = 4 ≥ 0, x 5 = 2−x 2 ≥ 0 and x 6 = 8 − 2 x 2 ≥ 0. The tightest of these inequalities being x 5 = 2 − x 2 ≥ 0, we have that x 5 will leave the basis. Therefore, pivoting on ¯a 22 , we obtain the tableau: −z x 1 x 2 x 3 x 4 x 5 x 6 1 -4 12 -16 - 1 0 1 0 4 1 1 -2 1 2 -1 2 -2 1 4

The current basis is B = {x 1 , x 2 , x 6 } and its value is 122. Since 12 > 0, we can improve the current basic feasible solution by having x 4 enter the basis. Instead of writing explicitely the constraints on x 4 to compute the level at which x 4 can enter the basis, we perform the min ratio test. If xs is the variable that is entering the basis, we compute

min i:¯ais> 0 {¯bi/¯ais}.

The argument of the minimum gives the variable that is exiting the basis. In our example, we obtain 2 = min{ 4 / 1 , 4 / 2 } and therefore variable x 6 which is the basic variable corresponding to row 3 leaves the basis. Moreover, in order to get the updated tableau, we need to pivot on ¯a 34. Doing so, we obtain:

(^2) By simplicity, we always denote the data corresponding to the current tableau by ¯c, A¯, and ¯b.

−z x 1 x 2 x 3 x 4 x 5 x 6 1 16 12 -20 - 1 0 0 1 4 1 1 -2 1 2 2 1 -2 1 4

and that x 2 is entering the basis. The min ratio test gives 2 = min{ 2 / 1 , 4 / 2 } and, thus, either x 5 or x 6 can leave the basis. If we decide to have x 5 leave the basis, we pivot on ¯a 22 ; otherwise, we pivot on ¯a 32. Notice that, in any case, the pivot operation creates a zero coefficient among the RHS. For example, pivoting on ¯a 22 , we obtain: −z x 1 x 2 x 3 x 4 x 5 x 6 1 -4 12 -16 - 1 0 1 0 4 1 1 -2 1 2 -1 2 -2 1 0

A bfs with ¯bi = 0 for some i is called degenerate. A linear program is nondegenerate if no bfs is degenerate. Pivoting now on ¯a 34 we obtain: −z x 1 x 2 x 3 x 4 x 5 x 6 1 2 -4 -6 - 1 1/2 1 -1/2 4 1 0 -1 1 2 -1/2 1 -1 1/2 0

This pivot is degenerate. A pivot on ¯ars is called degenerate if ¯br = 0. Notice that a degenerate pivot alters neither the ¯bi’s nor ¯c 0. In the example, the bfs is (4, 2 , 0 , 0 , 0 , 0) in both tableaus. We thus observe that several bases can correspond to the same basic feasible solution. Another situation that may occur is when xs is entering the basis, but ¯ais ≤ 0 for i = 1,... , m. In this case, there is no term in the min ratio test. This means that, while keeping the other nonbasic variables at their zero level, xs can take an arbitrarily large value without violating feasibility. Since ¯cs > 0, this implies that z can be made arbitrarily large. In this case, the linear program is said to be unbounded or unbounded from above if we want to emphasize the fact that we are dealing with a maximization problem. For example, consider the following tableau: −z x 1 x 2 x 3 x 4 x 5 x 6 1 16 12 20 - 1 0 0 -1 4 1 1 0 1 2 2 1 -2 1 8

If x 4 enters the basis, we have that x 1 = 4 + x 4 , x 5 = 2 and x 6 = 8 + 2x 4 and, as a result, for any nonnegative value of x 4 , the solution (4 + x 4 , 0 , 0 , x 4 , 2 , 8 + 2x 4 ) is feasible and its objective function value is 90 + 20x 4. There is thus no finite optimum.

2.3 Detailed Description of Phase II

In this section, we summarize the different steps of the simplex method we have described in the previous section. In fact, what we have described so far constitutes Phase II of the simplex method. Phase I deals with the problem of putting the linear program in the required form. This will be described in a later section.

Phase II of the simplex method

  1. Suppose the initial or current tableau is −z x 1... xs... xn 1 ¯c 1... ¯cs... c¯n −¯c 0 ¯a 11... a¯ 1 s... ¯a 1 n ¯b 1 ≥ 0 .. .

¯ar 1... ¯ars... ¯arn ¯br ≥ 0 .. .

¯am 1... ¯ams... ¯amn ¯bm ≥ 0

and the variables can be partitioned into B = {xj 1 ,... , xjm } and N with

  • ¯cji = 0 for i = 1,... , m and
  • ¯akji =

0 k 6 = i 1 k = i. The current basic feasible solution is given by xji = ¯bi for i = 1,... , m and xj = 0 otherwise. The objective function value of this solution is ¯c 0.

  1. If ¯cj ≤ 0 for all j = 1,... , n then the current basic feasible solution is optimal. STOP.
  2. Find a column s for which ¯cs > 0. xs is the variable entering the basis.
  3. Check for unboundedness. If ¯ais ≤ 0 for i = 1,... , m then the linear program is unbounded. STOP.
  4. Min ratio test. Find row r such that ¯br ¯ars

= min i:¯ais> 0

¯bi ¯ais

  1. Pivot on ¯ars. I.e. replace the current tableau by:

2.4.2 Bland’s Anticycling Rule

The simplex method, as described in the previous section, is ambiguous. First, if we have several variables with a positive ¯cs (cfr. Step 3) we have not specified which will enter the basis. Moreover, there might be several variables attaining the minimum in the minimum ratio test (Step 5). If so, we need to specify which of these variables will leave the basis. A pivoting rule consists of an entering variable rule and a leaving variable rule that unambiguously decide what will be the entering and leaving variables.

  • −z x 1 x 2 x 3 x 4 x 5 x
    • 1 4 1.92 -16 -0.96
      • -12.5 -2 12.5 - 1 0.24 -2 -0.24
  • −z x 1 x 2 x 3 x 4 x 5 x
    • 1 0.96 -8 0 -4 - 1 -12.5 -2 1 12.5 - 1 0.24 -2 -0.24
  • −z x 1 x 2 x 3 x 4 x 5 x
    • 1 4 1.92 -0.96 -16 - 1 -12.5 -2 1 12.5 - 1 1 0.24 -0.24 -2
  • −z x 1 x 2 x 3 x 4 x 5 x
    • 1 -4 0.96 0 -8
      • 12.5 1 1 -2 -12.5 - 1 1 0.24 -0.24 -2
  • −z x 1 x 2 x 3 x 4 x 5 x
    • 1 -16 -0.96 1.92
      • 12.5 1 1 -2 -12.5 - -2 -0.24 1 0.24
  • −z x 1 x 2 x 3 x 4 x 5 x
    • 1 -8 0 -4 0.96
      • -12.5 -2 12.5 - -2 -0.24 1 0.24
  • −z x 1 x 2 x 3 x 4 x 5 x
    • 1 4 1.92 -16 -0.96
      • -12.5 -2 12.5 - 1 0.24 -2 -0.24

Largest coefficient entering variable rule: Select the variable xs with the largest ¯cs > 0. In case of ties, select the one with the smallest subscript s. The corresponding leaving variable rule is:

Largest coefficient leaving variable rule: Among all rows attaining the minimum in the min- imum ratio test, select the one with the largest pivot ¯ars. In case of ties, select the one with the smallest subscript r. The example of subsection 2.4.1 shows that the use of the largest coefficient entering and leaving variable rules does not prevent cycling. There are two rules that avoid cycling: the lexicographic rule and Bland’s rule (after R. Bland who discovered it in 1976). We’ll just describe the latter one, which is conceptually the simplest.

Bland’s anticycling pivoting rule: Among all variables xs with positive ¯cs, select the one with the smallest subscript s. Among the eligible (according to the minimum ratio test) leaving variables xl, select the one with the smallest subscript l.

Theorem 2.2. The simplex method with Bland’s anticycling pivoting rule terminates after a finite number of iterations.

Proof. The proof is by contradiction. If the method does not stop after a finite number of iterations then there is a cycle of tableaus that repeats. If we delete from the tableau that initiates this cycle the rows and columns not containing pivots during the cycle, the resulting tableau has a cycle with the same pivots. For this tableau, all right-hand-sides are zero throughout the cycle since all pivots are degenerate. Let t be the largest subscript of the variables remaining. Consider the tableau T 1 in the cycle with xt leaving. Let B = {xj 1 ,... , xjm } be the corresponding basis (say jr = t), xs be the associated entering variable and, a^1 ij and c^1 j the constraint and cost coefficients. On the other hand, consider the tableau T 2 with xt entering and denotes by a^2 ij and c^2 j the corresponding constraint and cost coefficients. Let x be the (infeasible) solution obtained by letting the nonbasic variables in T 1 be zero except for xs = −1. Since all RHS are zero, we deduce that xji = ais for i = 1,... , m. Since T 2 is obtained from T 1 by elementary row operations, x must have the same objective function value in T 1 and T 2. This means that

c^10 − c^1 s = c^20 − c^2 s +

∑^ m

i=

a^1 isc^2 ji.

Since we have no improvement in objective function in the cycle, we have c^10 = c^20. Moreover, c^1 s > 0 and, by Bland’s rule, c^2 s ≤ 0 since otherwise xt would not be the entering variable in T 2. Hence,

∑^ m

i=

a^1 isc^2 ji < 0

implying that there exists k with a^1 ksc^2 jk < 0. Notice that k 6 = r, i.e. jk < t, since the pivot element in T 1 , a^1 rs, must be positive and c^2 t > 0. However, in T 2 , all cost coefficients c^2 j except c^2 t are nonnegative; otherwise xj would have been selected as entering variable. Thus c^2 jk < 0 and a^1 ks > 0. This is a contradiction because Bland’s rule should have selected xjk rather than xt in T 1 as leaving variable.

  1. w′^ is reduced to zero but some artificial variables remain in the basis. These artificial variables must be at zero level since, for this solution, −w′^ =

∑m i=1 x

a i = 0. Suppose that the^ ith variable ofthe basis is artificial. We may pivot on any nonzero (not necessarily positive) element ¯aij of row i corresponding to a non-artificial variable xj. Since ¯bi = 0, no change in the solution or in w′^ will result. We say that we are driving the artificial variables out of the basis. By repeating this for all artificial variables in the basis, we obtain a basis consisting only of original variables. We have thus reduced this case to case 1. There is still one detail that needs consideration. We might be unsuccessful in driving one artificial variable out the basis if ¯aij = 0 for j = 1,... , n. However, this means that we have arrived at a zero row in the original matrix by performing elementary row operations, implying that the constraint is redundant. We can delete this constraint and continue in phase II with a basis of lower dimension.

Example

Consider the following example already expressed in tableau form. −z x 1 x 2 x 3 x 4 1 20 16 12 5 0 1 0 1 2 4 0 1 2 3 2 0 1 0 2 2

We observe that we don’t need to add three artificial variables since we can use x 1 as first basic variable. In phase I, we solve the linear program: w x 1 x 2 x 3 x 4 xa 1 xa 2 1 2 2 5 4 1 0 1 2 4 1 2 3 1 2 1 0 2 1 2

The objective function is to minimize xa 1 + xa 2 and, as a result, the objective function coefficients of the nonbasic variables as well as −¯c 0 are obtained by taking the negative of the sum of all rows corresponding to artificial variables. Pivoting on ¯a 22 , we obtain: w x 1 x 2 x 3 x 4 xa 1 xa 2 1 -2 -1 -2 0 1 1 2 0 4 1 2 3 1 2 -2 -1 -1 1 0

This tableau is optimal and, since w = 0, the original linear program is feasible. To obtain a bfs, we need to drive xa 1 out of the basis. This can be done by pivoting on say ¯a 34. Doing so, we get:

w x 1 x 2 x 3 x 4 xa 1 xa 2 1 0 -1 -1 0 1 -3 -2 2 4 1 -4 -2 3 2 2 1 1 -1 0

Expressing z as a function of {x 1 , x 2 , x 4 }, we have transformed our original LP into: −z x 1 x 2 x 3 x 4 1 126 - 1 -3 4 1 -4 2 2 1 0

This can be solved by phase II of the simplex method.

3 Linear Programming in Matrix Form

In this chapter, we show that the entries of the current tableau are uniquely determined by the collection of decision variables that form the basis and we give matrix expressions for these entries. Consider a feasible linear program in standard form:

Max z = cT^ x subject to: Ax = b x ≥ 0 ,

where A has full row rank. Consider now any intermediate tableau of phase II of the simplex method and let B denote the corresponding collection of basic variables. If D (resp. d) is an m × n matrix (resp. an n-vector), let DB (resp. dB ) denote the restriction of D (resp. d) to the columns (resp. rows) corresponding to B. We define analogously DN and dN for the collection N of nonbasic variables. For example, Ax = b can be rewritten as AB xB + AN xN = b. After possible regrouping of the basic variables, the current tableau looks as follows: xB xN −z 0 c¯TN −c¯ 0 A^ ¯B = I A¯N ¯b.

Since the current tableau has been obtained from the original tableau by a sequence of elemen- tary row operations, we conclude that there exists an invertible matrix P (see Section 2.1) such that: P AB = A¯B = I P AN = A¯N

and P b = ¯b.

by some nonnegative scalar y 1 , inequality (2) by some nonnegative y 2 and inequality (3) by some nonnegative y 3 , and add them together, deriving that

(y 1 + y 2 + 3y 3 )x 1 + (2y 2 + 2y 3 )x 2 ≤ 4 y 1 + 10y 2 + 16y 3.

To derive an upper bound on z∗, one would then impose that the coefficients of the xi’s in this implied inequality dominate the corresponding cost coefficients: y 1 +y 2 +3y 3 ≥ 5 and 2y 2 +2y 3 ≥ 4. To derive the best upper bound (i.e. smallest) this way, one is thus led to solve the following so-called dual linear program:

Min w = 4y 1 + 10y 2 + 16y 3 subject to: y 1 + y 2 + 3y 3 ≥ 5 2 y 2 + 2y 3 ≥ 4 y 1 ≥ 0 , y 2 ≥ 0 , y 3 ≥ 0.

Observe how the dual linear program is constructed from the primal: one is a maximization problem, the other a minimization; the cost coefficients of one are the RHS of the other and vice versa; the constraint matrix is just transposed (see below for more precise and formal rules). The optimum solution to this linear program is y 1 = 0, y 2 = 0.5 and y 3 = 1.5, giving an upper bound of 29 on z∗. What we shall show in this chapter is that this upper bound is in fact equal to the optimum value of the primal. Here, x 1 = 3 and x 2 = 3.5 is a feasible solution to the primal of value 29 as well. Because of our upper bound of 29, this solution must be optimal, and thus duality is a way to prove optimality.

4.1 Duality for Linear Programs in canonical form

Given a linear program (P ) in canonical form

Max z = cT^ x subject to:

(P ) Ax ≤ b

x ≥ 0

we define its dual linear program (D) as

Min w = bT^ y subject to:

(D) AT^ y ≥ c

y ≥ 0.

(P ) is called the primal linear program. Notice there is a dual variable associated with each primal constraint, and a dual constraint associated with each primal variable. In fact, the primal and dual are indistinguishable in the following sense:

Proposition 4.1. The dual of the dual is the primal.

Proof. To construct the dual of the dual, we first need to put (D) in canonical form:

Max w′^ = −w = −bT^ y subject to:

(D′) −AT^ y ≤ −c

y ≥ 0.

Therefore the dual (DD′) of D is:

Min z′^ = −cT^ x subject to:

(DD′) −Ax ≥ −b

x ≥ 0.

Transforming this linear program into canonical form, we obtain (P ).

Theorem 4.2 (Weak Duality). If x is feasible in (P ) with value z and y is feasible in (D) with value w then z ≤ w.

Proof.

z = cT^ x

x≥ 0 ≤ (AT^ y)T^ x = yT^ Ax

y≥ 0 ≤ yT^ b = bT^ y = w.

Any dual feasible solution (i.e. feasible in (D)) gives an upper bound on the optimal value z∗^ of the primal (P ) and vice versa (i.e. any primal feasible solution gives a lower bound on the optimal value w∗^ of the dual (D)). In order to take care of infeasible linear programs, we adopt the convention that the maximum value of any function over an empty set is defined to be −∞ while the minimum value of any function over an empty set is +∞. Therefore, we have the following corollary:

Corollary 4.3 (Weak Duality). z∗^ ≤ w∗.

What is more surprising is the fact that this inequality is in most cases an equality.

Theorem 4.4 (Strong Duality). If z∗^ is finite then so is w∗^ and z∗^ = w∗.

Proof. The proof uses the simplex method. In order to solve (P ) with the simplex method, we reformulate it in standard form:

Max z = cT^ x subject to:

(P ) Ax + Is = b

x ≥ 0 , s ≥ 0.

Let A˜ = (A I), ˜x =

x s

and ˜c =

c 0

. Let B be the optimal basis obtained by the simplex

method. The optimality conditions imply that

A˜T^ y ≥ ˜c