The dual simplex method with bounds

Similar documents
Review Solutions, Exam 2, Operations Research

1. Algebraic and geometric treatments Consider an LP problem in the standard form. x 0. Solutions to the system of linear equations

Linear Programming in Matrix Form

Linear Programming: Simplex

Farkas Lemma, Dual Simplex and Sensitivity Analysis

Linear Programming Redux

CO350 Linear Programming Chapter 8: Degeneracy and Finite Termination

9.1 Linear Programs in canonical form

TRANSPORTATION PROBLEMS

Yinyu Ye, MS&E, Stanford MS&E310 Lecture Note #06. The Simplex Method

MAT016: Optimization

"SYMMETRIC" PRIMAL-DUAL PAIR

Chapter 3, Operations Research (OR)

The Dual Simplex Algorithm

Simplex tableau CE 377K. April 2, 2015

Part 1. The Review of Linear Programming

The use of shadow price is an example of sensitivity analysis. Duality theory can be applied to do other kind of sensitivity analysis:

21. Solve the LP given in Exercise 19 using the big-m method discussed in Exercise 20.

Chap6 Duality Theory and Sensitivity Analysis

Special cases of linear programming

F 1 F 2 Daily Requirement Cost N N N

Slack Variable. Max Z= 3x 1 + 4x 2 + 5X 3. Subject to: X 1 + X 2 + X x 1 + 4x 2 + X X 1 + X 2 + 4X 3 10 X 1 0, X 2 0, X 3 0

Linear Programming Duality P&S Chapter 3 Last Revised Nov 1, 2004

1 Review Session. 1.1 Lecture 2

The Simplex Algorithm

CHAPTER 2. The Simplex Method

Standard Form An LP is in standard form when: All variables are non-negativenegative All constraints are equalities Putting an LP formulation into sta

ECE 307 Techniques for Engineering Decisions

Simplex method(s) for solving LPs in standard form

MATH 373 Section A1. Final Exam. Dr. J. Bowman 17 December :00 17:00

OPTIMISATION 3: NOTES ON THE SIMPLEX ALGORITHM

In Chapters 3 and 4 we introduced linear programming

(includes both Phases I & II)

CO350 Linear Programming Chapter 6: The Simplex Method

min 4x 1 5x 2 + 3x 3 s.t. x 1 + 2x 2 + x 3 = 10 x 1 x 2 6 x 1 + 3x 2 + x 3 14

Summary of the simplex method

Sensitivity Analysis

Relation of Pure Minimum Cost Flow Model to Linear Programming

OPRE 6201 : 3. Special Cases

TIM 206 Lecture 3: The Simplex Method

A Review of Linear Programming

(P ) Minimize 4x 1 + 6x 2 + 5x 3 s.t. 2x 1 3x 3 3 3x 2 2x 3 6

MATH 4211/6211 Optimization Linear Programming

Ω R n is called the constraint set or feasible set. x 1

(includes both Phases I & II)

Example. 1 Rows 1,..., m of the simplex tableau remain lexicographically positive

Dr. Maddah ENMG 500 Engineering Management I 10/21/07

3. Linear Programming and Polyhedral Combinatorics

Chapter 1: Linear Programming

Multicommodity Flows and Column Generation

Chapter 7 Network Flow Problems, I

Contents. 4.5 The(Primal)SimplexMethod NumericalExamplesoftheSimplexMethod

Note 3: LP Duality. If the primal problem (P) in the canonical form is min Z = n (1) then the dual problem (D) in the canonical form is max W = m (2)

3. Duality: What is duality? Why does it matter? Sensitivity through duality.

Introduction to Mathematical Programming IE406. Lecture 10. Dr. Ted Ralphs

Distributed Real-Time Control Systems. Lecture Distributed Control Linear Programming

Linear Programming The Simplex Algorithm: Part II Chapter 5

min3x 1 + 4x 2 + 5x 3 2x 1 + 2x 2 + x 3 6 x 1 + 2x 2 + 3x 3 5 x 1, x 2, x 3 0.

CO 602/CM 740: Fundamentals of Optimization Problem Set 4

Operations Research Lecture 2: Linear Programming Simplex Method

Linear Programming and its Extensions Prof. Prabha Shrama Department of Mathematics and Statistics Indian Institute of Technology, Kanpur

3. Vector spaces 3.1 Linear dependence and independence 3.2 Basis and dimension. 5. Extreme points and basic feasible solutions

Duality Theory, Optimality Conditions

IE 400: Principles of Engineering Management. Simplex Method Continued

Lesson 27 Linear Programming; The Simplex Method

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations

Simplex Algorithm Using Canonical Tableaus

IE 5531: Engineering Optimization I

IE 400 Principles of Engineering Management. The Simplex Algorithm-I: Set 3

A primal-simplex based Tardos algorithm

Lecture 11: Post-Optimal Analysis. September 23, 2009

4. Duality and Sensitivity

3. Linear Programming and Polyhedral Combinatorics

Part 1. The Review of Linear Programming

Math Models of OR: Some Definitions

Midterm Review. Yinyu Ye Department of Management Science and Engineering Stanford University Stanford, CA 94305, U.S.A.

Linear programs Optimization Geoff Gordon Ryan Tibshirani

Math Models of OR: The Revised Simplex Method

Chapter 5 Linear Programming (LP)

Dual Basic Solutions. Observation 5.7. Consider LP in standard form with A 2 R m n,rank(a) =m, and dual LP:

AM 121: Intro to Optimization Models and Methods

Spring 2017 CO 250 Course Notes TABLE OF CONTENTS. richardwu.ca. CO 250 Course Notes. Introduction to Optimization

3. THE SIMPLEX ALGORITHM

Linear Programming. Larry Blume Cornell University, IHS Vienna and SFI. Summer 2016

MATH 445/545 Homework 2: Due March 3rd, 2016

Lecture Simplex Issues: Number of Pivots. ORIE 6300 Mathematical Programming I October 9, 2014

IE 5531: Engineering Optimization I

Introduction to Mathematical Programming IE406. Lecture 13. Dr. Ted Ralphs

AM 121: Intro to Optimization Models and Methods Fall 2018

The Simplex Method. Lecture 5 Standard and Canonical Forms and Setting up the Tableau. Lecture 5 Slide 1. FOMGT 353 Introduction to Management Science

Introduction to Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Linear Programming. Murti V. Salapaka Electrical Engineering Department University Of Minnesota, Twin Cities

4. Duality Duality 4.1 Duality of LPs and the duality theorem. min c T x x R n, c R n. s.t. ai Tx = b i i M a i R n

OPERATIONS RESEARCH. Linear Programming Problem

Linear Programming: Chapter 5 Duality

Linear & Integer programming

2.098/6.255/ Optimization Methods Practice True/False Questions

Lecture 10: Linear programming. duality. and. The dual of the LP in standard form. maximize w = b T y (D) subject to A T y c, minimize z = c T x (P)

II. Analysis of Linear Programming Solutions

Linear programming. Starch Proteins Vitamins Cost ($/kg) G G Nutrient content and cost per kg of food.

Transcription:

The dual simplex method with bounds Linear programming basis. Let a linear programming problem be given by min s.t. c T x Ax = b x R n, (P) where we assume A R m n to be full row rank (we will see in the section Starting basis how to make sure that this assumption holds). We first introduce the concept of a basis: There are n variables x j for j = {0,..., n 1}. A basis of (P) is a partition of {0,..., n 1} into three disjoint index subsets B, L and U, such that if B is the matrix formed by taking the columns of A indexed by B, then B is square and invertible. Thus, we always have B = m, and there are at most ( n m ) different bases, possibly less than that since some of the combinations may yield a singular B matrix. Given a specific basis, we establish some notation: For all j B the variable x j is called a basic variable, and the corresponding jth column of A is called a basic column. For all j L U the variable x j is called a nonbasic variable, and the corresponding jth column of A is called a nonbasic column. By convention, the vector formed by taking together all the basic variables is denoted x B. Similarly, c B, l B and u B are formed by taking together the same indices of c, l and u, respectively. The same notation is also used for the indices in L and U, giving c L, c U, l L, l U, u L, and u U. We already defined B as taking together the basic columns of A. The remaining (nonbasic) columns form the submatrices L and U. Thus, there is a permutation of the columns of A that is given by [B L U]. For conciseness, we will write A = [B L U], although it is an abuse of notation. B, L and U are sets, so the order of the indices does not matter. However, it must be consistent in the vectors defined above. For example, (i) c B1 must be the objective function coefficient associated with the variable x B1, (ii) l B1 and u B1 must be the bounds on that same variable, and (iii) the first column of B is the column of A that corresponds to that same variable. The concept of basis is useful because of the following construction: We construct a solution x of (P) as follows. Let us fix the components of x in L or U at their lower or upper bound, respectively: x L = l L and x U = u U. Given that these components are fixed, we can now compute the unique value of x B such that the equality constraints Ax = b of (P) are satisfied. Indeed, using the abuse of 1

notation described earlier, we have [B L U] x = b B x B + L x L + U x U = b B x B + Ll L + Uu U = b B x B = b Ll L Uu U x B = B 1 (b Ll L Uu U ). The solution x constructed above is uniquely defined by the partition B, L, U (i.e., by the basis). We now see why B was required to be an invertible matrix. Any solution x that can be constructed as above for some partition B, L, U is called a basic solution. If a basic solution x satisfies l x u, then it is called a basic feasible solution. Indeed, it satisfies all the constraints of (P). Note that the bound constraints are automatically satisfied for x L and x U, so it is enough to verify that l B x B u B. The feasible region of (P) is a polyhedron, and it has been shown that x is a basic feasible solution if and only if it is a vertex of that feasible region. In other words, basic feasible solutions and vertices are defined differently, but they are the same thing in the context of linear programming. Clearly, vertices are only a subset of all the feasible solutions to (P). However, in the context of optimization, it sufficient to look at vertices because of the following: If (P) has an optimal solution, then at least one optimal solution of (P) is a vertex. Tableau. A tableau is an equivalent reformulation of (P) that is determined by a given basis. It lets us easily assess the impact of changing the current basis (making a pivot) on (a) the objective function value, and (b) primal or dual feasibility. A tableau is given by min s.t. c T x Āx = b x R n. c T := c T c T B B 1 A are called the reduced costs corresponding to the basis B, L, U. They have the property that c B = 0, so c expresses the direction of the objective function only in terms of the nonbasic variables. b := B 1 b. Ā := B 1 A. If we use the partition Ā = [ B L Ū], we have that B = B 1 B = I. As a consequence, the 2

tableau can be written min c T L x L + c T U x U s.t. x B + Lx L + Ūx U = b x R n. We already saw above that the (primal) basic solution corresponding to a basis (and hence to a tableau) is given by x B = B 1 ( b L l L Uū U ). It is feasible if lb x B u B. In that case, we say that the basis is primal feasible. Duality. The dual of (P) is min b T π l T λ u T µ s.t. A T π + Iλ + Iµ = c π free λ 0, µ 0. (D) A basis of (D) is a partition of {1,..., 3n}. However, (D) has a special structure with two identity matrices in the constraints and no bounds on π. This yields a characterization of the bases of (D) that follows. A basis of (D) needs n basic variables, as many as there are equality constraints in (D). The π variables do not have bounds, so they are always basic. We now need to select n m basic variables among the λ and µ. For any given j, the variables λ j and µ j cannot be both basic, because if they were, the basis matrix would contain twice the same identity column, and thus would not be invertible (see Figure 1). So we have the following: Consider the n possible indices j {0,..., n 1}. For n m of them, either λ j or µ j is basic (but not both). For m of them, neither λ j nor µ j is basic. [A T I I] = j j Figure 1: The constraint matrix of (D) nonbasic nonbasic basis matrix Figure 2: A basis of (D) 3

Let use consider one of the latter values of j, i.e., one of the m values of j such that neither λ j nor µ j is basic. Then, the only nonzeros in the jth row of the basis matrix come from the jth row of A T (Figure 2). Now, considering all the m such value of j, they give a square submatrix of A T. That submatrix is also a submatrix of the basis matrix, with only zeros to its right. Since the basis matrix must be invertible, that square m m submatrix of A T must be invertible too. We now see that a basis of (D) is uniquely defined by a partition of {0,..., n 1} into three disjoint sets B, L, U such that B = m and if B T is the matrix formed by taking the rows of A T indexed by B, then B T is invertible. For every j L, λ j is basic, and for every j U, µ j is basic. Observe that the conditions for B, L, U to form a basis of (D) are exactly the same as the conditions for B, L, U to form a basis of (P). In order to construct a basic solution of (D), we partition A into [B L U]. Knowing that λ j = 0 for all j / L and µ j = 0 for all j / U, we rewrite the constraints as B T π = c B L T π + λ L = c L U T π + µ U = c U U T π free λ 0, µ 0. The π variables are all basic and their values can be computed directly as π T = c T B B 1. Then, the basic λ variables have values λ T L = ct L πt L = c T L ct B B 1 L and the basic µ variables have values µ T U = ct U πt U = c T L ct B B 1 U. For the basic solution ( π T, λ T, µ T ) to be feasible in (D), we need λ 0 and µ 0. The basis is then called dual feasible. Let c be the reduced costs in the corresponding primal tableau, i.e., c T := c T c T B B 1 A. It is easy to verify that ( π T, λ T, µ T ) is feasible if and only if c j 0 for all j L and c j 0 for all j U. Observe that these are the optimality condition of the simplex method on the primal (P). To derive the reduced costs of (D) for a given basis B, L, U, we need to express the objective function in terms of λ B, λ U, µ B, µ L only (the nonbasic variables). Let us write a partitioned version of (D) again, this time without discarding the nonbasic variables: min b T π l T B λ B l T L λ L l T U λ U u T B µ B u T L µ L u T U µ U s.t. B T π + λ B + µ B = c B L T π + λ L + µ L = c L U T π + λ U + µ U = c U U T π free λ 0, µ 0. This gives us π = B T (c B λ B µ B ) = (B T c B ) B T (λ B + µ B ) λ L = c L L T π µ L = (c L L T B T c B ) + L T B T (λ B + µ B ) µ L µ U = c U U T π λ U = (c U U T B T c B ) + U T B T (λ B + µ B ) λ U where the first term of each right-hand side is constant and can be ignored in an objective function. After rewriting the objective function and simplifying the result, we get min ( x B l B )λ B + (u U l U )λ U (u B x B )µ B (u L l L )µ L 4

where x B = B 1 (b Ll L Uu U ) corresponds to the primal basic solution associated with B, L, U. The optimality conditions of the simplex method in (D) are that the reduced costs for λ must be nonnegative and the reduced costs for µ must be nonpositive. Observe that we can always assume (u U l U ) 0 otherwise the problem is trivially infeasible. The conditions become x B l B and x B u B. Observe that they correspond exactly to the feasibility of the primal basic solution x associated with B, L, U. Pivoting. We can now apply the simplex method to (D). We need to start (and maintain) a basis B, L, U that is dual feasible, so we need B invertible, c j 0 for all j L and c j 0 for all j U. At the beginning of each iteration, we select a dual nonbasic variable λ B or µ B with a negative reduced cost to become a basic variable. If no such variable can be found, then we have reached optimality, and we can stop. Otherwise, let j B be the index of such a dual variable. Then at the next iteration, we will have either j L (if it was a component of λ B with a negative reduced cost) or j U (if it was a component of µ B with a negative reduced cost), i.e., that variable will be basic. That dual variable is said to enter the dual basis. In a primal view, this corresponds to finding a component j B of the primal basic solution x that is infeasible. At the next iteration, we will have j L or j U. When adopting a primal view, the very same operation is described as the primal variable x j leaving the primal basis. The next step is to choose a primal entering variable. We will choose this variable carefully in order to to maintain an invertible B matrix and reduced costs of the appropriate sign. Assume that the primal leaving variable x j is currently basic in row i (it corresponds to the basic variable x Bi ). Let us consider the objective and ith row of the current tableau: e L f L g U h U min c e x e + c f x f + c g x g + c h x h s.t. x j + ā ie x e + ā if x f + ā ig x g + ā ih x h = b i. x R n. where ā ie, ā ig > 0 and ā if, ā ih < 0. The four indices e, f, g, h represent the four possible configurations: variable at upper or lower bound, and ā ik positive or negative. We only use the notation e, f, g, h for simplicity: there can be zero or more than one variable in each configuration. All variables in one given configuration are treated similarly. Any ā ik = 0 can be ignored. They do not interfere with the computations below, and it can be shown that the B matrix of the next iteration will be invertible if and only if we do not consider the corresponding columns as candidate entering columns. Since e, f L and g, h U, we currently have c e, c f 0 and c g, c h 0. If x j leaves to its lower bound, we will need c j 0 at the next iteration, while maintaining zero reduced 5

costs for all other indices in B. Any such new objective function can be achieved by adding a nonnegative multiple t of the ith row of the tableau to the current objective function. The multiplier t will be called the dual step length. - We know that c e will become c e = c e + t ā ie, which is guaranteed to always meet c e 0 because ā ie > 0. - Instead, since ā if < 0, we will have c f = c f + t ā if 0 if and only if t c f /( ā if ). - For c g = c g + t ā ig 0, we need t c g /ā ig. - Finally, c h = c h + t ā ih 0 is guaranteed to always be met. If x j leaves to its upper bound, we will need c j 0 at the next iteration, while maintaining zero reduced costs for all other indices in B. Any such new objective function can be achieved by subtracting a nonnegative multiple t of the ith row of the tableau to the current objective function. - The condition c e = c e t ā ie 0 requires t c e /ā if. - The condition c f = c f t ā if 0 is always satisfied. - The condition c g = c g t ā ig 0 is always satisfied. - The condition c h = c h t ā ih 0 requires t ( c h )/( ā ih ). If the signs of the c k and ā ik coefficients are such that no conditions are imposed on t, it can be shown that (D) is unbounded, which corresponds to (P) being infeasible (note that, because of the finite bounds l and u, (P) is never unbounded). Each of the above conditions defines an upper bound t k on t, i.e., t t k for all k L U. The most restrictive condition can be selected by computing t = min k t k. If k is a value of k that yields the minimum, we will have c k = 0 and k can be our entering variable, i.e., we can set B = B \ {j} {k}. Finding k is called the ratio test. Figure 3 summarizes how to compute t k depending on the signs of ā ik and c k. j B k L U ā ik t k k L > 0 j L < 0 c k /( ā ik ) ( x j < l j ) k U > 0 ( c k )/ā ik < 0 k L > 0 c k /ā ik j U < 0 ( x j > u j ) k U > 0 < 0 ( c k )/( ā ik ) Figure 3: Computing the upper bounds t k on the dual step length t in the ratio test. Starting basis. Before we can apply the dual simplex method, we need to have a dual feasible basis. First, this means that we need a set of column indices B such that B is invertible. A simple way to obtain that is to add m 6

artificial variables z fixed to zero, as demonstrated in (P+): min s.t. c T x + 0 T z Ax + Iz = b 0 z 0 x R n, z R m (P+) We can do that as a very first step before starting the dual simplex method. Then, it is easier to let n := n + m, c T := [c T 0 T ], l T := [l T 0 T ], u T := [u T 0 T ] and A := [A I], so that you can forget about the z variables and have a problem of the form (P), but with the guarantee that the last m columns of A form an identity matrix (which is invertible: I 1 = I). Note that having an m m identity in A also ensures that A is full row rank. Once we have B, it is straightforward to construct L and U such that B, L, U is dual feasible. Having B is enough to compute the reduced costs c T = c T c T B B 1 A. For all j / B, we can assign j to L if c j 0 or to U if c j 0. This way, c j will always have the appropriate sign to ensure dual feasibility. Summary. We can now give, in Figure 4, a precise description of the operations in the dual simplex method with bounds. We can also make a few observation that will prove useful in implementing the dual simplex method. At Step 1, in most cases, there will be multiple candidate values of i such that x Bi violates its bounds. Choosing one to become the leaving variable is called a pricing rule. In theory, any candidate would work, but in practice it is a good idea to choose a candidate with a large bound violation, for example one with the largest violation. There are a few useful invariants in the dual simplex method that we can use to verify that our implementation is working as intended. First, we have the matrix B formed with the columns of A with indices in B. This matrix must always stay invertible. If B becomes singular, then the ratio test is not working properly. Specifically, we are choosing an entering variable k such that the tableau element ā ik is zero. Second, there is dual feasibility. We must always have c j 0 for all j L and c j 0 for all j U. If we lose dual feasibility, it also means that the ratio test is not working. In this case, we chose a wrong value for t k, not actually min k {t k }, something larger. Finally, recall that at any given iteration of the simplex method, we can compute the corresponding basic solution by letting x B = B 1 (b Ll L Uu U ), x L = l L and x U = u U. In the dual simplex method, x will not be feasible (until the last iteration, at which point we stop). However, we can still compute the corresponding dual obective function value: z = c T x. As the dual simplex method makes progress, this objective should be nondecreasing: from one iteration to the next, it either stays the same (when t = 0), or increases. If z decreases, it means that we made a mistake in the choice of the leaving variable. 7

Initialization Add m variables to the problem, fixed to zero by their bounds. From now on, only consider the enlarged problem: n := n + m, c T := [c T 0 T ], l T := [l T 0 T ], u T := [u T 0 T ] and A := [A I], where 0 T is a row vector of size m with all components set to zero. Build the starting basis: Set B := {n,..., n + m 1}. Form the corresponding basis matrix B. Compute c T = c T c T B B 1 A. For all j {0,..., n 1}, if c j > 0, set j L, if c j < 0, set j U, if c j = 0, we can arbitrarily select either j L or j U. Step 1 (leaving variable) Form the basis matrix B (from the columns of A indexed by B). Compute c T = c T c T B B 1 A. Compute x B = B 1 (b Ll L Uu U ). Find a component i of x B such that either x Bi < l Bi or x Bi > u Bi. If no such i exists, we reached optimality. Stop. Let j be such that x j corresponds to x Bi. Step 2 (entering variable) Compute the ith row of B 1 A. Perform the ratio test: compute k = argmin k L U {t k }, where t k is defined as in Figure 3. If there is no bound t k, the problem is infeasible. Stop. Step 3 (pivoting) Leaving variable: B := B \ {j} If x Bi < l Bi, then L := L {j}. If x Bi > u Bi, then U := U {j}. Entering variable: If k L, then L := L \ {k}. If k U, then U := U \ {k}. B := B {k} Go to Step 1. Figure 4: Summary of the dual simplex method with bounds. 8