580 likes | 652 Views
Learn about Linear Programming (LP) and its efficient algorithms, such as the Simplex, Ellipsoid, and Interior Point methods. Discover LP duality, integrality gaps, and LP relaxation for approximating solutions to complex problems.
E N D
Linear Programming-Based Approximation Algorithms Shoshana Neuburger Graduate Center, CUNY May 13, 2009
Linear Programming (LP) Given: m linear inequality constraints n Non-negative, real-valued variables Linear objective function Goal: Optimize objective function subject to constraints.
LP Any solution that satisfies all the constraints is a feasible solution. The feasible region forms a convex polytope in n-space. If there is an optimal solution, it will occur on one of the corner points of the region.
LP Example Objective: min 5x1+4x2 Subject to: 5x1+5x2 ≥ 15 and x1+3x2 ≥ 5 and 2x1+x2 ≥ 5
Solving LP Problems Efficient algorithms to solve LPs: Simplex algorithm (Dantzig – 1947) – practical, widely used, exponential time in worst case Ellipsoid algorithm (Khachiyan – 1979) – impractical, polynomial time Interior point algorithm (Kharmarkar – 1984) – practical, polynomial time
LP – Standard Form Minimize Subject to i = 1,…, m j = 1,…, n
LP – Standard Form In matrix form: min cx Subject to Ax ≥ b and x ≥ 0 All LP problems can be transformed to the standard form in poly time.
LP Example Minimize Subject to
LP Opt Solution Upper bound on OPT value: evaluate objective function at a feasible point How can we obtain lower bounds? linear combination of constraints which equals objective function corresponds to a dual LP solution
LP Example Minimize Subject to 16 is a lower bound since any feasible solution has a nonnegative setting for each xi
Dual Finding the best lower bound of OPT is an LP. We call this problem the dual program. And the original the primal program.
Primal Dual Min Max Sub. to
LP Duality dual opt = primal opt ∞ 0 26 The dual of the dual is the primal program. Existence of feasible solutions for primal and dual with matching objective function values implies that the solution is optimal to both. dual solutions primal solutions
Primal Dual Min max. subj. to (i = 1,…, m) (j = 1,…, n) (j = 1,…, n) (i = 1,…, m)
Weak Duality Thm Let x be a feasible solution for the primal program, and y a feasible solution for the dual program. Then,
Proof of Weak Duality Since Since We can see Which completes the proof. i.e.,
Duality Thm If an LP has an optimal solution, so does its dual, and at optimality their costs are equal.
Duality Thm The primal program has finite optimum iff its dual has finite optimum. If the primal program has opt x* and the dual program has opt y*, then
Complementary Slackness Let x be a primal feasible solution and y a dual feasible solution. Then x and y are both optimal iff (primal condition) for and (dual condition) for
LP Can use LP techniques to find exact algorithmic solution. Example: Max flow in network from source to sink. max-flow min-cut algorithm
Integer Programming Integer programming asks whether a system of linear inequalities with integer coefficients has an integer solution (NP). Linear programming asks whether a system of linear inequalities with integer coefficients has a rational solution (P) Interesting to note: Adding restrictions on the allowable problem instances will not change its complexity while Adding restrictions on the allowable solutions may make a problem easier, as hard, or harder.
0-1 Integer Programming • 0-1 Integer Programming is NP-complete • Karp (1972): this problem is NP-complete. Input: integer matrix C and integer vector b Property: exists 0-1 vector x such that Cx = b. • Reduction of SAT to 0-1 Int Programming: Cij = 1, if xj clause i = -1, if the complement of xj clause i = 0, otherwise bi = 1 – (# of complemented variables in clause i)
LP Relaxations Approximation Algorithms: Formulate the problem as an IP. (Since 0-1 IP is NP-hard, any NPO problem can be reduced to a 0-1 IP problem.) LP relaxation - let the variables in the IP problem take on real values. Use the LP (and its solution) to get a solution to the IP, and the original problem.
http://www.cs.uiuc.edu/homes/chekuri/teaching/fall2006/lect9and10.pdfhttp://www.cs.uiuc.edu/homes/chekuri/teaching/fall2006/lect9and10.pdf
Integrality Gap ** Min. LP ** OPTf(I): cost of opt. fract. solution to instance I. Integrality gap: worst case gap between integer optimum and fractional optimum. Exact relaxation: integrality gap = 1. The best approximation factor we can hope to prove is the integrality gap of the relaxation.
Approximation via LP Find good formulations Prove constructive (algorithmic) bounds on integrality gap Translate into effective algorithms
Pros of LP approach Generic paradigm that applies to all NPO problems Solution to LP gives both a lower bound (OPTLP(I)) on OPT(I) (in case of minimization) as well as useful information to convert fractional solution (round) into an integer solution. For many problems solution of better quality than guaranteed by integrality gaps Often LP can be solved faster than original formulation or insight leads to a combinatorial algorithm that is much faster in practice.
Cons of LP approach LPs are not easy to solve quickly although polynomial time algorithms exist. Numerical issues (not strongly polynomial time). Typical formulations have large size. Infeasible in some cases. Does not completely eliminate the search for a good formulation (algorithm).
Set Cover Given: universe U of n elements, S = {S1, S2, …, Sk}: a collection of subsets of U Cost function c: S→Q+ Goal: Find min cost subcollection of S covering all of U
Set Cover The frequency of an element is the number of sets it is in. f = frequency of most frequent element NP-hard problem App. algorithms achieve O(log n) or f. Vertex Cover is Set Cover with f=2.
Set Cover - Greedy Greedy Alg. (Vazirani, Chap 2) Iteratively choose the most cost-effective set until all elements are covered The most cost-effective set has the lowest ratio of cost to the number of new elements it includes. With dual fitting, can prove approximation guarantee of Hn
Set Cover as IP Indicator variable xi {0,1} for each set Si in S. The constraint is that we choose at least one of the sets containing each element. Minimize Subject to
LP-relaxation of IP Indicator variable xi {0,1} for each set Si in S. Indicator variable 0 ≤ xi ≤ 1 for each set Si in S. Minimize Subject to
Primal (covering) Dual (packing) Min. Max. subj. to When constraint matrix , objective function, and right-hand side are all ≥ 0, min. LP is a covering and the max. LP is a packing.
LP Relaxation For a minimization LP problem, ∞ 0 OPTf OPT primal integral solutions dual fractional solutions primal fractional solutions
Method I: Dual Fitting Combinatorial algorithm (greedy for set cover) Use LP relaxation and its dual Show: c(primal integral solution) ≤ c(dual), but dual is infeasible Divide dual by factor so that shrunk dual is feasible and is a lower bound on OPT. Factor is app. guarantee of algorithm. With dual fitting, can prove approximation guarantee of for greedy set cover (Chvatal 79).
Method II: Rounding Rounding Algorithm Solve the LP to get OPT solution, x* Include Sj in the integer solution I if Rounding is an f-app. (Hochbaum 82) Proof:
Method III: Primal-Dual • Yields combinatorial algorithms – no time spent solving LP problem. • Used to find efficient, exact algorithms for problems in P: • Matching • Network flow • Shortest path Property: LP relaxations have integral solutions
Method III: Primal-Dual Recall: optimal solutions to linear LPs satisfy complementary slackness conditions. Iterative method : Begin with initial solutions to primal and dual. Iteratively start satisfying complementary slackness conditions – modify the primal integrally. Once all conditions are met, the solutions must be optimal. What if optimal solution is not integral? Relax the conditions.
Duality Thm The primal program has finite optimum iff its dual has finite optimum. If the primal program has opt x* and the dual program has opt y*, then
Complementary Slackness Let x be a primal feasible solution and y a dual feasible solution. Then x and y are both optimal iff (primal condition) for and (dual condition) for
Relaxed Complementary Slackness Primal Condition Dual Condition If x and y are primal and dual feasible solutions satisfying above conditions, then
Relaxed Complementary Slackness Primal Condition Dual Condition Proof:
Method III: Primal-Dual Algorithm: Start with primal infeasible solution and dual feasible solution. Iteratively improve the feasibility of the primal solution and the optimality of the dual solution. End when all complementary slackness conditions are met with suitable α and β. The primal is always modified integrally, ensuring that final solution is integral. The approximation guarantee is αβ.
Method III: Primal-Dual Primal-Dual to obtain f-app of set cover: Let α=1, β=f. Complementary Slackness conditions: Primal: Increment primal integrally - pick only tight sets. Dual: 0/1 solution for x so cover each element having nonzero dual value at most f times.
Primal-Dual Set Cover Algorithm • Initialize: • Do until all elements are covered: • Pick an uncovered element, e, raise ye until some set is tight. • Pick all tight sets in the cover and update x. • Declare all the elements occurring in these sets as covered. • The approximation guarantee: αβ = f.
Min Makespan Scheduling • Given: • Set of jobs, J = {j1, j2, …, jn }. • Set of machines, M = {m1, m2, …, mm} • Processing time of job j on machine i, • Goal: Schedule jobs so as to minimize makespan, maximum processing time of any machine.
Min Makespan Scheduling • PTAS for • Identical processing time on all machines. • Uniform parallel machines • Focus on problems in which there is no relation between processing times of a job on different machines. • Can use parametric pruning in LP setting.
IP for Scheduling on Unrelated Parallel Machines Indicator variable xij {0,1} for each job j and each machine i. Minimize Subject to
LP Relaxation with Parametric Pruning Parameter T: guess a lower bound for makespan Pruning: eliminate assignments in which pij>T Minimize Subject to