Algorithmic Game Theory and Applications. Lecture 6: The Simplex Algorithm

Similar documents
CS675: Convex and Combinatorial Optimization Spring 2018 The Simplex Algorithm. Instructor: Shaddin Dughmi

The Simplex Algorithm

CMPSCI611: The Simplex Algorithm Lecture 24

Outline. CS38 Introduction to Algorithms. Linear programming 5/21/2014. Linear programming. Lecture 15 May 20, 2014

Notes taken by Mea Wang. February 11, 2005

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs

16.410/413 Principles of Autonomy and Decision Making

Linear Programming Motivation: The Diet Problem

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize.

Discrete Optimization. Lecture Notes 2

Lecture 16 October 23, 2014

CSC 8301 Design & Analysis of Algorithms: Linear Programming

Convex Optimization CMU-10725

A Subexponential Randomized Simplex Algorithm

An iteration of the simplex method (a pivot )

Subexponential lower bounds for randomized pivoting rules for the simplex algorithm

Subexponential Lower Bounds for the Simplex Algorithm

The simplex method and the diameter of a 0-1 polytope

Section Notes 5. Review of Linear Programming. Applied Math / Engineering Sciences 121. Week of October 15, 2017

POLYHEDRAL GEOMETRY. Convex functions and sets. Mathematical Programming Niels Lauritzen Recall that a subset C R n is convex if

DM545 Linear and Integer Programming. Lecture 2. The Simplex Method. Marco Chiarandini

Lesson 17. Geometry and Algebra of Corner Points

Lecture Notes 2: The Simplex Algorithm

15-451/651: Design & Analysis of Algorithms October 11, 2018 Lecture #13: Linear Programming I last changed: October 9, 2018

11 Linear Programming

Linear programming II João Carlos Lourenço

Linear Programming. Readings: Read text section 11.6, and sections 1 and 2 of Tom Ferguson s notes (see course homepage).

Linear Programming. Widget Factory Example. Linear Programming: Standard Form. Widget Factory Example: Continued.

MATH 310 : Degeneracy and Geometry in the Simplex Method

Linear Programming Duality and Algorithms

J Linear Programming Algorithms

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang

Submodularity Reading Group. Matroid Polytopes, Polymatroid. M. Pawan Kumar

Homework 2: Multi-unit combinatorial auctions (due Nov. 7 before class)

Linear Programming: Introduction

Linear Programming Terminology

AM 121: Intro to Optimization Models and Methods Fall 2017

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

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18

AMATH 383 Lecture Notes Linear Programming

(67686) Mathematical Foundations of AI July 30, Lecture 11

Linear Programming. them such that they

College of Computer & Information Science Fall 2007 Northeastern University 14 September 2007

MA4254: Discrete Optimization. Defeng Sun. Department of Mathematics National University of Singapore Office: S Telephone:

Linear Programming. Linear Programming. Linear Programming. Example: Profit Maximization (1/4) Iris Hui-Ru Jiang Fall Linear programming

New Directions in Linear Programming

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14

Lecture 4: Linear Programming

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 29

Linear Programming 1

Duality. Primal program P: Maximize n. Dual program D: Minimize m. j=1 c jx j subject to n. j=1. i=1 b iy i subject to m. i=1

LECTURE 6: INTERIOR POINT METHOD. 1. Motivation 2. Basic concepts 3. Primal affine scaling algorithm 4. Dual affine scaling algorithm

An introduction to pplex and the Simplex Method

Notes for Lecture 18

Chapter 1 Linear Programming. Paragraph 4 The Simplex Algorithm

Advanced Operations Research Techniques IE316. Quiz 2 Review. Dr. Ted Ralphs

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

Copyright 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch.

Lecture 9: Linear Programming

Introduction to Linear Programming

Advanced Linear Programming. Organisation. Lecturers: Leen Stougie, CWI and Vrije Universiteit in Amsterdam

Polytopes, their diameter, and randomized simplex

CSE 417 Network Flows (pt 4) Min Cost Flows

Linear Programming. Larry Blume. Cornell University & The Santa Fe Institute & IHS

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 36

16.410/413 Principles of Autonomy and Decision Making

Linear Programming Algorithms [Read Chapters G and H first.] Status: Half-finished.

Linear Optimization. Andongwisye John. November 17, Linkoping University. Andongwisye John (Linkoping University) November 17, / 25

Introduction to Mathematical Programming IE496. Final Review. Dr. Ted Ralphs

3. The Simplex algorithmn The Simplex algorithmn 3.1 Forms of linear programs

On the Complexity of the Policy Improvement Algorithm. for Markov Decision Processes

1. Lecture notes on bipartite matching

Combinatorial Optimization

Part 4. Decomposition Algorithms Dantzig-Wolf Decomposition Algorithm

4 Integer Linear Programming (ILP)

1 Linear programming relaxation

Artificial Intelligence

Steven Skiena. skiena

The Simplex Algorithm for LP, and an Open Problem

Open problems in convex optimisation

Optimization of Design. Lecturer:Dung-An Wang Lecture 8

COLUMN GENERATION IN LINEAR PROGRAMMING

Lecture 2 - Introduction to Polytopes

Lecture 21: Other Reductions Steven Skiena

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748

Integral Geometry and the Polynomial Hirsch Conjecture

Math 5593 Linear Programming Lecture Notes

Linear programming and duality theory

EARLY INTERIOR-POINT METHODS

Lecture 21: Other Reductions Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

Lecture 4: 3SAT and Latin Squares. 1 Partial Latin Squares Completable in Polynomial Time

Linear Programming in Small Dimensions

MATHEMATICS II: COLLECTION OF EXERCISES AND PROBLEMS

Some Advanced Topics in Linear Programming

Linear and Integer Programming :Algorithms in the Real World. Related Optimization Problems. How important is optimization?

Linear programming and the efficiency of the simplex algorithm for transportation polytopes

Math 273a: Optimization Linear programming

Programming, numerics and optimization

An example of LP problem: Political Elections

Transcription:

Algorithmic Game Theory and Applications Lecture 6: The Simplex Algorithm Kousha Etessami

Recall our example 1 x + y <= 6 2 x + y = 4 y <= 4 2 x + y = 8 2 x + y = 11 x <= 5 (2,4) "vertex" y "edge" (5,1) "vertex" (0,0) "edge" x Note that: Starting at (0, 0), we can find the optimal vertex (5,1), by repeatedly moving from a vertex to a neighboring vertex (by crossing an edge ) that improves the value of the objective function. We don t seem to get stuck in any locally optimal vertex, at least in this trivial example. That s the geometric idea of simplex.

geometric idea of simplex 2 Input: Given (f,opt, C), and given some start vertex x K(C) R n. (Never mind, for now, that we have no idea how to find x K(C) -or even whether C is Feasible!- let alone a vertex x.) While (x has some neighbor vertex, x K(C), such that f(x ) > f(x)) Pick such a neighbor x. Let x := x. (If neighbor at infinity, Output: Unbounded.) Output: x := x, and f(x ) is optimal value. Question: Why should this work? Why don t we get stuck in some local optimum? Key reason: The region K(C) is convex, meaning if x, y K(C) then every point z on the line segment between x and y is also in K(C). (Recall: K is convex iff x, y K λx + (1 λ)y K, for λ [0, 1].) On a convex region, a local optimum of a linear objective is always the global optimum. Ok. The geometry sounds nice and simple. But realizing it algebraically is not a trivial matter!

LP s in Primal Form Using the simplification rules from the last lecture, we can convert any LP into the following form: Maximize c 1 x 1 + c 2 x 2 +... + c n x n + d Subject to: a 1,1 x 1 + a 1,2 x 2 +... + a 1,n x n b 1 a 2,1 x 1 + a 2,2 x 2 +... + a 2,n x n b 2............ a m,1 x 1 + a i,2 x 2 +... + a m,n x n b m x 1,...,x n 0 Aside: You may be wondering why we are carrying along the constant d in the objective f(x): It doesn t affect the optimality of a solution. (Although it does shift the value of a solution by d.) We do so for convenience, to become apparent later. 3

slack variables We can add a slack variable y i to each inequality, to get equalities: Maximize c 1 x 1 + c 2 x 2 +... + c n x n + d Subject to: a 1,1 x 1 + a 1,2 x 2 +... + a 1,n x n + y 1 = b 1 a 2,1 x 1 + a 2,2 x 2 +... + a 2,n x n + y 2 = b 2...... a m,1 x 1 + a i,2 x 2 +... + a m,n x n + y m = b m x 1,...,x n 0; y 1,...,y m 0 The two LPs are equivalent. (Explanation.) The new LP has some particularly nice properties: 1. Every equality constraint C i has at least one variable on the left with coefficient 1 and which doesn t appear in any other equality constraint. 2. Picking one such variable for each equality, we obtain a set of m variables B called a Basis. An obvious basis above is B = {y 1,...,y m }. 3. Objective f(x) involves only non-basis variables. Let us call an LP in such a form a dictionary. 4

Basic Feasible Solutions Rewrite our dictionary (renaming y i, x n+i ) as: Maximize c 1 x 1 + c 2 x 2 +... + c n x n + d Subject to: x n+1 = b 1 a 1,1 x 1 a 1,2 x 2... a 1,n x n x n+2 = b 2 a 2,1 x 1 a 2,2 x 2... a 2,n x n...... x n+m = b m a m,1 x 1 a i,2 x 2... a m,n x n x 1,...,x n+m 0 Suppose, somehow, b i 0 for all i = 1,...,m. Then we have what s called a feasible dictionary and a feasible solution for it, namely, let x n+i = b i, for i = 1,...,m, and let x j = 0, for j = 1,...,n. The value is f(0) = d! Call this a basic feasible solution(bfs),with basis B. Geometry: A BFS corresponds to a vertex. (But different Bases B may yield the same BFS!) Question: How do we move from one BFS with basis B to a neighboring BFS with basis B? Answer: Pivoting! 5

Pivoting Suppose our current dictionary basis (the variables on the left) is B = {x i1,...,x im }, with x ir the variable on the left of constraint C r. The following pivoting procedure moves us from basis B to basis B := (B \ {x ir }) {x j }. Pivoting to add x j and remove x ir from basis B: 1. Assuming C r involves x j, rewrite C r as x j = α. 2. Substitute α for x j in all other constraints C l, obtaining C l. 3. The new constraints C, have a new basis: B := (B \ {x ir }) {x j }. 4. Also substitute α for x j in f(x), so that f(x) again only depends on variables not in the new basis B. This new basis B is a possible neighbor of B. However, not every such basis B is eligible! 6

sanity checks for pivoting To check eligibility of a pivot, we have to make sure: 1. The new constants b i remain 0, so we retain a feasible dictionary, and thus B yields a BFS. 2. The new BFS must improve, or at least must not decrease, the value d = f(0) of the new objective function. (Recall, all non-basic variables are set to 0 in a BFS, thus f(bfs) = f(0).) 3. We should also check for the following situations: Suppose all non-basic variables involved in f(x) have negative coefficients. Then any increase from 0 in these variables will decrease the objective. We are thus (it turns out) at an optimal BFS x. Output: Optimal solution: x and f(x ) = f(0) = d. Suppose there is a non-basic variable x j in f(x) with coefficient c j > 0, and such that the coefficient of x j in every constraint C r is also 0. Then we can increase x j, and the objective value, to infinity without violating any constraints. So, Output: Feasible but Unbounded. 7

finding and choosing eligible pivots 8 In principle, we could exhaustively check the sanity conditions for eligibility of all potential pairs of entering and leaving variables. There are at most (n m) candidates. But, there are much more efficient ways to choose pivots, by inspection of the coefficients in the dictionary. We can also efficiently choose pivots according to lots of additional criteria, or pivoting rules, such as, e.g., most improvement in objective value, etc. There are many such rules, and it isn t clear a priori what is best.

The Simplex Algorithm Dantzig s Simplex algorithm can be described as follows: 9 Input: a feasible dictionary; Repeat 1. Check if we are at an optimal solution, and if so, Halt and output the solution. 2. Check if we have an infinity neighbor, and if so Halt and output Unbounded. 3. Otherwise, choose an eligible pivot pair of variables, and Pivot! Fact If this halts the output is correct: an output solution is an optimal solution of the LP. Oops! We could cycle back to the same basis for ever, never strictly improving by pivoting. There are several ways to address this problem...

how to prevent cycling 10 Several Solutions: Carefully choose rules for variable pairs to pivot at, in a way that forces cycling to never happen. Fact: This can be done. (For example, use Bland s rule : For all eligible pivot pairs (x i,x j ), where x i is being added the basis and x j is being removed from it, choose the pair such that, first, i is as small as possible, and second, j is as small as possible.) Choose randomly among eligible pivots. With probability 1, you ll eventually get out and to an optimal BFS. Perturb the constraints slighty to make the LP non-degenerate. (More rigorously, implement this using, e.g., the lexicographic method.)

the geometry revisited 11 Moving to a neighboring basis by pivoting roughly corresponds to moving to a neighboring vertex. However, this is not literally true because several Bases can correspond to the same BFS, and thus to the same vertex. We may not have any neighboring bases that strictly improve the objective, and yet still not be optimal, because all neighoring bases B describe the same BFS from a different point of view. pivoting rules can be designed so we never return to the same point of view twice. choosing pivots randomly guarantees that we eventually get out. properly perturbing the constraints makes sure every BFS corresponds to a unique basis (i.e., we are non-degenerate), and thus bases and vertices are in 1-1 correspondence.

Hold on! What about finding an initial BFS? So far, we have cheated: we have assumed we start with an initial feasible dictionary, and thus have an initial BFS. Recall, the LP may not even be feasible! Luckily, it turns out, it is as easy (using Simplex) to find whether a feasible solution exists (and if so to find a BFS) as it is to find the optimal BFS given an initial BFS... 12

checking feasibility via simplex Consider the following new LP: 13 Maximize x 0 Subject to: a 1,1 x 1 + a 1,2 x 2 +... + a 1,n x n x 0 b 1 a 2,1 x 1 + a 2,2 x 2 +... + a 2,n x n x 0 b 2...... a m,1 x 1 + a i,2 x 2 +... + a m,n x n x 0 b m x 0,x 1,...,x n 0 This LP is feasible: let x 0 = min{b 1,...,b m, 0}, x j = 0, for j = 1,...,n. We can also set up a feasible dictionary, and thus initial BFS, for it by introducing slack variables in an appropriate way. Key point: the original LP is feasible if and only if in an optimal solution to the new LP, x 0 = 0. It also turns out, it is easy to derive a BFS for the original LP from an optimal BFS for this new LP. (In fact, finding an optimal solution given a feasible solution can also be reduced to checking whether a feasible solution exists.)

how efficient is simplex? 14 Each pivoting iteration can be performed in O(mn) arithmetic operations. Also, it can be shown that the coefficients never get too large (they stay polynomialsized), as long as rational coefficients are kept in reduced form (e.g., removing common factors from numerator and denominator). So, each pivot can be done in polynomial time. How many pivots are required to get to the optimal solution? Unfortunately, it can be exponentially many! In fact, for most pivoting rules known, there exist worst case examples that force exponentially many iterations. (E.g., the Klee-Minty (1972) skewed hypercube examples.) Fortunately, simplex tends to be very efficient in practice: requiring O(m) pivots on typical examples.

more on theoretical efficiency 15 It is an open problem whether there exists a pivoting rule that achieves polynomially many pivots on all LPs. A randomized pivoting rule is known that requires m O( n) expected pivots [Kalai 92], [Matousek- Sharir-Welzl 92]. Is there, in every LP, a polynomial-length path via edges from every vertex to every other? Without this, there can t be any polynomial pivoting rule. This diameter is conjecturally O(m), but the best known is m O(log n) [Kalai-Kleitman 92]. Hirsch conjecture: m n, disproved [Santos 10]. Breakthrough: [Khachian 79] proved the LP problem does have a polynomial time algorithm, using a completely different approach: The Ellipsoid Algorithm. The ellipsoid algorithm is theoretically very important, but it is not practical. Breakthrough: [Karmarkar 84] gave a completely different P-time algorithm, using the interiorpoint method. Karmarkar s algorithm is competitive with simplex in many cases.

final remarks and food for thought 16 Why is the Simplex algorithm so fast in practice? Some explanation is offered by [Borgwardt 77] s average case analysis of Simplex. More convincing explanation is offered by [Spielman-Teng 2001] s smoothed analysis of Simplex (not light reading ). Ok. Enough about Simplex. So we now have an efficient algorithm for, among other things, finding minimax solutions to 2-player zero-sum games. Next time, we will learn about the very important concept of Linear Programming Duality. LP Duality is closely related to the Minimax theorem, but it has far reaching consequences in many subjects. Food for thought: Suppose you have a solution to an LP in Primal Form, and you want to convince someone it is optimal. How would you do it?