Linear Programming Eric Price UT Austin CS 331, Spring 2020 - - PowerPoint PPT Presentation

linear programming
SMART_READER_LITE
LIVE PREVIEW

Linear Programming Eric Price UT Austin CS 331, Spring 2020 - - PowerPoint PPT Presentation

Linear Programming Eric Price UT Austin CS 331, Spring 2020 Coronavirus Edition CS 331, Spring Eric Price (UT Austin) Linear Programming / 17 Logistics Office hours by appointment this week. CS 331, Spring Eric Price (UT Austin) Linear


slide-1
SLIDE 1

Linear Programming

Eric Price

UT Austin

CS 331, Spring 2020 Coronavirus Edition

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-2
SLIDE 2

Logistics

Office hours by appointment this week.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-3
SLIDE 3

Logistics

Office hours by appointment this week. Problem 2(b), on set selection, is now extra credit (= 1/8 of a HW)

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-4
SLIDE 4

Logistics

Office hours by appointment this week. Problem 2(b), on set selection, is now extra credit (= 1/8 of a HW) This week: linear programming

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-5
SLIDE 5

Logistics

Office hours by appointment this week. Problem 2(b), on set selection, is now extra credit (= 1/8 of a HW) This week: linear programming Next week: complexity

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-6
SLIDE 6

Class Outline

1

Introduction to Linear Programming

2

How to Solve a Linear Program

3

Reducing Problems to Linear Programs

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-7
SLIDE 7

Linear Programming

General way of writing problems: maximize linear function subject to linear constraints.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-8
SLIDE 8

Linear Programming

General way of writing problems: maximize linear function subject to linear constraints. Developed 1939 by Leonid Kantorovich

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-9
SLIDE 9

Linear Programming

General way of writing problems: maximize linear function subject to linear constraints. Developed 1939 by Leonid Kantorovich Think central planning of factories:

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-10
SLIDE 10

Linear Programming

General way of writing problems: maximize linear function subject to linear constraints. Developed 1939 by Leonid Kantorovich Think central planning of factories:

◮ Can produce cars or trucks Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-11
SLIDE 11

Linear Programming

General way of writing problems: maximize linear function subject to linear constraints. Developed 1939 by Leonid Kantorovich Think central planning of factories:

◮ Can produce cars or trucks ◮ Cars take 2 tons metal, 1 ton wood Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-12
SLIDE 12

Linear Programming

General way of writing problems: maximize linear function subject to linear constraints. Developed 1939 by Leonid Kantorovich Think central planning of factories:

◮ Can produce cars or trucks ◮ Cars take 2 tons metal, 1 ton wood ◮ Trucks take 3 tons metal, 5 tons wood Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-13
SLIDE 13

Linear Programming

General way of writing problems: maximize linear function subject to linear constraints. Developed 1939 by Leonid Kantorovich Think central planning of factories:

◮ Can produce cars or trucks ◮ Cars take 2 tons metal, 1 ton wood ◮ Trucks take 3 tons metal, 5 tons wood ◮ Trucks carry twice as much as cars. Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-14
SLIDE 14

Linear Programming

General way of writing problems: maximize linear function subject to linear constraints. Developed 1939 by Leonid Kantorovich Think central planning of factories:

◮ Can produce cars or trucks ◮ Cars take 2 tons metal, 1 ton wood ◮ Trucks take 3 tons metal, 5 tons wood ◮ Trucks carry twice as much as cars. ◮ You are supplied 12 tons metal, 15 tons wood / day. Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-15
SLIDE 15

Linear Programming

General way of writing problems: maximize linear function subject to linear constraints. Developed 1939 by Leonid Kantorovich Think central planning of factories:

◮ Can produce cars or trucks ◮ Cars take 2 tons metal, 1 ton wood ◮ Trucks take 3 tons metal, 5 tons wood ◮ Trucks carry twice as much as cars. ◮ You are supplied 12 tons metal, 15 tons wood / day. ◮ Q: how many cars vs trucks to produce to maximize total capacity? Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-16
SLIDE 16

Linear Programming

General way of writing problems: maximize linear function subject to linear constraints. Developed 1939 by Leonid Kantorovich Think central planning of factories:

◮ Can produce cars or trucks ◮ Cars take 2 tons metal, 1 ton wood ◮ Trucks take 3 tons metal, 5 tons wood ◮ Trucks carry twice as much as cars. ◮ You are supplied 12 tons metal, 15 tons wood / day. ◮ Q: how many cars vs trucks to produce to maximize total capacity?

Mathematically: maximize: C + 2T subject to: 2C + 3T ≤ 12 C + 5T ≤ 15 C, T ≥ 0

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-17
SLIDE 17

Solving small cases by hand

maximize: C + 2T subject to: 2C + 3T ≤ 12 C + 5T ≤ 15 C, T ≥ 0

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-18
SLIDE 18

Solving small cases by hand

maximize: C + 2T subject to: 2C + 3T ≤ 12 C + 5T ≤ 15 C, T ≥ 0 Algebraically:

◮ Find all vertices, and for each: ◮ Check if feasible (satisfy the constraints) ◮ Pick the feasible vertex maximizing the objective. Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-19
SLIDE 19

Solving small cases by hand

maximize: C + 2T subject to: 2C + 3T ≤ 12 C + 5T ≤ 15 C, T ≥ 0 Algebraically:

◮ Find all vertices, and for each: ◮ Check if feasible (satisfy the constraints) ◮ Pick the feasible vertex maximizing the objective.

Geometrically:

◮ Draw the picture of all feasible points ◮ Slide in the direction of the objective until you get stuck. Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-20
SLIDE 20

General Linear Programming (LP)

Linear Programming

Optimize (maximize or minimize) a linear objective in many variables, subject to linear constraints on them (=, ≤, ≥).

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-21
SLIDE 21

General Linear Programming (LP)

Linear Programming

Optimize (maximize or minimize) a linear objective in many variables, subject to linear constraints on them (=, ≤, ≥). maximize: x1 + 3x2 − 345x3 + x4 subject to: x1 − 17x2 ≤ x4 + 12 x4 − x3 ≥ x2 67x2 − 3x1 = 83 x3 ≤ 0

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-22
SLIDE 22

Formulations of LP

Standard form (or “symmetric”)

For m constraints on n variables, given A ∈ Rm×n, b ∈ Rm, c ∈ Rn: maximize: c · x subject to: Ax ≤ b x ≥ 0

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-23
SLIDE 23

Formulations of LP

Standard form (or “symmetric”)

For m constraints on n variables, given A ∈ Rm×n, b ∈ Rm, c ∈ Rn: maximize: c · x subject to: Ax ≤ b x ≥ 0

Common alternative forms

“Alternative form” “Slack form” maximize: c · x maximize: c · x subject to: Ax ≤ b

  • r

subject to: Ax = b x ≥ 0

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-24
SLIDE 24

The forms are reducible to each other

Standard Alternative Slack max c · x max c · x max c · x Ax ≤ b Ax ≤ b Ax = b x ≥ 0 x ≥ 0

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-25
SLIDE 25

The forms are reducible to each other

Standard Alternative Slack max c · x max c · x max c · x Ax ≤ b Ax ≤ b Ax = b x ≥ 0 x ≥ 0 Standard → alternative:

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-26
SLIDE 26

The forms are reducible to each other

Standard Alternative Slack max c · x max c · x max c · x Ax ≤ b Ax ≤ b Ax = b x ≥ 0 x ≥ 0 Standard → alternative: solve alternative with A′ = A −In

  • , b′ =

b

  • Eric Price (UT Austin)

Linear Programming CS 331, Spring / 17

slide-27
SLIDE 27

The forms are reducible to each other

Standard Alternative Slack max c · x max c · x max c · x Ax ≤ b Ax ≤ b Ax = b x ≥ 0 x ≥ 0 Standard → alternative: solve alternative with A′ = A −In

  • , b′ =

b

  • Alternative → standard:

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-28
SLIDE 28

The forms are reducible to each other

Standard Alternative Slack max c · x max c · x max c · x Ax ≤ b Ax ≤ b Ax = b x ≥ 0 x ≥ 0 Standard → alternative: solve alternative with A′ = A −In

  • , b′ =

b

  • Alternative → standard: new nonnegative variables y and z, so

x = y − z. Solve standard with A′ =

  • A

−A

  • .

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-29
SLIDE 29

The forms are reducible to each other

Standard Alternative Slack max c · x max c · x max c · x Ax ≤ b Ax ≤ b Ax = b x ≥ 0 x ≥ 0 Standard → alternative: solve alternative with A′ = A −In

  • , b′ =

b

  • Alternative → standard: new nonnegative variables y and z, so

x = y − z. Solve standard with A′ =

  • A

−A

  • .

Slack → standard:

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-30
SLIDE 30

The forms are reducible to each other

Standard Alternative Slack max c · x max c · x max c · x Ax ≤ b Ax ≤ b Ax = b x ≥ 0 x ≥ 0 Standard → alternative: solve alternative with A′ = A −In

  • , b′ =

b

  • Alternative → standard: new nonnegative variables y and z, so

x = y − z. Solve standard with A′ =

  • A

−A

  • .

Slack → standard: solve standard with A′ = A −A

  • , b′ =

b −b

  • .

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-31
SLIDE 31

The forms are reducible to each other

Standard Alternative Slack max c · x max c · x max c · x Ax ≤ b Ax ≤ b Ax = b x ≥ 0 x ≥ 0 Standard → alternative: solve alternative with A′ = A −In

  • , b′ =

b

  • Alternative → standard: new nonnegative variables y and z, so

x = y − z. Solve standard with A′ =

  • A

−A

  • .

Slack → standard: solve standard with A′ = A −A

  • , b′ =

b −b

  • .

Standard → slack:

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-32
SLIDE 32

The forms are reducible to each other

Standard Alternative Slack max c · x max c · x max c · x Ax ≤ b Ax ≤ b Ax = b x ≥ 0 x ≥ 0 Standard → alternative: solve alternative with A′ = A −In

  • , b′ =

b

  • Alternative → standard: new nonnegative variables y and z, so

x = y − z. Solve standard with A′ =

  • A

−A

  • .

Slack → standard: solve standard with A′ = A −A

  • , b′ =

b −b

  • .

Standard → slack: m new “slack” variables z, solve slack with A′ =

  • A

Im

  • Eric Price (UT Austin)

Linear Programming CS 331, Spring / 17

slide-33
SLIDE 33

The forms are reducible to each other

Standard Alternative Slack max c · x max c · x max c · x Ax ≤ b Ax ≤ b Ax = b x ≥ 0 x ≥ 0 Standard → alternative: solve alternative with A′ = A −In

  • , b′ =

b

  • Alternative → standard: new nonnegative variables y and z, so

x = y − z. Solve standard with A′ =

  • A

−A

  • .

Slack → standard: solve standard with A′ = A −A

  • , b′ =

b −b

  • .

Standard → slack: m new “slack” variables z, solve slack with A′ =

  • A

Im

  • Minimization problems?

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-34
SLIDE 34

The forms are reducible to each other

Standard Alternative Slack max c · x max c · x max c · x Ax ≤ b Ax ≤ b Ax = b x ≥ 0 x ≥ 0 Standard → alternative: solve alternative with A′ = A −In

  • , b′ =

b

  • Alternative → standard: new nonnegative variables y and z, so

x = y − z. Solve standard with A′ =

  • A

−A

  • .

Slack → standard: solve standard with A′ = A −A

  • , b′ =

b −b

  • .

Standard → slack: m new “slack” variables z, solve slack with A′ =

  • A

Im

  • Minimization problems? c′ = −c.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-35
SLIDE 35

Class Outline

1

Introduction to Linear Programming

2

How to Solve a Linear Program

3

Reducing Problems to Linear Programs

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-36
SLIDE 36

Overview of solution methods

Simplex

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-37
SLIDE 37

Overview of solution methods

Simplex Ellipsoid

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-38
SLIDE 38

Overview of solution methods

Simplex Ellipsoid Interior point

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-39
SLIDE 39

Overview of solution methods

Simplex

◮ Start at a vertex, and walk from vertex to vertex, increasing objective.

Ellipsoid Interior point

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-40
SLIDE 40

Overview of solution methods

Simplex

◮ Start at a vertex, and walk from vertex to vertex, increasing objective. ◮ First algorithm (Dantzig ’47)

Ellipsoid Interior point

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-41
SLIDE 41

Overview of solution methods

Simplex

◮ Start at a vertex, and walk from vertex to vertex, increasing objective. ◮ First algorithm (Dantzig ’47) ◮ Worst-case inputs can take exponential time, but fast on most inputs.

Ellipsoid Interior point

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-42
SLIDE 42

Overview of solution methods

Simplex

◮ Start at a vertex, and walk from vertex to vertex, increasing objective. ◮ First algorithm (Dantzig ’47) ◮ Worst-case inputs can take exponential time, but fast on most inputs.

Ellipsoid

◮ Iteratively shrink an ellipsoid around the solution.

Interior point

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-43
SLIDE 43

Overview of solution methods

Simplex

◮ Start at a vertex, and walk from vertex to vertex, increasing objective. ◮ First algorithm (Dantzig ’47) ◮ Worst-case inputs can take exponential time, but fast on most inputs.

Ellipsoid

◮ Iteratively shrink an ellipsoid around the solution. ◮ First polynomial time algorithm (Khachiyan ’79); O(n6L) for L bits of

precision.

Interior point

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-44
SLIDE 44

Overview of solution methods

Simplex

◮ Start at a vertex, and walk from vertex to vertex, increasing objective. ◮ First algorithm (Dantzig ’47) ◮ Worst-case inputs can take exponential time, but fast on most inputs.

Ellipsoid

◮ Iteratively shrink an ellipsoid around the solution. ◮ First polynomial time algorithm (Khachiyan ’79); O(n6L) for L bits of

precision.

Interior point

◮ Iteratively move through the center of the region. Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-45
SLIDE 45

Overview of solution methods

Simplex

◮ Start at a vertex, and walk from vertex to vertex, increasing objective. ◮ First algorithm (Dantzig ’47) ◮ Worst-case inputs can take exponential time, but fast on most inputs.

Ellipsoid

◮ Iteratively shrink an ellipsoid around the solution. ◮ First polynomial time algorithm (Khachiyan ’79); O(n6L) for L bits of

precision.

Interior point

◮ Iteratively move through the center of the region. ◮ Introduced by Karmarkar in ’84, O(n3.5). Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-46
SLIDE 46

Overview of solution methods

Simplex

◮ Start at a vertex, and walk from vertex to vertex, increasing objective. ◮ First algorithm (Dantzig ’47) ◮ Worst-case inputs can take exponential time, but fast on most inputs.

Ellipsoid

◮ Iteratively shrink an ellipsoid around the solution. ◮ First polynomial time algorithm (Khachiyan ’79); O(n6L) for L bits of

precision.

Interior point

◮ Iteratively move through the center of the region. ◮ Introduced by Karmarkar in ’84, O(n3.5). ◮ More practical than ellipsoid, even better than simplex sometimes. Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-47
SLIDE 47

Overview of solution methods

Simplex

◮ Start at a vertex, and walk from vertex to vertex, increasing objective. ◮ First algorithm (Dantzig ’47) ◮ Worst-case inputs can take exponential time, but fast on most inputs.

Ellipsoid

◮ Iteratively shrink an ellipsoid around the solution. ◮ First polynomial time algorithm (Khachiyan ’79); O(n6L) for L bits of

precision.

Interior point

◮ Iteratively move through the center of the region. ◮ Introduced by Karmarkar in ’84, O(n3.5). ◮ More practical than ellipsoid, even better than simplex sometimes. ◮ Best theoretical result: O(n2.38L) time (Cohen, Lee, Song ’19). Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-48
SLIDE 48

Simplex Algorithm

Linear program with n variables and m constraints (including xi ≥ 0).

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-49
SLIDE 49

Simplex Algorithm

Linear program with n variables and m constraints (including xi ≥ 0). Vertex of feasible set is where some n constraints are tight.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-50
SLIDE 50

Simplex Algorithm

Linear program with n variables and m constraints (including xi ≥ 0). Vertex of feasible set is where some n constraints are tight. n adjacent vertices: drop one constraint, move along line until another constraint becomes tight.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-51
SLIDE 51

Simplex Algorithm

Linear program with n variables and m constraints (including xi ≥ 0). Vertex of feasible set is where some n constraints are tight. n adjacent vertices: drop one constraint, move along line until another constraint becomes tight.

Simplex algorithm

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-52
SLIDE 52

Simplex Algorithm

Linear program with n variables and m constraints (including xi ≥ 0). Vertex of feasible set is where some n constraints are tight. n adjacent vertices: drop one constraint, move along line until another constraint becomes tight.

Simplex algorithm

1

Find an initial vertex (we’ll see how later)

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-53
SLIDE 53

Simplex Algorithm

Linear program with n variables and m constraints (including xi ≥ 0). Vertex of feasible set is where some n constraints are tight. n adjacent vertices: drop one constraint, move along line until another constraint becomes tight.

Simplex algorithm

1

Find an initial vertex (we’ll see how later)

2

Repeatedly move to adjacent vertex of larger objective.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-54
SLIDE 54

Simplex Algorithm

Linear program with n variables and m constraints (including xi ≥ 0). Vertex of feasible set is where some n constraints are tight. n adjacent vertices: drop one constraint, move along line until another constraint becomes tight.

Simplex algorithm

1

Find an initial vertex (we’ll see how later)

2

Repeatedly move to adjacent vertex of larger objective.

Correctness:

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-55
SLIDE 55

Simplex Algorithm

Linear program with n variables and m constraints (including xi ≥ 0). Vertex of feasible set is where some n constraints are tight. n adjacent vertices: drop one constraint, move along line until another constraint becomes tight.

Simplex algorithm

1

Find an initial vertex (we’ll see how later)

2

Repeatedly move to adjacent vertex of larger objective.

Correctness:

◮ If we get to the true solution, the algorithm will stop. Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-56
SLIDE 56

Simplex Algorithm

Linear program with n variables and m constraints (including xi ≥ 0). Vertex of feasible set is where some n constraints are tight. n adjacent vertices: drop one constraint, move along line until another constraint becomes tight.

Simplex algorithm

1

Find an initial vertex (we’ll see how later)

2

Repeatedly move to adjacent vertex of larger objective.

Correctness:

◮ If we get to the true solution, the algorithm will stop. ◮ By convexity: if not at the true solution, can move and make progress. Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-57
SLIDE 57

Simplex Algorithm

Linear program with n variables and m constraints (including xi ≥ 0). Vertex of feasible set is where some n constraints are tight. n adjacent vertices: drop one constraint, move along line until another constraint becomes tight.

Simplex algorithm

1

Find an initial vertex (we’ll see how later)

2

Repeatedly move to adjacent vertex of larger objective.

Correctness:

◮ If we get to the true solution, the algorithm will stop. ◮ By convexity: if not at the true solution, can move and make progress.

Running time:

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-58
SLIDE 58

Simplex Algorithm

Linear program with n variables and m constraints (including xi ≥ 0). Vertex of feasible set is where some n constraints are tight. n adjacent vertices: drop one constraint, move along line until another constraint becomes tight.

Simplex algorithm

1

Find an initial vertex (we’ll see how later)

2

Repeatedly move to adjacent vertex of larger objective.

Correctness:

◮ If we get to the true solution, the algorithm will stop. ◮ By convexity: if not at the true solution, can move and make progress.

Running time:

◮ Polynomial time per iteration. Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-59
SLIDE 59

Simplex Algorithm

Linear program with n variables and m constraints (including xi ≥ 0). Vertex of feasible set is where some n constraints are tight. n adjacent vertices: drop one constraint, move along line until another constraint becomes tight.

Simplex algorithm

1

Find an initial vertex (we’ll see how later)

2

Repeatedly move to adjacent vertex of larger objective.

Correctness:

◮ If we get to the true solution, the algorithm will stop. ◮ By convexity: if not at the true solution, can move and make progress.

Running time:

◮ Polynomial time per iteration. ◮ Number of iterations depends on problem instance & rule for choosing

next vertex, but could be exponential.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-60
SLIDE 60

Finding an initial feasible vertex

Simplex works, eventually, once you have a feasible vertex. Doesn’t seem so useful:

Problem

If you can solve “does this polytope have any feasible point” you can also solve linear programming (= optimize over polytopes).

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-61
SLIDE 61

Finding an initial feasible vertex

Simplex works, eventually, once you have a feasible vertex. Doesn’t seem so useful:

Problem

If you can solve “does this polytope have any feasible point” you can also solve linear programming (= optimize over polytopes).

Proof.

We want to determine OPT = max c · x s.t. Ax ≤ b. Then OPT ≥ τ if and only if the polytope Ax ≤ b c · x ≥ τ has any solution. So if we can solve this, we binary search on τ to solve LP.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-62
SLIDE 62

Finding an initial feasible vertex

Simplex works, eventually, once you have a feasible vertex.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-63
SLIDE 63

Finding an initial feasible vertex

Simplex works, eventually, once you have a feasible vertex. In general, finding a feasible vertex is as hard as LP.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-64
SLIDE 64

Finding an initial feasible vertex

Simplex works, eventually, once you have a feasible vertex. In general, finding a feasible vertex is as hard as LP. We create a new LP, where finding a feasible vertex is easy, and the

  • ptimal solution identifies a feasible point of the initial LP.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-65
SLIDE 65

Finding an initial feasible vertex

Simplex works, eventually, once you have a feasible vertex. In general, finding a feasible vertex is as hard as LP. We create a new LP, where finding a feasible vertex is easy, and the

  • ptimal solution identifies a feasible point of the initial LP.

Finding a feasible point

We want to find a point x such that Ax ≤ b, x ≥ 0. Introduce a new variable z ∈ R, and solve: minimize: z subject to: Ax − z ≤ b (NEW) x, z ≥ 0

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-66
SLIDE 66

Finding an initial feasible vertex

Simplex works, eventually, once you have a feasible vertex. In general, finding a feasible vertex is as hard as LP. We create a new LP, where finding a feasible vertex is easy, and the

  • ptimal solution identifies a feasible point of the initial LP.

Finding a feasible point

We want to find a point x such that Ax ≤ b, x ≥ 0. Introduce a new variable z ∈ R, and solve: minimize: z subject to: Ax − z ≤ b (NEW) x, z ≥ 0 z = 0 possible if and only if Ax ≤ b, x ≥ 0 is feasible.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-67
SLIDE 67

Finding an initial feasible vertex

Simplex works, eventually, once you have a feasible vertex. In general, finding a feasible vertex is as hard as LP. We create a new LP, where finding a feasible vertex is easy, and the

  • ptimal solution identifies a feasible point of the initial LP.

Finding a feasible point

We want to find a point x such that Ax ≤ b, x ≥ 0. Introduce a new variable z ∈ R, and solve: minimize: z subject to: Ax − z ≤ b (NEW) x, z ≥ 0 z = 0 possible if and only if Ax ≤ b, x ≥ 0 is feasible. x = 0, z = max(0, b1, . . . , bm) is a feasible vertex.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-68
SLIDE 68

Finding an initial feasible vertex

Simplex works, eventually, once you have a feasible vertex. In general, finding a feasible vertex is as hard as LP. We create a new LP, where finding a feasible vertex is easy, and the

  • ptimal solution identifies a feasible point of the initial LP.

Finding a feasible point

We want to find a point x such that Ax ≤ b, x ≥ 0. Introduce a new variable z ∈ R, and solve: minimize: z subject to: Ax − z ≤ b (NEW) x, z ≥ 0 z = 0 possible if and only if Ax ≤ b, x ≥ 0 is feasible. x = 0, z = max(0, b1, . . . , bm) is a feasible vertex. So simplex can get started on NEW and solve it.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-69
SLIDE 69

Finding an initial feasible vertex

Simplex works, eventually, once you have a feasible vertex.

Finding a feasible point

We want to find a point x such that Ax ≤ b, x ≥ 0. Introduce a new variable z ∈ R, and solve: minimize: z subject to: Ax − z ≤ b (NEW) x, z ≥ 0 Simplex can get started on NEW and solve it.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-70
SLIDE 70

Finding an initial feasible vertex

Simplex works, eventually, once you have a feasible vertex.

Finding a feasible point

We want to find a point x such that Ax ≤ b, x ≥ 0. Introduce a new variable z ∈ R, and solve: minimize: z subject to: Ax − z ≤ b (NEW) x, z ≥ 0 Simplex can get started on NEW and solve it. The solution to NEW returned by simplex is a vertex ( x, z) of NEW.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-71
SLIDE 71

Finding an initial feasible vertex

Simplex works, eventually, once you have a feasible vertex.

Finding a feasible point

We want to find a point x such that Ax ≤ b, x ≥ 0. Introduce a new variable z ∈ R, and solve: minimize: z subject to: Ax − z ≤ b (NEW) x, z ≥ 0 Simplex can get started on NEW and solve it. The solution to NEW returned by simplex is a vertex ( x, z) of NEW. NEW has n + 1 variables, one tight constraint of the optimum is z ≥ 0, and the other n are among Ax ≤ b, x ≥ 0.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-72
SLIDE 72

Finding an initial feasible vertex

Simplex works, eventually, once you have a feasible vertex.

Finding a feasible point

We want to find a point x such that Ax ≤ b, x ≥ 0. Introduce a new variable z ∈ R, and solve: minimize: z subject to: Ax − z ≤ b (NEW) x, z ≥ 0 Simplex can get started on NEW and solve it. The solution to NEW returned by simplex is a vertex ( x, z) of NEW. NEW has n + 1 variables, one tight constraint of the optimum is z ≥ 0, and the other n are among Ax ≤ b, x ≥ 0. Hence the solution x is a vertex of the original LP.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-73
SLIDE 73

Class Outline

1

Introduction to Linear Programming

2

How to Solve a Linear Program

3

Reducing Problems to Linear Programs

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-74
SLIDE 74

L1 linear regression

x y Given n points on plane: (x1, y1), . . . , (xn, yn). Find the line mx + b minimizing the average error: Err = 1 n

n

  • i=1

|yi − (mxi + b)|

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-75
SLIDE 75

L1 linear regression

x y Given n points on plane: (x1, y1), . . . , (xn, yn). Find the line mx + b minimizing the average error: Err = 1 n

n

  • i=1

|yi − (mxi + b)| Part (2): Now, minimize the maximum error.

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-76
SLIDE 76

Writing old problems as linear programs

Write network flow as a linear program Write shortest paths as a linear program Write minimum cut as a linear program

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-77
SLIDE 77

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17

slide-78
SLIDE 78

Eric Price (UT Austin) Linear Programming CS 331, Spring / 17