The Avis-Kalunzy Algorithm is designed to find a basic feasible solution (BFS) of a given set of constraints. Its input: A R m n and b R m such that

Similar documents
Simplex Algorithm Using Canonical Tableaus

Linear Programming. Linear Programming I. Lecture 1. Linear Programming. Linear Programming

The Simplex Algorithm

Linear Programming, Lecture 4

Supplementary lecture notes on linear programming. We will present an algorithm to solve linear programs of the form. maximize.

IE 400: Principles of Engineering Management. Simplex Method Continued

Review Solutions, Exam 2, Operations Research

Motivating examples Introduction to algorithms Simplex algorithm. On a particular example General algorithm. Duality An application to game theory

Ann-Brith Strömberg. Lecture 4 Linear and Integer Optimization with Applications 1/10

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

LINEAR PROGRAMMING I. a refreshing example standard form fundamental questions geometry linear algebra simplex algorithm

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

Lecture slides by Kevin Wayne

Summary of the simplex method

3 The Simplex Method. 3.1 Basic Solutions

TIM 206 Lecture 3: The Simplex Method

The simplex algorithm

Slide 1 Math 1520, Lecture 10

Farkas Lemma, Dual Simplex and Sensitivity Analysis

Chapter 1 Linear Programming. Paragraph 5 Duality

Optimization (168) Lecture 7-8-9

The Simplex Method. Standard form (max) z c T x = 0 such that Ax = b.

Section Notes 9. IP: Cutting Planes. Applied Math 121. Week of April 12, 2010

III. Linear Programming

Lesson 27 Linear Programming; The Simplex Method

Prelude to the Simplex Algorithm. The Algebraic Approach The search for extreme point solutions.

Duality Theory, Optimality Conditions

CO350 Linear Programming Chapter 8: Degeneracy and Finite Termination

Math Models of OR: Some Definitions

Notes on Simplex Algorithm

9.1 Linear Programs in canonical form

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

MVE165/MMG631 Linear and integer optimization with applications Lecture 5 Linear programming duality and sensitivity analysis

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

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

Lecture 5. x 1,x 2,x 3 0 (1)

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

Week 2. The Simplex method was developed by Dantzig in the late 40-ties.

Developing an Algorithm for LP Preamble to Section 3 (Simplex Method)

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

MAT016: Optimization

CSC373: Algorithm Design, Analysis and Complexity Fall 2017 DENIS PANKRATOV NOVEMBER 1, 2017

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

Part III: A Simplex pivot

Summary of the simplex method

A Review of Linear Programming

CSC Design and Analysis of Algorithms. LP Shader Electronics Example

February 17, Simplex Method Continued

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

3. THE SIMPLEX ALGORITHM

Introduction to optimization

1 Review Session. 1.1 Lecture 2

The Primal-Dual Algorithm P&S Chapter 5 Last Revised October 30, 2006

Chapter 5 Linear Programming (LP)

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

Systems Analysis in Construction

M340(921) Solutions Problem Set 6 (c) 2013, Philip D Loewen. g = 35y y y 3.

Chapter 3, Operations Research (OR)

Discrete Optimization

CO350 Linear Programming Chapter 8: Degeneracy and Finite Termination

Linear programs, convex polyhedra, extreme points

Understanding the Simplex algorithm. Standard Optimization Problems.

4.5 Simplex method. LP in standard form: min z = c T x s.t. Ax = b

F 1 F 2 Daily Requirement Cost N N N

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

AM 121: Intro to Optimization

ORF 522. Linear Programming and Convex Analysis

Lecture: Algorithms for LP, SOCP and SDP

Lecture 4: Algebra, Geometry, and Complexity of the Simplex Method. Reading: Sections 2.6.4, 3.5,

CSCI 1951-G Optimization Methods in Finance Part 01: Linear Programming

Optimization methods NOPT048

An introductory example

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)

ORF 307: Lecture 2. Linear Programming: Chapter 2 Simplex Methods

2.098/6.255/ Optimization Methods Practice True/False Questions

15-780: LinearProgramming

CSCI5654 (Linear Programming, Fall 2013) Lecture-8. Lecture 8 Slide# 1

Lectures 6, 7 and part of 8

Lecture 5 Simplex Method. September 2, 2009

The Simplex Algorithm: Technicalities 1

MATH 445/545 Test 1 Spring 2016

4.3 Minimizing & Mixed Constraints

OPTIMISATION 3: NOTES ON THE SIMPLEX ALGORITHM

Linear programs Optimization Geoff Gordon Ryan Tibshirani

Example Problem. Linear Program (standard form) CSCI5654 (Linear Programming, Fall 2013) Lecture-7. Duality

Today s class. Constrained optimization Linear programming. Prof. Jinbo Bi CSE, UConn. Numerical Methods, Fall 2011 Lecture 12

AM 121: Intro to Optimization Models and Methods

Simplex Method for LP (II)

Section Notes 8. Integer Programming II. Applied Math 121. Week of April 5, expand your knowledge of big M s and logical constraints.

IE 5531: Engineering Optimization I

"SYMMETRIC" PRIMAL-DUAL PAIR

Lecture 2: The Simplex method

Linear Programming. Chapter Introduction

LINEAR PROGRAMMING. Relation to the Text (cont.) Relation to Material in Text. Relation to the Text. Relation to the Text (cont.

CO 250 Final Exam Guide

Lecture 13: Linear programming I

Week 3: Simplex Method I

Math 354 Summer 2004 Solutions to review problems for Midterm #1

4.5 Simplex method. min z = c T x s.v. Ax = b. LP in standard form

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

Transcription:

Lecture 4 Avis-Kaluzny and the Simplex Method Last time, we discussed some applications of Linear Programming, such as Max-Flow, Matching, and Vertex-Cover. The broad range of applications to Linear Programming means that we require efficient algorithms to solve it. 4.1 The Avis-Kaluzny Algorithm The Avis-Kalunzy Algorithm is designed to find a basic feasible solution (BFS) of a given set of constraints. Its input: A R m n and b R m such that Ax b x 0 Note that this algorithm requires the nonnegativity constraint to be present. The algorithm proceeds as follows: 4.1.1 The Algorithm Terminology The set of equations obtained in step 1 is called the tableau or dictionary. The set basic variables B is a set of variables, initially a set of slack variables, which has the property that each variable is alone on one side of each equation. All other variables are called non-basic variables. A basic variable is said to exit the basis when step 4 causes it to no longer be a basic variable, and a non-basic variable is said to enter the basis when step 4 causes it to become a basic variable. Starting the algorithm: * Lecturer: Ryan O Donnell. Scribe: Aaron Snook. 1

Step 1: Slack Introduce slack variables x n+1...x n+m for each of the inequalities in A, turning them into equations. Obviously, but importantly, like the other variables, these slack variables also must be nonnegative. Step 2: Try it Set all non-basic variables to 0, and see if this results in a BFS (does this cause the basic variables to be positive?) If it is, output the value of each variable under this assignment (or just the non-slack variables). Step 3: B-rule Take the basic variable of minimum index that is negative in the assignment in step 2; call it x b. On the other side of the selected equation, if all coefficients are negative, return this equation as evidence that the equation is INFEASIBLE. Otherwise, select the non-basic variable of minimum index that has a positive coefficient; call it x n. Step 4: Pivot Solve the selected equation for x n in Step 3. This means that x n enters the basis, and x b exits the basis. For every instance of x n in other equations, substitute the other side of the selected equation. Go to step 2. 4.1.2 Example Suppose we were given the following set of equations: x 1 + 2x 2 6 2x 1 + x 2 6 2x 1 + 2x 2 7 x 1, x 2 0 After performing step 1, our tableau is: x 3 = x 1 2x 2 + 6 x 4 = 2x 1 x 2 + 6 x 5 = 2x 1 + 2x 2 7 We perform step 2: Set non-basic variables to 0. In this case, x 1 and x 2 are our non-basic variables. This means that x 3 = 6 x 4 = 6 x 5 = 7 This is not feasible as x 5 < 0. x 5 is the lowest-indexed variable below 0, so we proceed to step 3. We select the equation x 5 = 2x 1 + 2x 2 7 and note x 1 has a positive coefficient, so 2

we select it for the pivot step. We perform step 4 and solve for x 1 : x 1 = 1x 2 5 x 2 + 7. Go to step 2. 2 Our tableau is currently: We set non-basic variables to 0. x 3 = 1 2 x 5 x 2 + 5 2 x 4 = x 5 + x 2 1 x 1 = 1 2 x 5 x 2 + 7 2 x 3 = 5 2 x 4 = 1 x 1 = 7 2 x 1, x 2, x 3, x 4, x 5 0 This is not a basic feasible solution. We continue, selecting x 2 to pivot about x 4 : With the basic variables set to 0, we obtain x 3 = 3 2 x 5 x 4 + 3 2 x 2 = x 5 + x 4 + 1 x 1 = 1 2 x 5 x 4 + 5 2 x 3 = 3 2 x 2 = 1 x 1 = 5 2 Thus the solution x 1 = 5 2, x 2 = 1, x 3 = 3 2, x 4 = 0, x 5 = 0 works and we return x 1 = 5 2, x 2 = 1 It can be verified that this is a solution of the original problem. 4.1.3 Correctness Step 2 At each stage, a satisfying assignment to the tableau also satisfies the original tableau, as each tableau is a linear combination of previous tableaus. 3

Step 3 Suppose that you have an equation where the basic variable is negative when all non-basic variables are 0, and the coefficient of all non-basic variables is negative. This means that if the non-basic variables in the equation are non-negative, the basic variable is a sum of nonpositive terms, at least one of which is negative, and thus it is impossible to make the basic variable positive, thus making the entire system infeasible. The most important thing to verify about this algorithm is that it actually terminates. Theorem 4.1. The Avis-Kaluzny algorithm terminates. Proof. First of all, note that there are only finitely many possible tableaus for any given set of constraints, as a set of basic variables uniquely determines a tableau given a set of initial constraints. So if this algorithm does not terminate, there must be a cycle among the possible tableaus. Suppose that we have a cycle in the set of possible tableaus. We will assume that x n+m enters and leaves the basis during this cycle. Justification Suppose that x n+m does not enter and leave the basis during this cycle. Then it follows that the tableau formed by removing x n+m in all equations (remove the equation containing x n+m if x n+m is a basic variable, and remove all instances of x n+m from all equations otherwise) will also cycle, and we consider that tableau instead. When x n+m enters the basis, there must be an equation of the form x b = k + c a x a + c m+n x m+n a {1..m+n} where c i for all i {1..m + n} is the coeffient of x i in this equation, k is a constant, c i 0 for all i < m + n, k < 0, and x b is the basis variable. k < 0 because x b must be negative when the non-basic variables are 0, and x i for all i < m+n must be nonpositive as otherwise they would be chosen over x m+n to be the pivot. This means that every solution to these equations with x 1...x n+m 1 0 has x n+m > 0; otherwise x b would be a sum of nonpositive values with at least one negative term. When x n+m leaves, if all non-basic variables are set to 0, as x n+m is lexicographically last, all basic variables must be nonnegative on this assignment in order for x n+m to be chosen. This is an assignment such that x 1...x n+m 1 0 but x n+m < 0, contradicting the fact we proved when x n+m entered the basis! By contradiction, there is no cycle in the set of possible tableaus, and therefore the Avis- Kaluzny algorithm terminates. 4

4.2 The Simplex Algorithm The Simplex algorithm is an algorithm that steps from a BFS to a better BFS, improving the quantity that we are trying to maximize (or minimize) at every step of the way. Its input: A R m n, b, c R m such that 4.2.1 The algorithm max s.t. c x Ax b x 0 Step 1: Slack Introduce slack variables x n+1...x n+m for each of the inequalities in A, turning them into equations. This equations become your extended tableau, which is simply a tableau with the maximizing condition added on. You assume that you already have a BFS in the sense that you assume that if all non-basic variables are set to 0, then the basic variables will be non-negative. Step 2: Improve In the expression to maximize, select a variable with a positive coefficient. This is called the improving variable. If this does not exist, then simply set all basic variables to Step 3: Pivot Pivot on the equation that limits the improving variable the most (sets the lowest upper bound on it) by solving for the improving variable in that equation and then substituting for that variable in all other equations, including the equation for the quantity to be improved. Note that the upper bounds are conservative and assume that other variables are 0. If there is no limit on the improving variable, there is no limit to the quantity that needs to be maximized either. 4.2.2 Intuition This algorithm can be viewed as crawling along the edges of the polytope representing the set of feasible solutions. In particular, this figure represents the crawl that we perform below. 5

Figure 4.1: The traversal through the polytope in the Simplex example 4.2.3 Example Consider the following equation: max z = x 1 + x 2 s.t x 1 + x 2 1 x 2 2 x 1 3 x 1, x 2 0 In step 1, we would make the following extended tableau: max z = x 1 + x 2 s.t x 3 = 1 + x 1 x 2 x 4 = 3 x 1 x 5 = 2 x 2 Note this state represents the BFS 0 in Figure 4.1. as when the non-basic variables are set to 0 x 1 = x 2 = 0. In step 2, suppose that we choose x 2 as our improving variable. Note that x 3 = 1+x 1 x 2 limits x 2 to 1 as we assume x 1 is 0 for these purposes (we do not want to introduce an equation that causes a negative basic variable when non-basic variables are set to 0). x 5 = 2 x 2 limits x 2 to 2 but this is not as strict of a bound. x 4 = 3 x 1 does not relate to x 2. In step 3, we pivot, so the tablau now looks like this: 6

max z = 1 + 2x 1 x 3 s.t x 2 = 1 + x 1 x 3 x 4 = 3 x 1 x 5 = 1 x 1 + x 3 Note this represents the BFS 1 in Figure 4.1, as when the non-basic variables are set to 0 x 1 = 0 and x 2 = 1. Now, we must choose x 1 as our improving variable. x 1 is not limited by the x 2 equation, but is limited to 3 by the x 4 equation and 1 by the x 5 equation. So we pivot on the x 5 equation to obtain the tableau max z = 3 2x 5 + x 3 s.t x 2 = 2 x 5 x 4 = 2 x 3 + x 5 x 1 = 1 x 5 + x 3 Note this represents the BFS 2 in Figure 4.1, as when the non-basic variables are set to 0 x 1 = 1 and x 2 = 2. We choose x 3 as the improving variable. It is limited to 2 by the x 4 but is not limited by the x 1 equation. So we pivot on the x 4 equation: max z = 5 x 5 x 4 s.t x 2 = 2 x 5 x 3 = 2 x 4 + x 5 x 1 = 3 x 4 Note this represents the BFS 3 in Figure 4.1, as when the non-basic variables are set to 0 x 1 = 3 and x 2 = 2. Notice this point is optimal. There is no improving variable anymore, so we set x 5 = 0, x 4 = 0 and thus x 3 = 2, x 2 = 2, x 1 = 3, and so we return x 1 = 3 and x 2 = 2 as the optimal solution. 4.2.4 Issues Unbounded? If this is the case, there will at some point be an improving variable that has no constraints on it. 7

No improvement? If you get an upper bound of 0 on a variable, your pivot will not increase the quality of the solution by making the non-basic variables 0. Simply continue on in this case. It is possibile for the simplex algorithm to stall! (see the homework) Also, there are a few choices that you have to make in this algorithm. In step 2, there are often several improving variables to choose. In step 3, how do you resolve ties between two equally constraining equations? These choices actually affect some key runtime properties of the Simplex algorithm. Pivoting Rule(choice of improving variable) Can cycle? Can take exponential time? Largest Coefficient Yes Yes Largest Increase Yes Yes Steepest-Edge(most parralel to obj. vector) Yes Yes Lexicographical Rules (Bland s rules) No! Yes Least-Entered Yes Yes Clairvoyant (we know best route to opt.) Yes? Hirch s Conjecture stated that the edge-vertex graph of any polytope with n points in d-dimensional space has diameter at most n-d, which implies that a clairvoyant Simplex algorithm could reach the optimum in linear time. This was disproven in 2010 by Francisco Santos Leal, but it is still possible (and an open problem) whether or not the diameter of a polytope is polynomial in the number of points. 8