Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 19 Linear Program

Similar presentations


Presentation on theme: "Lecture 19 Linear Program"β€” Presentation transcript:

1 Lecture 19 Linear Program

2 Recap Shortest path Minimum spanning tree Maximum matching
Common: Optimizing some objective (length of paths, weight of the tree, number of matches) Very different techniques Hope: A common technique that can solve all problems

3 Linear Relationships Inequalities that are linear in all parameters.
Example. If d[u] = shortest path distance from s to u, then for any edge (u,v) 𝑑 𝑣 ≀𝑑 𝑒 +𝑀(𝑒,𝑣)

4 Linear Relationships Example 2: Let xi,j = 1 if course i is matched to classroom j, and 0 otherwise. Each classroom is matched to at most one course. βˆ€π‘— 𝑖=1 𝑛 π‘₯ 𝑖,𝑗 ≀1

5 Linear Program Optimize a linear function (objective), under a set of linear inequality constraints. max 2π‘₯+𝑦 π‘₯β‰₯0 𝑦β‰₯0 π‘₯+𝑦≀1

6 Geometric Interpretation
Linear inequality  Half planes x y x y x y π‘₯+𝑦≀1 π‘₯β‰₯0 𝑦β‰₯0

7 Geometric Interpretation
System of linear inequalities  intersections Green: Feasible set. Point in Green: feasible solution. x y

8 Geometric Interpretation
Objective function  Direction of gravity x y x y max 2π‘₯+𝑦

9 Geometric Interpretation
Optimal Point  Lowest point Optimal solution: (x, y) = (1, 0), value = 2. x y

10 Canonical Form min 𝑐,π‘₯ 𝐴π‘₯β‰₯𝑏 π‘₯β‰₯0 c x A x b β‰₯

11 Converting to Canonical Form
Equality constraints (e.g. x+y = 3) Solution: Split into two constraints π‘₯+𝑦β‰₯3 π‘₯+𝑦≀3

12 Converting to Canonical Form
Free variable: x may or may not be nonnegative. Solution: Split x into x1 and x2 π‘₯= π‘₯ 1 βˆ’ π‘₯ 2 π‘₯ 1 β‰₯0 π‘₯ 2 β‰₯0

13 Using LP to solve graph problems
Edge (i, j): Course i can be scheduled into classroom j Courses Classrooms Solution: A set of edges that do not share any vertices. (a matching)

14 Using LP to solve graph problems
1 2 1 2 3 3 1 2 4 5 6 4 1 1 3 2 7 8 9 1 1


Download ppt "Lecture 19 Linear Program"

Similar presentations


Ads by Google