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

Size: px
Start display at page:

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

Transcription

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

2 CS 473: Algorithms, Spring 2018 Introduction to Linear Programming Lecture 18 March 26, 2018 Some of the slides are courtesy Prof. Chekuri Ruta (UIUC) CS473 2 Spring / 50

3 Part I Introduction to Linear Programming Ruta (UIUC) CS473 3 Spring / 50

4 Today... Linear Programming and Standard Formulation Geometry Vertex Solution Simplex Method Ruta (UIUC) CS473 4 Spring / 50

5 A Factory Example Problem Your factory can produce Laptop and iphone using Copper. 1 One ton of Copper one Laptop 2 One ton of Copper one iphone 3 We have 200 tons of Copper. 4 Laptop can be sold for $1 and iphone for $6. Ruta (UIUC) CS473 5 Spring / 50

6 A Factory Example Problem Your factory can produce Laptop and iphone using Copper. 1 One ton of Copper one Laptop 2 One ton of Copper one iphone 3 We have 200 tons of Copper. 4 Laptop can be sold for $1 and iphone for $6. How many units of Laptop and iphone should your factory manufacture to maximize profit? Ruta (UIUC) CS473 5 Spring / 50

7 A Factory Example Problem Your factory can produce Laptop and iphone using Copper. 1 One ton of Copper one Laptop 2 One ton of Copper one iphone 3 We have 200 tons of Copper. 4 Laptop can be sold for $1 and iphone for $6. How many units of Laptop and iphone should your factory manufacture to maximize profit? Solution: Ruta (UIUC) CS473 5 Spring / 50

8 A Factory Example Problem Your factory can produce Laptop and iphone using Copper. 1 One ton of Copper one Laptop 2 One ton of Copper one iphone 3 We have 200 tons of Copper. 4 Laptop can be sold for $1 and iphone for $6. How many units of Laptop and iphone should your factory manufacture to maximize profit? Solution: manufacture only iphone Ruta (UIUC) CS473 5 Spring / 50

9 A Factory Example Problem Your factory can produce Laptop and iphone using resources C, B, A. 1 One unit of A and C each One Laptop 2 One unit of B and C each One iphone Ruta (UIUC) CS473 6 Spring / 50

10 A Factory Example Problem Your factory can produce Laptop and iphone using resources C, B, A. 1 One unit of A and C each One Laptop 2 One unit of B and C each One iphone 3 We have 200 units of A, 300 units of B, and 400 units of C. 4 Product Laptop can be sold for $1 and product iphone for $6. Ruta (UIUC) CS473 6 Spring / 50

11 A Factory Example Problem Your factory can produce Laptop and iphone using resources C, B, A. 1 One unit of A and C each One Laptop 2 One unit of B and C each One iphone 3 We have 200 units of A, 300 units of B, and 400 units of C. 4 Product Laptop can be sold for $1 and product iphone for $6. How many units of Laptop and iphone should your factory manufacture to maximize profit? Solution: Ruta (UIUC) CS473 6 Spring / 50

12 A Factory Example Problem Your factory can produce Laptop and iphone using resources C, B, A. 1 One unit of A and C each One Laptop 2 One unit of B and C each One iphone 3 We have 200 units of A, 300 units of B, and 400 units of C. 4 Product Laptop can be sold for $1 and product iphone for $6. How many units of Laptop and iphone should your factory manufacture to maximize profit? Solution: Formulate as a linear program. Ruta (UIUC) CS473 6 Spring / 50

13 A Factory Example Problem Can produce Laptop and iphone, using resources A, B, C. 1 A, C Laptop 2 B, C iphone 3 Have A: 200, B: 300, and C: Price of L: $1, and ip: $6. How many units to manufacture to max profit? Ruta (UIUC) CS473 7 Spring / 50

14 A Factory Example Problem Can produce Laptop and iphone, using resources A, B, C. 1 A, C Laptop Suppose x 1 units of Laptop and x 2 units of iphone. 2 B, C iphone 3 Have A: 200, B: 300, and C: Price of L: $1, and ip: $6. How many units to manufacture to max profit? Ruta (UIUC) CS473 7 Spring / 50

15 A Factory Example Problem Can produce Laptop and iphone, using resources A, B, C. 1 A, C Laptop 2 B, C iphone 3 Have A: 200, B: 300, and C: Price of L: $1, and ip: $6. How many units to manufacture to max profit? Suppose x 1 units of Laptop and x 2 units of iphone. max x 1 + 6x 2 s.t. x (A) x x 1 + x x 1 0 x 2 0 (B) (C) Ruta (UIUC) CS473 7 Spring / 50

16 Linear Programming Formulation Let us produce x 1 units of Laptop and x 2 units of iphone. Our profit can be computed by solving maximize x 1 + 6x 2 subject to x x x 1 + x x 1, x 2 0 Ruta (UIUC) CS473 8 Spring / 50

17 Linear Programming Formulation Let us produce x 1 units of Laptop and x 2 units of iphone. Our profit can be computed by solving maximize x 1 + 6x 2 subject to x x x 1 + x x 1, x 2 0 What is the solution? Ruta (UIUC) CS473 8 Spring / 50

18 Maximum Flow in Network s t Ruta (UIUC) CS473 9 Spring / 50

19 Maximum Flow in Network Need to compute values f s1, f s2,... f 25,... f 5t, f 6t such that s t Ruta (UIUC) CS473 9 Spring / 50

20 Maximum Flow in Network s Need to compute values f s1, f s2,... f 25,... f 5t, f 6t such that t f s1 15 f s2 5 f s3 10 f f 21 4 f 25 8 f 32 4 f f 36 9 f 42 6 f 4t 10 f f 5t 10 f f 6t 10 Ruta (UIUC) CS473 9 Spring / 50

21 Maximum Flow in Network s Need to compute values f s1, f s2,... f 25,... f 5t, f 6t such that t and f s1 15 f s2 5 f s3 10 f f 21 4 f 25 8 f 32 4 f f 36 9 f 42 6 f 4t 10 f f 5t 10 f f 6t 10 f s1 + f 21 = f 14 f s2 + f 32 = f 21 + f 25 f s3 = f 32 + f 35 + f 36 f 14 + f 54 = f 42 + f 4t f 25 + f 35 + f 65 = f 54 + f 5t f 36 = f 65 + f 6t Ruta (UIUC) CS473 9 Spring / 50

22 Maximum Flow in Network s Need to compute values f s1, f s2,... f 25,... f 5t, f 6t such that t and f s1 15 f s2 5 f s3 10 f f 21 4 f 25 8 f 32 4 f f 36 9 f 42 6 f 4t 10 f f 5t 10 f f 6t 10 f s1 + f 21 = f 14 f s2 + f 32 = f 21 + f 25 f s3 = f 32 + f 35 + f 36 f 14 + f 54 = f 42 + f 4t f 25 + f 35 + f 65 = f 54 + f 5t f 36 = f 65 + f 6t f s1 0 f s2 0 f s3 0 f 4t 0 f 5t 0 f 6t 0 Ruta (UIUC) CS473 9 Spring / 50

23 Maximum Flow in Network s Need to compute values f s1, f s2,... f 25,... f 5t, f 6t such that t and f s1 15 f s2 5 f s3 10 f f 21 4 f 25 8 f 32 4 f f 36 9 f 42 6 f 4t 10 f f 5t 10 f f 6t 10 f s1 + f 21 = f 14 f s2 + f 32 = f 21 + f 25 f s3 = f 32 + f 35 + f 36 f 14 + f 54 = f 42 + f 4t f 25 + f 35 + f 65 = f 54 + f 5t f 36 = f 65 + f 6t f s1 0 f s2 0 f s3 0 f 4t 0 f 5t 0 f 6t 0 maximize: f s1 + f s2 + f s3. Ruta (UIUC) CS473 9 Spring / 50

24 Maximum Flow as a Linear Program For a general flow network G = (V, E) with capacities c e on edge e E, we have variables f e indicating flow on edge e Maximize e out of s f e subject to f e c e for each e E f e f e = 0 v V \ {s, t} e out of v e into v f e 0 for each e E. Ruta (UIUC) CS Spring / 50

25 Maximum Flow as a Linear Program For a general flow network G = (V, E) with capacities c e on edge e E, we have variables f e indicating flow on edge e Maximize e out of s f e subject to f e c e for each e E f e f e = 0 v V \ {s, t} e out of v e into v f e 0 for each e E. Number of variables: m, one for each edge. Number of constraints: m + n 2 + m. Ruta (UIUC) CS Spring / 50

26 Minimum Cost Flow with Lower Bounds... as a Linear Program For a general flow network G = (V, E) with capacities c e, lower bounds l e, and costs w e, we have variables f e indicating flow on edge e. Suppose we want a min-cost flow of value at least F. Minimize w e f e subject to e E e out of s f e F f e c e f e l e for each e E f e f e = 0 for each v V {s, t} e out of v e into v f e 0 for each e E. Ruta (UIUC) CS Spring / 50

27 Minimum Cost Flow with Lower Bounds... as a Linear Program For a general flow network G = (V, E) with capacities c e, lower bounds l e, and costs w e, we have variables f e indicating flow on edge e. Suppose we want a min-cost flow of value at least F. Minimize w e f e subject to e E e out of s f e F f e c e f e l e for each e E f e f e = 0 for each v V {s, t} e out of v e into v f e 0 for each e E. Number of variables: m, one for each edge Number of constraints: 1 + m + m + n 2 + m = 3m + n 1. Ruta (UIUC) CS Spring / 50

28 Linear Programs Problem Find a vector x R d that maximize/minimize subject to d j=1 c jx j d j=1 a ijx j b i d j=1 a ijx j = b i d j=1 a ijx j b i for i = 1... p for i = p q for i = q n Ruta (UIUC) CS Spring / 50

29 Linear Programs Problem Find a vector x R d that maximize/minimize subject to d j=1 c jx j d j=1 a ijx j b i d j=1 a ijx j = b i d j=1 a ijx j b i for i = 1... p for i = p q for i = q n Input is matrix A = (a ij ) R n d, column vector b = (b i ) R n, and row vector c = (c j ) R d Ruta (UIUC) CS Spring / 50

30 Canonical Form of Linear Programs Canonical Form A linear program is in canonical form if it has the following structure maximize subject to d j=1 c jx j d j=1 a ijx j b i for i = 1... n Ruta (UIUC) CS Spring / 50

31 Canonical Form of Linear Programs Canonical Form A linear program is in canonical form if it has the following structure maximize subject to d j=1 c jx j d j=1 a ijx j b i for i = 1... n Conversion to Canonical Form 1 Replace j a ijx j = b i by a ij x j b i and j j a ij x j b i 2 Replace j a ijx j b i by j a ijx j b i Ruta (UIUC) CS Spring / 50

32 Matrix Representation of Linear Programs A linear program in canonical form can be written as maximize subject to c x Ax b where A = (a ij ) R n d, column vector b = (b i ) R n, row vector c = (c j ) R d, and column vector x = (x j ) R d 1 Number of variable is d 2 Number of constraints is n Ruta (UIUC) CS Spring / 50

33 Other Standard Forms for Linear Programs maximize subject to c x Ax b x 0 minimize subject to c x Ax b x 0 minimize subject to c x Ax = b x 0 Ruta (UIUC) CS Spring / 50

34 Linear Programming: A History 1 First formal application to problems in economics by Leonid Kantorovich in the 1930s 1 However, work was ignored behind the Iron Curtain and unknown in the West Ruta (UIUC) CS Spring / 50

35 Linear Programming: A History 1 First formal application to problems in economics by Leonid Kantorovich in the 1930s 1 However, work was ignored behind the Iron Curtain and unknown in the West 2 Rediscovered by Tjalling Koopmans in the 1940s, along with applications to economics Ruta (UIUC) CS Spring / 50

36 Linear Programming: A History 1 First formal application to problems in economics by Leonid Kantorovich in the 1930s 1 However, work was ignored behind the Iron Curtain and unknown in the West 2 Rediscovered by Tjalling Koopmans in the 1940s, along with applications to economics 3 First algorithm (Simplex) to solve linear programs by George Dantzig in 1947 Ruta (UIUC) CS Spring / 50

37 Linear Programming: A History 1 First formal application to problems in economics by Leonid Kantorovich in the 1930s 1 However, work was ignored behind the Iron Curtain and unknown in the West 2 Rediscovered by Tjalling Koopmans in the 1940s, along with applications to economics 3 First algorithm (Simplex) to solve linear programs by George Dantzig in Kantorovich and Koopmans receive Nobel Prize for economics in 1975 ; Dantzig, however, was ignored 1 Koopmans contemplated refusing the Nobel Prize to protest Dantzig s exclusion, but Kantorovich saw it as a vindication for using mathematics in economics, which had been written off as a means for apologists of capitalism Ruta (UIUC) CS Spring / 50

38 Back to the Factory example Produce x 1 units of product 1 and x 2 units of product 2. Our profit can be computed by solving maximize x 1 + 6x 2 subject to x x x 1 + x x 1, x 2 0 Ruta (UIUC) CS Spring / 50

39 Back to the Factory example Produce x 1 units of product 1 and x 2 units of product 2. Our profit can be computed by solving maximize x 1 + 6x 2 subject to x x x 1 + x x 1, x 2 0 What is the solution? Ruta (UIUC) CS Spring / 50

40 Solving the Factory Example x Feasible values of x 1 and x 2 are shaded region. 200 x 1 maximize x 1 + 6x 2 subject to x x x 1 + x x 1, x 2 0 Ruta (UIUC) CS Spring / 50

41 Solving the Factory Example x Feasible values of x 1 and x 2 are shaded region. 2 Objective (Cost) function is a direction the line represents all points with same value of the function 200 x 1 maximize x 1 + 6x 2 subject to x x x 1 + x x 1, x 2 0 Ruta (UIUC) CS Spring / 50

42 Solving the Factory Example x x 1 1 Feasible values of x 1 and x 2 are shaded region. 2 Objective (Cost) function is a direction the line represents all points with same value of the function; moving the line until it just leaves the feasible region, gives optimal values. maximize x 1 + 6x 2 subject to x x x 1 + x x 1, x 2 0 Ruta (UIUC) CS Spring / 50

43 Linear Programming in 2-d 1 Each constraint a half plane 2 Feasible region is intersection of finitely many half planes it forms a polygon. 3 For a fixed value of objective function, we get a line. Parallel lines correspond to different values for objective function. 4 Optimum achieved when objective function line just leaves the feasible region Ruta (UIUC) CS Spring / 50

44 An S. Dasgupta, Example C.H. Papadimitriou, in 3-d and U.V. Vazirani 227 Figure 7.12 A polyhedron defined by seven inequalities. x2 5 B 4 2 A 3 1 C 6 7 x1 max x 1 + 6x x 3 x x x 1 + x 2 + x x 2 + 3x x 1 0 x 2 0 x x3 7.6 The simplex algorithmpolytope The extraordinary power and expressiveness of linear programs would be little consolation if we did not have a way to solve them efficiently. This Figure is thefrom role ofdasgupta the simplex algorithm. etal book. At a high level, the simplex algorithm takes a set of linear inequalities and a linear objec- Ruta (UIUC) CS Spring / 50

45 Part II Simple Algorithm Ruta (UIUC) CS Spring / 50

46 Factory Example: Alternate View Original Problem Recall we have, maximize x 1 + 6x 2 subject to x x x 1 + x x 1, x 2 0 Ruta (UIUC) CS Spring / 50

47 Factory Example: Alternate View Original Problem Recall we have, maximize x 1 + 6x 2 subject to x x x 1 + x x 1, x 2 0 Transformation Consider new variable z 1 and z 2, such that z 1 = x 1 + 6x 2 and z 2 = x 2. Then x 1 = z 1 6z 2. In terms of the new variables we have maximize z 1 subject to z 1 6z z z 1 5z z 1 6z 2 0 z 2 0 Ruta (UIUC) CS Spring / 50

48 Transformed Picture Feasible region rotated, and optimal value at the right-most point on polygon Ruta (UIUC) CS Spring / 50

49 Observations about the Transformation Observations 1 Linear program can always be transformed to get a linear program where the optimal value is achieved at the point in the feasible region with highest x-coordinate 2 Optimum value attained at a vertex of the polygon 3 Since feasible region is convex, and objective function linear, every local optimum is a global optimum Ruta (UIUC) CS Spring / 50

50 A Simple Algorithm in 2-d 1 optimum solution is at a vertex of the feasible region 2 a vertex is defined by the intersection of two lines (constraints) Ruta (UIUC) CS Spring / 50

51 A Simple Algorithm in 2-d 1 optimum solution is at a vertex of the feasible region 2 a vertex is defined by the intersection of two lines (constraints) Algorithm: 1 find all intersections between the n lines at most n 2 points 2 for each intersection point p = (p 1, p 2 ) 1 check if p is in feasible region (how?) 2 if p is feasible evaluate objective function at p: val(p) = c 1 p 1 + c 2 p 2 3 Output the feasible point with the largest value Ruta (UIUC) CS Spring / 50

52 A Simple Algorithm in 2-d 1 optimum solution is at a vertex of the feasible region 2 a vertex is defined by the intersection of two lines (constraints) Algorithm: 1 find all intersections between the n lines at most n 2 points 2 for each intersection point p = (p 1, p 2 ) 1 check if p is in feasible region (how?) 2 if p is feasible evaluate objective function at p: val(p) = c 1 p 1 + c 2 p 2 3 Output the feasible point with the largest value Running time: O(n 3 ). Ruta (UIUC) CS Spring / 50

53 Geometry in d-dimentsion maximize subject to d j=1 c jx j d j=1 a ijx j b i for i = 1... n Q: The set of points defined by a linear constraint {x R d 1 convex 2 non-convex d a ij x j b i } is, j=1 Ruta (UIUC) CS Spring / 50

54 Geometry in d-dimentsion maximize subject to d j=1 c jx j d j=1 a ijx j b i for i = 1... n Q: The set of points defined by a linear constraint {x R d 1 convex 2 non-convex This is also called a halfspace. d a ij x j b i } is, j=1 Ruta (UIUC) CS Spring / 50

55 Geometry in d-dimentsion maximize subject to d j=1 c jx j d j=1 a ijx j b i for i = 1... n Q: Intersection of a finitely many convex sets is, 1 convex 2 non-convex Ruta (UIUC) CS Spring / 50

56 Geometry in d-dimentsion maximize subject to d j=1 c jx j d j=1 a ijx j b i for i = 1... n Q: Intersection of a finitely many convex sets is, 1 convex 2 non-convex Thus feasible set, {x d j=1 a ijx j b i for i = 1... n}, is convex. Defines a polytope. Ruta (UIUC) CS Spring / 50

57 Geometry in d-dimentsion maximize subject to d j=1 c jx j d j=1 a ijx j b i for i = 1... n Caratheodory Theorem. Every point x in a d-dimensional polytope can be written as a convex combination of (d + 1) vertices Ruta (UIUC) CS Spring / 50

58 Geometry in d-dimentsion maximize subject to d j=1 c jx j d j=1 a ijx j b i for i = 1... n Caratheodory Theorem. Every point x in a d-dimensional polytope can be written as a convex combination of (d + 1) vertices. Q: If x is a convex combination of vertices v 1,..., v k, then for a constant vector c which of the following holds 1 (c x) max k i =1 (c v i ) 2 (c x) max k i =1 (c v i ) Ruta (UIUC) CS Spring / 50

59 Geometry in d-dimentsion maximize subject to d j=1 c jx j d j=1 a ijx j b i for i = 1... n Caratheodory Theorem. Every point x in a d-dimensional polytope can be written as a convex combination of (d + 1) vertices. Q: If x is a convex combination of vertices v 1,..., v k, then for a constant vector c which of the following holds 1 (c x) max k i =1 (c v i ) 2 (c x) max k i =1 (c v i ) There exists a vertex solution. Ruta (UIUC) CS Spring / 50

60 Geometry in d-dimentsion maximize subject to d j=1 c jx j d j=1 a ijx j b i for i = 1... n Caratheodory Theorem. Every point x in a d-dimensional polytope can be written as a convex combination of (d + 1) vertices. If x is a convex combination of vertices v 1,..., v k, then 1 min k i =1 (c v i ) (c x) max k i =1 (c v i ) There exists a vertex solution. Ruta (UIUC) CS Spring / 50

61 Linear Programming in d-dimensions (Summary) maximize subject to d j=1 c jx j d j=1 a ijx j b i for i = 1... n 1 Each linear constraint defines a halfspace Convex set Ruta (UIUC) CS Spring / 50

62 Linear Programming in d-dimensions (Summary) maximize subject to d j=1 c jx j d j=1 a ijx j b i for i = 1... n 1 Each linear constraint defines a halfspace Convex set. 2 Feasible region is an intersection of halfspaces Convex polytope Ruta (UIUC) CS Spring / 50

63 Linear Programming in d-dimensions (Summary) maximize subject to d j=1 c jx j d j=1 a ijx j b i for i = 1... n 1 Each linear constraint defines a halfspace Convex set. 2 Feasible region is an intersection of halfspaces Convex polytope. 3 Optimal value attained at a vertex of the polyhedron. Using the Caratheodory Theorem. (Or the transformation) Ruta (UIUC) CS Spring / 50

64 Linear Programming in d-dimensions (Summary) maximize subject to d j=1 c jx j d j=1 a ijx j b i for i = 1... n 1 Each linear constraint defines a halfspace Convex set. 2 Feasible region is an intersection of halfspaces Convex polytope. 3 Optimal value attained at a vertex of the polyhedron. Using the Caratheodory Theorem. (Or the transformation) 4 Tight inequality d j=1 a ij x j = b i defines hyperplane of (d 1) dim. 5 A vertex is defined by intersection of d hyperplanes. Solution of Âx = ˆb, where  is d d.  has non-zero determinant linear independence Ruta (UIUC) CS Spring / 50

65 Simple Algorithm in d Dimensions Real problem: d-dimensions, n-constraints Ruta (UIUC) CS Spring / 50

66 Simple Algorithm in d Dimensions Real problem: d-dimensions, n-constraints 1 optimum solution is at a vertex of the feasible region 2 a vertex is defined by the intersection of d hyperplanes 3 number of vertices can be Ruta (UIUC) CS Spring / 50

67 Simple Algorithm in d Dimensions Real problem: d-dimensions, n-constraints 1 optimum solution is at a vertex of the feasible region 2 a vertex is defined by the intersection of d hyperplanes 3 number of vertices can be Ω(n d ) Running time: O(dn d+1 ) which is not polynomial since problem size is at least nd. Also not practical. How do we find the intersection point of d hyperplanes in R d? Ruta (UIUC) CS Spring / 50

68 Simple Algorithm in d Dimensions Real problem: d-dimensions, n-constraints 1 optimum solution is at a vertex of the feasible region 2 a vertex is defined by the intersection of d hyperplanes 3 number of vertices can be Ω(n d ) Running time: O(dn d+1 ) which is not polynomial since problem size is at least nd. Also not practical. How do we find the intersection point of d hyperplanes in R d? Using Gaussian elimination to solve Âx = ˆb where  is a d d matrix and ˆb is a d 1 matrix. Ruta (UIUC) CS Spring / 50

69 Simplex Algorithm Simplex: Vertex hoping algorithm Ruta (UIUC) CS Spring / 50

70 Simplex Algorithm Simplex: Vertex hoping algorithm Moves from a vertex to its neighboring vertex Ruta (UIUC) CS Spring / 50

71 Simplex Algorithm Simplex: Vertex hoping algorithm Moves from a vertex to its neighboring vertex Questions Which neighbor to move to? When to stop? How much time does it take? Ruta (UIUC) CS Spring / 50

72 Observations For Simplex Suppose we are at a non-optimal vertex ˆx = (ˆx 1,..., ˆx d ) and optimal is x = (x 1,..., x d ), then c x > c ˆx. Ruta (UIUC) CS Spring / 50

73 Observations For Simplex Suppose we are at a non-optimal vertex ˆx = (ˆx 1,..., ˆx d ) and optimal is x = (x 1,..., x d ), then c x > c ˆx. How does (c x) change as we move from ˆx to x on the line joining the two? Ruta (UIUC) CS Spring / 50

74 Observations For Simplex Suppose we are at a non-optimal vertex ˆx = (ˆx 1,..., ˆx d ) and optimal is x = (x 1,..., x d ), then c x > c ˆx. How does (c x) change as we move from ˆx to x on the line joining the two? Strictly increases! Ruta (UIUC) CS Spring / 50

75 Observations For Simplex Suppose we are at a non-optimal vertex ˆx = (ˆx 1,..., ˆx d ) and optimal is x = (x 1,..., x d ), then c x > c ˆx. How does (c x) change as we move from ˆx to x on the line joining the two? Strictly increases! d = x ˆx is the direction from ˆx to x. x = ˆx + δd. As δ goes from 0 to 1, x moves from ˆx to x. Ruta (UIUC) CS Spring / 50

76 Observations For Simplex Suppose we are at a non-optimal vertex ˆx = (ˆx 1,..., ˆx d ) and optimal is x = (x 1,..., x d ), then c x > c ˆx. How does (c x) change as we move from ˆx to x on the line joining the two? Strictly increases! d = x ˆx is the direction from ˆx to x. x = ˆx + δd. As δ goes from 0 to 1, x moves from ˆx to x. (c d) = (c x ) (c ˆx) > 0. Ruta (UIUC) CS Spring / 50

77 Observations For Simplex Suppose we are at a non-optimal vertex ˆx = (ˆx 1,..., ˆx d ) and optimal is x = (x 1,..., x d ), then c x > c ˆx. How does (c x) change as we move from ˆx to x on the line joining the two? Strictly increases! d = x ˆx is the direction from ˆx to x. x = ˆx + δd. As δ goes from 0 to 1, x moves from ˆx to x. (c d) = (c x ) (c ˆx) > 0. c x = c ˆx + δ(c d). Strictly increasing with δ! Due to convexity, all of these are feasible points. Ruta (UIUC) CS Spring / 50

78 Cone Definition Given a set of vectors D = {d 1,..., d k }, the cone spanned by them is just their positive linear combinations, i.e., cone(d) = {d d = k λ i d i, where λ i 0, i} i =1 Ruta (UIUC) CS Spring / 50

79 Cone (Contd.) Lemma If d cone(d) and (c d) > 0, then there exists d i such that (c d i ) > 0. Proof. To the contrary suppose (c d i ) 0, i k. Since d is a positive linear combination of d i s, A contradiction! (c d) = (c k i =1 λ i d i ) = k i =1 λ i (c d i ) 0 Ruta (UIUC) CS Spring / 50

80 Improving Direction Implies Improving Neighbor Let z 1,..., z k be the neighboring vertices of ˆx. And let d i = z i ˆx be the direction from ˆx to z i. Lemma Any feasible direction of movement d from ˆx is in the cone({d 1,..., d k }). Ruta (UIUC) CS Spring / 50

81 Observations For Simplex Suppose we are at a non-optimal vertex ˆx = (ˆx 1,..., ˆx d ) and optimal is x = (x 1,..., x d ), then c x > c ˆx. d = x ˆx is the direction from ˆx to x. (c d) = (c x ) (c ˆx) > 0. Ruta (UIUC) CS Spring / 50

82 Observations For Simplex Suppose we are at a non-optimal vertex ˆx = (ˆx 1,..., ˆx d ) and optimal is x = (x 1,..., x d ), then c x > c ˆx. d = x ˆx is the direction from ˆx to x. (c d) = (c x ) (c ˆx) > 0. Let d i be the direction towards neighbor z i. d Cone({d 1,..., d k }) d i, (c d i ) > 0. Ruta (UIUC) CS Spring / 50

83 Observations For Simplex Suppose we are at a non-optimal vertex ˆx = (ˆx 1,..., ˆx d ) and optimal is x = (x 1,..., x d ), then c x > c ˆx. d = x ˆx is the direction from ˆx to x. (c d) = (c x ) (c ˆx) > 0. Let d i be the direction towards neighbor z i. d Cone({d 1,..., d k }) d i, (c d i ) > 0. Theorem If vertex ˆx is not optimal then it has a neighbor where the objective value (c x) improves. Ruta (UIUC) CS Spring / 50

84 How Many Neighbors a Vertex Has? Geometric view... A R n d (n > d), b R n, the constraints are: Ax b Faces n constraints/inequalities. Each defines a hyperplane. Vertex: 0-dimensional face. Edge: 1D face.... Hyperplane: (d 1)D face. Ruta (UIUC) CS Spring / 50

85 How Many Neighbors a Vertex Has? Geometric view... A R n d (n > d), b R n, the constraints are: Ax b Faces n constraints/inequalities. Each defines a hyperplane. Vertex: 0-dimensional face. Edge: 1D face.... Hyperplane: (d 1)D face. r linearly independent hyperplanes forms d r dimensional face. Ruta (UIUC) CS Spring / 50

86 How Many Neighbors a Vertex Has? Geometric view... A R n d (n > d), b R n, the constraints are: Ax b Faces n constraints/inequalities. Each defines a hyperplane. Vertex: 0-dimensional face. Edge: 1D face.... Hyperplane: (d 1)D face. r linearly independent hyperplanes forms d r dimensional face. Vertices being of 0D, d L.I. hyperplanes form a vertex. Ruta (UIUC) CS Spring / 50

87 How Many Neighbors a Vertex Has? Geometric view... A R n d (n > d), b R n, the constraints are: Ax b Faces n constraints/inequalities. Each defines a hyperplane. Vertex: 0-dimensional face. Edge: 1D face.... Hyperplane: (d 1)D face. r linearly independent hyperplanes forms d r dimensional face. Vertices being of 0D, d L.I. hyperplanes form a vertex. In 2-dimension (d = 2) x x 1 Ruta (UIUC) CS Spring / 50

88 How Many Neighbors a Vertex Has? Geometric view... A R n d (n > d), b R n, the constraints are: Ax b In 3-dimension (d = 3) Faces n constraints/inequalities. Each defines a hyperplane. Vertex: 0-dimensional face. Edge: 1D face.... Hyperplane: (d 1)D face. r linearly independent hyperplanes forms d r dimensional face. Vertices being of 0D, d L.I. hyperplanes form a vertex image source: webpage of Prof. Forbes W. Lewis Ruta (UIUC) CS Spring / 50

89 How Many Neighbors a Vertex Has? Geometry view... One neighbor per tight hyperplane. Therefore typically d. Suppose x is a neighbor of ˆx, then on the edge joining is defined by (d 1) hyperplanes. hx and x also shares these d 1 hyperplanes In addition one more hyperplane, say (Ax) i = b i, is tight at ˆx. Relaxing this at ˆx leads to x. Ruta (UIUC) CS Spring / 50

90 Simplex Algorithm Simplex: Vertex hoping algorithm Moves from a vertex to its neighboring vertex Questions + Answers Which neighbor to move to? One where objective value increases. Ruta (UIUC) CS Spring / 50

91 Simplex Algorithm Simplex: Vertex hoping algorithm Moves from a vertex to its neighboring vertex Questions + Answers Which neighbor to move to? One where objective value increases. When to stop? When no neighbor with better objective value. Ruta (UIUC) CS Spring / 50

92 Simplex Algorithm Simplex: Vertex hoping algorithm Moves from a vertex to its neighboring vertex Questions + Answers Which neighbor to move to? One where objective value increases. When to stop? When no neighbor with better objective value. How much time does it take? At most d neighbors to consider in each step. Ruta (UIUC) CS Spring / 50

93 Simplex in 2-d Simplex Algorithm 1 Start from some vertex of the feasible polygon. 2 Compare value of objective function at current vertex with the value at 2 neighboring vertices of polygon. 3 If neighboring vertex improves objective function, move to this vertex, and repeat step 2. 4 If no improving neighbor (local optimum), then stop. Ruta (UIUC) CS Spring / 50

94 Simplex in Higher Dimensions Simplex Algorithm 1 Start at a vertex of the polytope. 2 Compare value of objective function at each of the d neighbors. 3 Move to neighbor that improves objective function, and repeat step 2. 4 If no improving neighbor, then stop. Ruta (UIUC) CS Spring / 50

95 Simplex in Higher Dimensions Simplex Algorithm 1 Start at a vertex of the polytope. 2 Compare value of objective function at each of the d neighbors. 3 Move to neighbor that improves objective function, and repeat step 2. 4 If no improving neighbor, then stop. Simplex is a greedy local-improvement algorithm! Works because a local optimum is also a global optimum convexity of polyhedra. Ruta (UIUC) CS Spring / 50

96 Solving Linear Programming in Practice 1 Naïve implementation of Simplex algorithm can be very inefficient Ruta (UIUC) CS Spring / 50

97 Solving Linear Programming in Practice 1 Naïve implementation of Simplex algorithm can be very inefficient Exponential number of steps! Ruta (UIUC) CS Spring / 50

98 Solving Linear Programming in Practice 1 Naïve implementation of Simplex algorithm can be very inefficient 1 Choosing which neighbor to move to can significantly affect running time 2 Very efficient Simplex-based algorithms exist 3 Simplex algorithm takes exponential time in the worst case but works extremely well in practice with many improvements over the years 2 Non Simplex based methods like interior point methods work well for large problems. Ruta (UIUC) CS Spring / 50

99 Polynomial time Algorithm for Linear Programming Major open problem for many years: is there a polynomial time algorithm for linear programming? Ruta (UIUC) CS Spring / 50

100 Polynomial time Algorithm for Linear Programming Major open problem for many years: is there a polynomial time algorithm for linear programming? Leonid Khachiyan in 1979 gave the first polynomial time algorithm using the Ellipsoid method. 1 major theoretical advance 2 highly impractical algorithm, not used at all in practice 3 routinely used in theoretical proofs. Ruta (UIUC) CS Spring / 50

101 Polynomial time Algorithm for Linear Programming Major open problem for many years: is there a polynomial time algorithm for linear programming? Leonid Khachiyan in 1979 gave the first polynomial time algorithm using the Ellipsoid method. 1 major theoretical advance 2 highly impractical algorithm, not used at all in practice 3 routinely used in theoretical proofs. Narendra Karmarkar in 1984 developed another polynomial time algorithm, the interior point method. 1 very practical for some large problems and beats simplex 2 also revolutionized theory of interior point methods Ruta (UIUC) CS Spring / 50

102 Polynomial time Algorithm for Linear Programming Major open problem for many years: is there a polynomial time algorithm for linear programming? Leonid Khachiyan in 1979 gave the first polynomial time algorithm using the Ellipsoid method. 1 major theoretical advance 2 highly impractical algorithm, not used at all in practice 3 routinely used in theoretical proofs. Narendra Karmarkar in 1984 developed another polynomial time algorithm, the interior point method. 1 very practical for some large problems and beats simplex 2 also revolutionized theory of interior point methods Following interior point method success, Simplex has been improved enormously and is the method of choice. Ruta (UIUC) CS Spring / 50

103 Degeneracy 1 The linear program could be infeasible: No points satisfy the constraints. 2 The linear program could be unbounded: Polygon unbounded in the direction of the objective function. 3 More than d hyperplanes could be tight at a vertex, forming more than d neighbors. Ruta (UIUC) CS Spring / 50

104 Infeasibility: Example maximize x 1 + 6x 2 subject to x 1 2 x 2 1 x 1 + x 2 4 x 1, x 2 0 Infeasibility has to do only with constraints. Ruta (UIUC) CS Spring / 50

105 Infeasibility: Example maximize x 1 + 6x 2 subject to x 1 2 x 2 1 x 1 + x 2 4 x 1, x 2 0 Infeasibility has to do only with constraints. No starting vertex for Simplex. Ruta (UIUC) CS Spring / 50

106 Infeasibility: Example maximize x 1 + 6x 2 subject to x 1 2 x 2 1 x 1 + x 2 4 x 1, x 2 0 Infeasibility has to do only with constraints. No starting vertex for Simplex. How to detect this? Ruta (UIUC) CS Spring / 50

107 Unboundedness: Example maximize x 2 x 1 + x 2 2 x 1, x 2 0 Unboundedness depends on both constraints and the objective function. Ruta (UIUC) CS Spring / 50

108 Unboundedness: Example maximize x 2 x 1 + x 2 2 x 1, x 2 0 Unboundedness depends on both constraints and the objective function. If unbounded in the direction of objective function, then Simplex detects it. Ruta (UIUC) CS Spring / 50

109 Degeneracy and Cycling S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani 227 More than d inequalities tight at a vertex. Figure 7.12 A polyhedron defined by seven inequalities. x2 5 B 4 2 A 3 1 C 6 7 x1 max x 1 + 6x x 3 x x x 1 + x 2 + x x 2 + 3x x 1 0 x 2 0 x x3 7.6 The simplex algorithm The extraordinary power and expressiveness of linear programs would be little consolation if we did not have a way to solve them efficiently. This is the role of the simplex algorithm. At a high level, the simplex algorithm takes a set of linear inequalities and a linear objec- Ruta (UIUC) CS Spring / 50

110 Degeneracy and Cycling S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani 227 More than d inequalities tight at a vertex. Figure 7.12 A polyhedron defined by seven inequalities. x2 5 B 4 2 A 3 1 C 6 7 x1 max x 1 + 6x x 3 x x x 1 + x 2 + x x 2 + 3x x 1 0 x 2 0 x x3 Depending 7.6 The simplex on how Simplex algorithm is implemented, it may cycle at this vertex. The extraordinary power and expressiveness of linear programs would be little consolation if we did not have a way to solve them efficiently. This is the role of the simplex algorithm. At a high level, the simplex algorithm takes a set of linear inequalities and a linear objec- Ruta (UIUC) CS Spring / 50 We will see how in the next lecture.

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

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 29 CS 473: Algorithms Ruta Mehta University of Illinois, Urbana-Champaign Spring 2018 Ruta (UIUC) CS473 1 Spring 2018 1 / 29 CS 473: Algorithms, Spring 2018 Simplex and LP Duality Lecture 19 March 29, 2018

More information

Linear Programming and its Applications

Linear Programming and its Applications Linear Programming and its Applications Outline for Today What is linear programming (LP)? Examples Formal definition Geometric intuition Why is LP useful? A first look at LP algorithms Duality Linear

More information

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

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 36 CS 473: Algorithms Ruta Mehta University of Illinois, Urbana-Champaign Spring 2018 Ruta (UIUC) CS473 1 Spring 2018 1 / 36 CS 473: Algorithms, Spring 2018 LP Duality Lecture 20 April 3, 2018 Some of the

More information

Linear Programming: Introduction

Linear Programming: Introduction CSC 373 - Algorithm Design, Analysis, and Complexity Summer 2016 Lalla Mouatadid Linear Programming: Introduction A bit of a historical background about linear programming, that I stole from Jeff Erickson

More information

Linear Programming in Small Dimensions

Linear Programming in Small Dimensions Linear Programming in Small Dimensions Lekcija 7 sergio.cabello@fmf.uni-lj.si FMF Univerza v Ljubljani Edited from slides by Antoine Vigneron Outline linear programming, motivation and definition one dimensional

More information

CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension

CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension Antoine Vigneron King Abdullah University of Science and Technology November 7, 2012 Antoine Vigneron (KAUST) CS 372 Lecture

More information

Applications of Linear Programming

Applications of Linear Programming Applications of Linear Programming lecturer: András London University of Szeged Institute of Informatics Department of Computational Optimization Lecture 1 Why LP? Linear programming (LP, also called linear

More information

A linear program is an optimization problem of the form: minimize subject to

A linear program is an optimization problem of the form: minimize subject to Lec11 Page 1 Lec11p1, ORF363/COS323 This lecture: Linear Programming (LP) Applications of linear programming History of linear programming Geometry of linear programming Geometric and algebraic definition

More information

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Mathematical and Algorithmic Foundations Linear Programming and Matchings Adavnced Algorithms Lectures Mathematical and Algorithmic Foundations Linear Programming and Matchings Paul G. Spirakis Department of Computer Science University of Patras and Liverpool Paul G. Spirakis

More information

Chapter 15 Introduction to Linear Programming

Chapter 15 Introduction to Linear Programming Chapter 15 Introduction to Linear Programming An Introduction to Optimization Spring, 2015 Wei-Ta Chu 1 Brief History of Linear Programming The goal of linear programming is to determine the values of

More information

R n a T i x = b i} is a Hyperplane.

R n a T i x = b i} is a Hyperplane. Geometry of LPs Consider the following LP : min {c T x a T i x b i The feasible region is i =1,...,m}. X := {x R n a T i x b i i =1,...,m} = m i=1 {x Rn a T i x b i} }{{} X i The set X i is a Half-space.

More information

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

Submodularity Reading Group. Matroid Polytopes, Polymatroid. M. Pawan Kumar Submodularity Reading Group Matroid Polytopes, Polymatroid M. Pawan Kumar http://www.robots.ox.ac.uk/~oval/ Outline Linear Programming Matroid Polytopes Polymatroid Polyhedron Ax b A : m x n matrix b:

More information

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

CS675: Convex and Combinatorial Optimization Spring 2018 The Simplex Algorithm. Instructor: Shaddin Dughmi CS675: Convex and Combinatorial Optimization Spring 2018 The Simplex Algorithm Instructor: Shaddin Dughmi Algorithms for Convex Optimization We will look at 2 algorithms in detail: Simplex and Ellipsoid.

More information

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

Advanced Operations Research Techniques IE316. Quiz 2 Review. Dr. Ted Ralphs Advanced Operations Research Techniques IE316 Quiz 2 Review Dr. Ted Ralphs IE316 Quiz 2 Review 1 Reading for The Quiz Material covered in detail in lecture Bertsimas 4.1-4.5, 4.8, 5.1-5.5, 6.1-6.3 Material

More information

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

Section Notes 5. Review of Linear Programming. Applied Math / Engineering Sciences 121. Week of October 15, 2017 Section Notes 5 Review of Linear Programming Applied Math / Engineering Sciences 121 Week of October 15, 2017 The following list of topics is an overview of the material that was covered in the lectures

More information

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

MA4254: Discrete Optimization. Defeng Sun. Department of Mathematics National University of Singapore Office: S Telephone: MA4254: Discrete Optimization Defeng Sun Department of Mathematics National University of Singapore Office: S14-04-25 Telephone: 6516 3343 Aims/Objectives: Discrete optimization deals with problems of

More information

Lecture Notes 2: The Simplex Algorithm

Lecture Notes 2: The Simplex Algorithm Algorithmic Methods 25/10/2010 Lecture Notes 2: The Simplex Algorithm Professor: Yossi Azar Scribe:Kiril Solovey 1 Introduction In this lecture we will present the Simplex algorithm, finish some unresolved

More information

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

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs Advanced Operations Research Techniques IE316 Quiz 1 Review Dr. Ted Ralphs IE316 Quiz 1 Review 1 Reading for The Quiz Material covered in detail in lecture. 1.1, 1.4, 2.1-2.6, 3.1-3.3, 3.5 Background material

More information

Lecture 4: Linear Programming

Lecture 4: Linear Programming COMP36111: Advanced Algorithms I Lecture 4: Linear Programming Ian Pratt-Hartmann Room KB2.38: email: ipratt@cs.man.ac.uk 2017 18 Outline The Linear Programming Problem Geometrical analysis The Simplex

More information

4 LINEAR PROGRAMMING (LP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

4 LINEAR PROGRAMMING (LP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1 4 LINEAR PROGRAMMING (LP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1 Mathematical programming (optimization) problem: min f (x) s.t. x X R n set of feasible solutions with linear objective function

More information

Linear Programming Duality and Algorithms

Linear Programming Duality and Algorithms COMPSCI 330: Design and Analysis of Algorithms 4/5/2016 and 4/7/2016 Linear Programming Duality and Algorithms Lecturer: Debmalya Panigrahi Scribe: Tianqi Song 1 Overview In this lecture, we will cover

More information

CMPSCI611: The Simplex Algorithm Lecture 24

CMPSCI611: The Simplex Algorithm Lecture 24 CMPSCI611: The Simplex Algorithm Lecture 24 Let s first review the general situation for linear programming problems. Our problem in standard form is to choose a vector x R n, such that x 0 and Ax = b,

More information

The Simplex Algorithm

The Simplex Algorithm The Simplex Algorithm Uri Feige November 2011 1 The simplex algorithm The simplex algorithm was designed by Danzig in 1947. This write-up presents the main ideas involved. It is a slight update (mostly

More information

Linear programming and duality theory

Linear programming and duality theory Linear programming and duality theory Complements of Operations Research Giovanni Righini Linear Programming (LP) A linear program is defined by linear constraints, a linear objective function. Its variables

More information

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

Outline. CS38 Introduction to Algorithms. Linear programming 5/21/2014. Linear programming. Lecture 15 May 20, 2014 5/2/24 Outline CS38 Introduction to Algorithms Lecture 5 May 2, 24 Linear programming simplex algorithm LP duality ellipsoid algorithm * slides from Kevin Wayne May 2, 24 CS38 Lecture 5 May 2, 24 CS38

More information

CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 1: Introduction to Optimization. Instructor: Shaddin Dughmi

CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 1: Introduction to Optimization. Instructor: Shaddin Dughmi CS599: Convex and Combinatorial Optimization Fall 013 Lecture 1: Introduction to Optimization Instructor: Shaddin Dughmi Outline 1 Course Overview Administrivia 3 Linear Programming Outline 1 Course Overview

More information

Lesson 17. Geometry and Algebra of Corner Points

Lesson 17. Geometry and Algebra of Corner Points SA305 Linear Programming Spring 2016 Asst. Prof. Nelson Uhan 0 Warm up Lesson 17. Geometry and Algebra of Corner Points Example 1. Consider the system of equations 3 + 7x 3 = 17 + 5 = 1 2 + 11x 3 = 24

More information

J Linear Programming Algorithms

J Linear Programming Algorithms Simplicibus itaque verbis gaudet Mathematica Veritas, cum etiam per se simplex sit Veritatis oratio. [And thus Mathematical Truth prefers simple words, because the language of Truth is itself simple.]

More information

maximize c, x subject to Ax b,

maximize c, x subject to Ax b, Lecture 8 Linear programming is about problems of the form maximize c, x subject to Ax b, where A R m n, x R n, c R n, and b R m, and the inequality sign means inequality in each row. The feasible set

More information

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

DM545 Linear and Integer Programming. Lecture 2. The Simplex Method. Marco Chiarandini DM545 Linear and Integer Programming Lecture 2 The Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark Outline 1. 2. 3. 4. Standard Form Basic Feasible Solutions

More information

CS522: Advanced Algorithms

CS522: Advanced Algorithms Lecture 1 CS5: Advanced Algorithms October 4, 004 Lecturer: Kamal Jain Notes: Chris Re 1.1 Plan for the week Figure 1.1: Plan for the week The underlined tools, weak duality theorem and complimentary slackness,

More information

Linear Programming Motivation: The Diet Problem

Linear Programming Motivation: The Diet Problem Agenda We ve done Greedy Method Divide and Conquer Dynamic Programming Network Flows & Applications NP-completeness Now Linear Programming and the Simplex Method Hung Q. Ngo (SUNY at Buffalo) CSE 531 1

More information

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

Linear Programming. Readings: Read text section 11.6, and sections 1 and 2 of Tom Ferguson s notes (see course homepage). Linear Programming Learning Goals. Introduce Linear Programming Problems. Widget Example, Graphical Solution. Basic Theory: Feasible Set, Vertices, Existence of Solutions. Equivalent formulations. Outline

More information

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

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang 600.469 / 600.669 Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang 9.1 Linear Programming Suppose we are trying to approximate a minimization

More information

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

Linear Programming. Widget Factory Example. Linear Programming: Standard Form. Widget Factory Example: Continued. Linear Programming Widget Factory Example Learning Goals. Introduce Linear Programming Problems. Widget Example, Graphical Solution. Basic Theory:, Vertices, Existence of Solutions. Equivalent formulations.

More information

11 Linear Programming

11 Linear Programming 11 Linear Programming 11.1 Definition and Importance The final topic in this course is Linear Programming. We say that a problem is an instance of linear programming when it can be effectively expressed

More information

Linear Programming 1

Linear Programming 1 Linear Programming 1 Fei Li March 5, 2012 1 With references of Algorithms by S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani. Many of the problems for which we want algorithms are optimization tasks.

More information

Lecture 2 - Introduction to Polytopes

Lecture 2 - Introduction to Polytopes Lecture 2 - Introduction to Polytopes Optimization and Approximation - ENS M1 Nicolas Bousquet 1 Reminder of Linear Algebra definitions Let x 1,..., x m be points in R n and λ 1,..., λ m be real numbers.

More information

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

Linear and Integer Programming :Algorithms in the Real World. Related Optimization Problems. How important is optimization? Linear and Integer Programming 15-853:Algorithms in the Real World Linear and Integer Programming I Introduction Geometric Interpretation Simplex Method Linear or Integer programming maximize z = c T x

More information

Combinatorial Geometry & Topology arising in Game Theory and Optimization

Combinatorial Geometry & Topology arising in Game Theory and Optimization Combinatorial Geometry & Topology arising in Game Theory and Optimization Jesús A. De Loera University of California, Davis LAST EPISODE... We discuss the content of the course... Convex Sets A set is

More information

Chapter 4 Concepts from Geometry

Chapter 4 Concepts from Geometry Chapter 4 Concepts from Geometry An Introduction to Optimization Spring, 2014 Wei-Ta Chu 1 Line Segments The line segment between two points and in R n is the set of points on the straight line joining

More information

Lecture 3. Corner Polyhedron, Intersection Cuts, Maximal Lattice-Free Convex Sets. Tepper School of Business Carnegie Mellon University, Pittsburgh

Lecture 3. Corner Polyhedron, Intersection Cuts, Maximal Lattice-Free Convex Sets. Tepper School of Business Carnegie Mellon University, Pittsburgh Lecture 3 Corner Polyhedron, Intersection Cuts, Maximal Lattice-Free Convex Sets Gérard Cornuéjols Tepper School of Business Carnegie Mellon University, Pittsburgh January 2016 Mixed Integer Linear Programming

More information

Introduction to Linear Programming

Introduction to Linear Programming Introduction to Linear Programming Eric Feron (updated Sommer Gentry) (updated by Paul Robertson) 16.410/16.413 Historical aspects Examples of Linear programs Historical contributor: G. Dantzig, late 1940

More information

Integer Programming Theory

Integer Programming Theory Integer Programming Theory Laura Galli October 24, 2016 In the following we assume all functions are linear, hence we often drop the term linear. In discrete optimization, we seek to find a solution x

More information

Some Advanced Topics in Linear Programming

Some Advanced Topics in Linear Programming Some Advanced Topics in Linear Programming Matthew J. Saltzman July 2, 995 Connections with Algebra and Geometry In this section, we will explore how some of the ideas in linear programming, duality theory,

More information

Math 5593 Linear Programming Lecture Notes

Math 5593 Linear Programming Lecture Notes Math 5593 Linear Programming Lecture Notes Unit II: Theory & Foundations (Convex Analysis) University of Colorado Denver, Fall 2013 Topics 1 Convex Sets 1 1.1 Basic Properties (Luenberger-Ye Appendix B.1).........................

More information

16.410/413 Principles of Autonomy and Decision Making

16.410/413 Principles of Autonomy and Decision Making 16.410/413 Principles of Autonomy and Decision Making Lecture 17: The Simplex Method Emilio Frazzoli Aeronautics and Astronautics Massachusetts Institute of Technology November 10, 2010 Frazzoli (MIT)

More information

MATH 890 HOMEWORK 2 DAVID MEREDITH

MATH 890 HOMEWORK 2 DAVID MEREDITH MATH 890 HOMEWORK 2 DAVID MEREDITH (1) Suppose P and Q are polyhedra. Then P Q is a polyhedron. Moreover if P and Q are polytopes then P Q is a polytope. The facets of P Q are either F Q where F is a facet

More information

ORIE 6300 Mathematical Programming I September 2, Lecture 3

ORIE 6300 Mathematical Programming I September 2, Lecture 3 ORIE 6300 Mathematical Programming I September 2, 2014 Lecturer: David P. Williamson Lecture 3 Scribe: Divya Singhvi Last time we discussed how to take dual of an LP in two different ways. Today we will

More information

Lecture 5: Duality Theory

Lecture 5: Duality Theory Lecture 5: Duality Theory Rajat Mittal IIT Kanpur The objective of this lecture note will be to learn duality theory of linear programming. We are planning to answer following questions. What are hyperplane

More information

Design and Analysis of Algorithms (V)

Design and Analysis of Algorithms (V) Design and Analysis of Algorithms (V) An Introduction to Linear Programming Guoqiang Li School of Software, Shanghai Jiao Tong University Homework Assignment 2 is announced! (deadline Apr. 10) Linear Programming

More information

6.854 Advanced Algorithms. Scribes: Jay Kumar Sundararajan. Duality

6.854 Advanced Algorithms. Scribes: Jay Kumar Sundararajan. Duality 6.854 Advanced Algorithms Scribes: Jay Kumar Sundararajan Lecturer: David Karger Duality This lecture covers weak and strong duality, and also explains the rules for finding the dual of a linear program,

More information

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

Introduction to Mathematical Programming IE496. Final Review. Dr. Ted Ralphs Introduction to Mathematical Programming IE496 Final Review Dr. Ted Ralphs IE496 Final Review 1 Course Wrap-up: Chapter 2 In the introduction, we discussed the general framework of mathematical modeling

More information

Combinatorial Optimization

Combinatorial Optimization Combinatorial Optimization Frank de Zeeuw EPFL 2012 Today Introduction Graph problems - What combinatorial things will we be optimizing? Algorithms - What kind of solution are we looking for? Linear Programming

More information

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

3. The Simplex algorithmn The Simplex algorithmn 3.1 Forms of linear programs 11 3.1 Forms of linear programs... 12 3.2 Basic feasible solutions... 13 3.3 The geometry of linear programs... 14 3.4 Local search among basic feasible solutions... 15 3.5 Organization in tableaus...

More information

Real life Problem. Review

Real life Problem. Review Linear Programming The Modelling Cycle in Decision Maths Accept solution Real life Problem Yes No Review Make simplifying assumptions Compare the solution with reality is it realistic? Interpret the solution

More information

arxiv: v1 [cs.cc] 30 Jun 2017

arxiv: v1 [cs.cc] 30 Jun 2017 On the Complexity of Polytopes in LI( Komei Fuuda May Szedlá July, 018 arxiv:170610114v1 [cscc] 30 Jun 017 Abstract In this paper we consider polytopes given by systems of n inequalities in d variables,

More information

Convex Geometry arising in Optimization

Convex Geometry arising in Optimization Convex Geometry arising in Optimization Jesús A. De Loera University of California, Davis Berlin Mathematical School Summer 2015 WHAT IS THIS COURSE ABOUT? Combinatorial Convexity and Optimization PLAN

More information

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

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize. Cornell University, Fall 2017 CS 6820: Algorithms Lecture notes on the simplex method September 2017 1 The Simplex Method We will present an algorithm to solve linear programs of the form maximize subject

More information

Math 414 Lecture 2 Everyone have a laptop?

Math 414 Lecture 2 Everyone have a laptop? Math 44 Lecture 2 Everyone have a laptop? THEOREM. Let v,...,v k be k vectors in an n-dimensional space and A = [v ;...; v k ] v,..., v k independent v,..., v k span the space v,..., v k a basis v,...,

More information

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

POLYHEDRAL GEOMETRY. Convex functions and sets. Mathematical Programming Niels Lauritzen Recall that a subset C R n is convex if POLYHEDRAL GEOMETRY Mathematical Programming Niels Lauritzen 7.9.2007 Convex functions and sets Recall that a subset C R n is convex if {λx + (1 λ)y 0 λ 1} C for every x, y C and 0 λ 1. A function f :

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Combinatorial Optimization G. Guérard Department of Nouvelles Energies Ecole Supérieur d Ingénieurs Léonard de Vinci Lecture 1 GG A.I. 1/34 Outline 1 Motivation 2 Geometric resolution

More information

OPERATIONS RESEARCH. Linear Programming Problem

OPERATIONS RESEARCH. Linear Programming Problem OPERATIONS RESEARCH Chapter 1 Linear Programming Problem Prof. Bibhas C. Giri Department of Mathematics Jadavpur University Kolkata, India Email: bcgiri.jumath@gmail.com 1.0 Introduction Linear programming

More information

16.410/413 Principles of Autonomy and Decision Making

16.410/413 Principles of Autonomy and Decision Making 16.410/413 Principles of Autonomy and Decision Making Lecture 16: Mathematical Programming I Emilio Frazzoli Aeronautics and Astronautics Massachusetts Institute of Technology November 8, 2010 E. Frazzoli

More information

Math 273a: Optimization Linear programming

Math 273a: Optimization Linear programming Math 273a: Optimization Linear programming Instructor: Wotao Yin Department of Mathematics, UCLA Fall 2015 some material taken from the textbook Chong-Zak, 4th Ed. History The word programming used traditionally

More information

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

Linear Programming. Linear Programming. Linear Programming. Example: Profit Maximization (1/4) Iris Hui-Ru Jiang Fall Linear programming Linear Programming 3 describes a broad class of optimization tasks in which both the optimization criterion and the constraints are linear functions. Linear Programming consists of three parts: A set of

More information

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

College of Computer & Information Science Fall 2007 Northeastern University 14 September 2007 College of Computer & Information Science Fall 2007 Northeastern University 14 September 2007 CS G399: Algorithmic Power Tools I Scribe: Eric Robinson Lecture Outline: Linear Programming: Vertex Definitions

More information

IE 5531: Engineering Optimization I

IE 5531: Engineering Optimization I IE 5531: Engineering Optimization I Lecture 3: Linear Programming, Continued Prof. John Gunnar Carlsson September 15, 2010 Prof. John Gunnar Carlsson IE 5531: Engineering Optimization I September 15, 2010

More information

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

LECTURE 6: INTERIOR POINT METHOD. 1. Motivation 2. Basic concepts 3. Primal affine scaling algorithm 4. Dual affine scaling algorithm LECTURE 6: INTERIOR POINT METHOD 1. Motivation 2. Basic concepts 3. Primal affine scaling algorithm 4. Dual affine scaling algorithm Motivation Simplex method works well in general, but suffers from exponential-time

More information

Convexity: an introduction

Convexity: an introduction Convexity: an introduction Geir Dahl CMA, Dept. of Mathematics and Dept. of Informatics University of Oslo 1 / 74 1. Introduction 1. Introduction what is convexity where does it arise main concepts and

More information

CHAPTER 3 LINEAR PROGRAMMING: SIMPLEX METHOD

CHAPTER 3 LINEAR PROGRAMMING: SIMPLEX METHOD CHAPTER 3 LINEAR PROGRAMMING: SIMPLEX METHOD Linear programming is optimization problem where the objective function is linear and all equality and inequality constraints are linear. This problem was first

More information

Introduction to Modern Control Systems

Introduction to Modern Control Systems Introduction to Modern Control Systems Convex Optimization, Duality and Linear Matrix Inequalities Kostas Margellos University of Oxford AIMS CDT 2016-17 Introduction to Modern Control Systems November

More information

Polytopes Course Notes

Polytopes Course Notes Polytopes Course Notes Carl W. Lee Department of Mathematics University of Kentucky Lexington, KY 40506 lee@ms.uky.edu Fall 2013 i Contents 1 Polytopes 1 1.1 Convex Combinations and V-Polytopes.....................

More information

Week 5. Convex Optimization

Week 5. Convex Optimization Week 5. Convex Optimization Lecturer: Prof. Santosh Vempala Scribe: Xin Wang, Zihao Li Feb. 9 and, 206 Week 5. Convex Optimization. The convex optimization formulation A general optimization problem is

More information

Mathematical Programming and Research Methods (Part II)

Mathematical Programming and Research Methods (Part II) Mathematical Programming and Research Methods (Part II) 4. Convexity and Optimization Massimiliano Pontil (based on previous lecture by Andreas Argyriou) 1 Today s Plan Convex sets and functions Types

More information

LP Geometry: outline. A general LP. minimize x c T x s.t. a T i. x b i, i 2 M 1 a T i x = b i, i 2 M 3 x j 0, j 2 N 1. where

LP Geometry: outline. A general LP. minimize x c T x s.t. a T i. x b i, i 2 M 1 a T i x = b i, i 2 M 3 x j 0, j 2 N 1. where LP Geometry: outline I Polyhedra I Extreme points, vertices, basic feasible solutions I Degeneracy I Existence of extreme points I Optimality of extreme points IOE 610: LP II, Fall 2013 Geometry of Linear

More information

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

Advanced Linear Programming. Organisation. Lecturers: Leen Stougie, CWI and Vrije Universiteit in Amsterdam Advanced Linear Programming Organisation Lecturers: Leen Stougie, CWI and Vrije Universiteit in Amsterdam E-mail: stougie@cwi.nl Marjan van den Akker Universiteit Utrecht marjan@cs.uu.nl Advanced Linear

More information

Lecture 5: Properties of convex sets

Lecture 5: Properties of convex sets Lecture 5: Properties of convex sets Rajat Mittal IIT Kanpur This week we will see properties of convex sets. These properties make convex sets special and are the reason why convex optimization problems

More information

THEORY OF LINEAR AND INTEGER PROGRAMMING

THEORY OF LINEAR AND INTEGER PROGRAMMING THEORY OF LINEAR AND INTEGER PROGRAMMING ALEXANDER SCHRIJVER Centrum voor Wiskunde en Informatica, Amsterdam A Wiley-Inter science Publication JOHN WILEY & SONS^ Chichester New York Weinheim Brisbane Singapore

More information

LP-Modelling. dr.ir. C.A.J. Hurkens Technische Universiteit Eindhoven. January 30, 2008

LP-Modelling. dr.ir. C.A.J. Hurkens Technische Universiteit Eindhoven. January 30, 2008 LP-Modelling dr.ir. C.A.J. Hurkens Technische Universiteit Eindhoven January 30, 2008 1 Linear and Integer Programming After a brief check with the backgrounds of the participants it seems that the following

More information

COMP331/557. Chapter 2: The Geometry of Linear Programming. (Bertsimas & Tsitsiklis, Chapter 2)

COMP331/557. Chapter 2: The Geometry of Linear Programming. (Bertsimas & Tsitsiklis, Chapter 2) COMP331/557 Chapter 2: The Geometry of Linear Programming (Bertsimas & Tsitsiklis, Chapter 2) 49 Polyhedra and Polytopes Definition 2.1. Let A 2 R m n and b 2 R m. a set {x 2 R n A x b} is called polyhedron

More information

Polyhedral Compilation Foundations

Polyhedral Compilation Foundations Polyhedral Compilation Foundations Louis-Noël Pouchet pouchet@cse.ohio-state.edu Dept. of Computer Science and Engineering, the Ohio State University Feb 15, 2010 888.11, Class #4 Introduction: Polyhedral

More information

EC 521 MATHEMATICAL METHODS FOR ECONOMICS. Lecture 2: Convex Sets

EC 521 MATHEMATICAL METHODS FOR ECONOMICS. Lecture 2: Convex Sets EC 51 MATHEMATICAL METHODS FOR ECONOMICS Lecture : Convex Sets Murat YILMAZ Boğaziçi University In this section, we focus on convex sets, separating hyperplane theorems and Farkas Lemma. And as an application

More information

Applied Integer Programming

Applied Integer Programming Applied Integer Programming D.S. Chen; R.G. Batson; Y. Dang Fahimeh 8.2 8.7 April 21, 2015 Context 8.2. Convex sets 8.3. Describing a bounded polyhedron 8.4. Describing unbounded polyhedron 8.5. Faces,

More information

ACTUALLY DOING IT : an Introduction to Polyhedral Computation

ACTUALLY DOING IT : an Introduction to Polyhedral Computation ACTUALLY DOING IT : an Introduction to Polyhedral Computation Jesús A. De Loera Department of Mathematics Univ. of California, Davis http://www.math.ucdavis.edu/ deloera/ 1 What is a Convex Polytope? 2

More information

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

(67686) Mathematical Foundations of AI July 30, Lecture 11 (67686) Mathematical Foundations of AI July 30, 2008 Lecturer: Ariel D. Procaccia Lecture 11 Scribe: Michael Zuckerman and Na ama Zohary 1 Cooperative Games N = {1,...,n} is the set of players (agents).

More information

Lecture 16 October 23, 2014

Lecture 16 October 23, 2014 CS 224: Advanced Algorithms Fall 2014 Prof. Jelani Nelson Lecture 16 October 23, 2014 Scribe: Colin Lu 1 Overview In the last lecture we explored the simplex algorithm for solving linear programs. While

More information

Chapter II. Linear Programming

Chapter II. Linear Programming 1 Chapter II Linear Programming 1. Introduction 2. Simplex Method 3. Duality Theory 4. Optimality Conditions 5. Applications (QP & SLP) 6. Sensitivity Analysis 7. Interior Point Methods 1 INTRODUCTION

More information

Linear Programming [Read Chapters F and G first.] Status: Text beta. Needs figures.

Linear Programming [Read Chapters F and G first.] Status: Text beta. Needs figures. The greatest flood has the soonest ebb; the sorest tempest the most sudden calm; the hottest love the coldest end; and from the deepest desire oftentimes ensues the deadliest hate. Socrates Th extremes

More information

4 Linear Programming (LP) E. Amaldi -- Foundations of Operations Research -- Politecnico di Milano 1

4 Linear Programming (LP) E. Amaldi -- Foundations of Operations Research -- Politecnico di Milano 1 4 Linear Programming (LP) E. Amaldi -- Foundations of Operations Research -- Politecnico di Milano 1 Definition: A Linear Programming (LP) problem is an optimization problem: where min f () s.t. X n the

More information

15.082J and 6.855J. Lagrangian Relaxation 2 Algorithms Application to LPs

15.082J and 6.855J. Lagrangian Relaxation 2 Algorithms Application to LPs 15.082J and 6.855J Lagrangian Relaxation 2 Algorithms Application to LPs 1 The Constrained Shortest Path Problem (1,10) 2 (1,1) 4 (2,3) (1,7) 1 (10,3) (1,2) (10,1) (5,7) 3 (12,3) 5 (2,2) 6 Find the shortest

More information

Notes for Lecture 18

Notes for Lecture 18 U.C. Berkeley CS17: Intro to CS Theory Handout N18 Professor Luca Trevisan November 6, 21 Notes for Lecture 18 1 Algorithms for Linear Programming Linear programming was first solved by the simplex method

More information

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

15-451/651: Design & Analysis of Algorithms October 11, 2018 Lecture #13: Linear Programming I last changed: October 9, 2018 15-451/651: Design & Analysis of Algorithms October 11, 2018 Lecture #13: Linear Programming I last changed: October 9, 2018 In this lecture, we describe a very general problem called linear programming

More information

Discrete Optimization. Lecture Notes 2

Discrete Optimization. Lecture Notes 2 Discrete Optimization. Lecture Notes 2 Disjunctive Constraints Defining variables and formulating linear constraints can be straightforward or more sophisticated, depending on the problem structure. The

More information

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

Introduction to Mathematical Programming IE406. Lecture 4. Dr. Ted Ralphs Introduction to Mathematical Programming IE406 Lecture 4 Dr. Ted Ralphs IE406 Lecture 4 1 Reading for This Lecture Bertsimas 2.2-2.4 IE406 Lecture 4 2 The Two Crude Petroleum Example Revisited Recall the

More information

1 Linear Programming. 1.1 Optimizion problems and convex polytopes 1 LINEAR PROGRAMMING

1 Linear Programming. 1.1 Optimizion problems and convex polytopes 1 LINEAR PROGRAMMING 1 LINEAR PROGRAMMING 1 Linear Programming Now, we will talk a little bit about Linear Programming. We say that a problem is an instance of linear programming when it can be effectively expressed in the

More information

CS483 Analysis of Algorithms Lecture 09 Linear Programming 01

CS483 Analysis of Algorithms Lecture 09 Linear Programming 01 CS483 Analysis of Algorithms Lecture 09 Linear Programming 01 Jyh-Ming Lien April 09, 2009 this lecture note is based on Algorithms by S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani and to the Design

More information

Notes taken by Mea Wang. February 11, 2005

Notes taken by Mea Wang. February 11, 2005 CSC2411 - Linear Programming and Combinatorial Optimization Lecture 5: Smoothed Analysis, Randomized Combinatorial Algorithms, and Linear Programming Duality Notes taken by Mea Wang February 11, 2005 Summary:

More information

Simplex Algorithm in 1 Slide

Simplex Algorithm in 1 Slide Administrivia 1 Canonical form: Simplex Algorithm in 1 Slide If we do pivot in A r,s >0, where c s

More information

Modeling and Analysis of Hybrid Systems

Modeling and Analysis of Hybrid Systems Modeling and Analysis of Hybrid Systems Convex polyhedra Prof. Dr. Erika Ábrahám Informatik 2 - LuFG Theory of Hybrid Systems RWTH Aachen University Szeged, Hungary, 27 September - 06 October 2017 Ábrahám

More information