380 likes | 509 Views
Efficient Solutions for 2-Variables-per-Constraint Integer Programming Problems. Reuven Bar-Yehuda & Dror Rawitz 1999. Heirarchy of Relevant Problem Types. Vertex Cover (VC). 2-Satisfiability (2SAT). Minimum Weight 2SAT. 2-Variable-per-constraint Integer Programming (2VIP). Vertex Cover.
E N D
Efficient Solutions for 2-Variables-per-Constraint Integer Programming Problems Reuven Bar-Yehuda & Dror Rawitz 1999 Efficient Solution for 2VIP Problems
Heirarchy of Relevant Problem Types Vertex Cover (VC) 2-Satisfiability (2SAT) Minimum Weight 2SAT 2-Variable-per-constraint Integer Programming (2VIP) Efficient Solution for 2VIP Problems
Vertex Cover Input: An undirected graph G(V,E) Solution: A subset S V which includes a vertex in each arc in E “What about optimality?” Just wait… Efficient Solution for 2VIP Problems
2-Satisfiability Input: A boolean formula in 2-CNF form, with m constraints and n variables Solution: A vector of n values for the n variables, so that they satisfy all constraints (FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) Efficient Solution for 2VIP Problems
Vertex Cover as a Type of 2SAT Vertices Boolean Variables xi, xj, xk i k j Selected Vertices Variables Assigned TRUE xi = TRUE i Edges Simple OR constraints i j Efficient Solution for 2VIP Problems
Feasibility Algorithm for 2SAT • SAT (the general satisfiability problem) is NP-Complete. • 3SAT (satisfiability of 3-CNF formulae) is NP-Complete. … But 2SAT is in P. This difference is the basis for our entire approach to the approximation of 2VIP Efficient Solution for 2VIP Problems
Feasibility Algorithm for 2SAT (continued) 2SAT-FEASIBILITY(F) If all the variables are set, return SUCCESS Select an unset variable xk F1 F with the implications of xk=FALSE propagated F2 F with the implications of xk=TRUE propagated If both F1 & F2 cannot be satistfied return FAILURE F3 the first of F1,F2 for which the propagation is completed without its being determined as a FALSE formula return 2SAT-FEASIBILITY(F3) … 99% Pure Greed! Efficient Solution for 2VIP Problems
Feasibility Algorithm for 2SAT (correctness) Why does this work? Observe an assignment effect propagation: x1 = FALSE x2 = TRUE Efficient Solution for 2VIP Problems
Feasibility Algorithm for 2SAT (correctness) After the propagation is complete, we have: one side of OR set FALSE, other side set TRUE no changes to either side one side of OR set TRUE, other side unchanged satisfied constraints unaffected constraints Efficient Solution for 2VIP Problems
Feasibility Algorithm for 2SAT (correctness) But… every x1=TRUE feasible solution must also satisfy these constraints! satisfied constraints Unaffected Constraints So… combine the values set here with the values for this part ‘borrowed’ from an x1=TRUE feasible solution to create an x1=FALSE feasible solution. Efficient Solution for 2VIP Problems
Feasibility Algorithm for 2SAT (complexity) Time Complexity - seemingly: O(n) recursive calls O(m) constraits checked in the propagation process = O(mn) time But, actually: • Each variable is set at most once • Each constraint is checked at most twice • Running the propagations in parallel binds the amount of ‘wasted’ time to the amount of time used to propagate adopted assignments. Hence O(2·(m+n))= O(m+n) time in total. Efficient Solution for 2VIP Problems
2SAT as an extension of Vertex Cover In Vertex Cover, we only have constraints of a single type: Edges Simple OR constraints i j But there are 2 more types of constraints in 2SAT: ??? OR constraints with 1 NOT ?? i j ??? OR constraints with 2 NOTs ?? i j Efficient Solution for 2VIP Problems
Extending 2SAT: Minimum Weight (MIN-2SAT) Given a weight vector w, find a vector x which minimizes , subject to: 2SAT: generalization 2SAT: generalization 2SAT: generalization Efficient Solution for 2VIP Problems
Extending MIN-2SAT: Any Integer Value (2VIP) Given a weight vector w, find a vector x which minimizes , subject to: 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 Efficient Solution for 2VIP Problems
Feasible Polyhedron Convexity The polyhedron bounding the feasible solutions of an IP problem is convex. Specifically, if the points (a,b),(c,d),(e,f),(g,h),(i,j) satisfy a constraint involving variables i and j … (e,f) (a,b) (g,h) (i,j) (c,d) …so do all the points on the line and within the triangle. Efficient Solution for 2VIP Problems
Extending the 2SAT Feasibility Algorithm: Partitioning the Solution Space 2SAT: unset variable xi xi = FALSE xi = TRUE 2VIP: , Efficient Solution for 2VIP Problems
Extending the 2SAT Feasibility Algorithm: Propagating Bound Effects (This illustration courtesy of Dror Rawitz ) Efficient Solution for 2VIP Problems
Result: Feasibility Algorithm for 2VIP 2VIP-FEASIBILITY(P) If l = u then If l is a feasible solution, return SOLUBALE The solution is infeasible; return INSOLUBLE Select a variable xk for which lkuk P1 P with the implications of propagated P2 P with the implications of propagated If both P1 & P2 are directly unsatisfiable return INSOLUBLE P3 the first of P1,P2 for which the propagation is completed without its being determined as directly unsatisfiable return 2VIP-FEASIBILITY(P3) Efficient Solution for 2VIP Problems
Feasibility Algorithm for 2VIP (correctness) Q: Can choosing one ‘half’ of the solution space over the other ‘half’ rule out feasible solutions? A: Of course. Q: Can choosing one ‘half’ of the solution space over the other ‘half’ rule out ALL feasible solutions? A: No! We can still ‘borrow’ parts of any feasible solution – y – for the discarded ‘half’, creating a feasible solution – y’ – for the selected ‘half’: … Efficient Solution for 2VIP Problems
Feasibility Algorithm for 2VIP (correctness) 9 8 7 6 5 4 3 2 1 0 k y – solution for bounds for y’ – solution for Efficient Solution for 2VIP Problems
Feasibility Algorithm for 2VIP (correctness) Why is y’ a valid solution? Examine any one of the m constraint (say, constraint k), involving variables i and j. One of the following holds: • Both y’ variables are equal to the y variables. • One of the y’ variables differs from its y counterpart. • Both y’ variables differ from their y counterparts. We will see how in all 3 cases, (y’i,y’j) satisfy the constraint. Efficient Solution for 2VIP Problems
Feasibility Algorithm for 2VIP (correctness) Case 1: (yi ,yj) = (y’I ,y’j) lower bound for y’i lower bound for y’j no changes to the y variables; since the y vector is a feasible solution, constraint k is satisfied by (y’i,y’j) . Efficient Solution for 2VIP Problems
we are demonstrating correctness for Feasibility Algorithm for 2VIP (correctness) Case 2: (yi ,vj) lower bound for y’i (yi ,lj) lower bound for y’j (yi ,yj) since yi is within the bounds for variable i, there must exist a value vi such that (yi,vj) satisfy the constraint; we can now use the convexity to draw the line between (y’i,y’j) and (yi,vj) within the feasible polygon… the line crosses (yi,lj)=(y’i,y’j) . Efficient Solution for 2VIP Problems
we are demonstrating correctness for Feasibility Algorithm for 2VIP (correctness) Case 3: (li ,vj) lower bound for y’i (vi ,lj) (li ,lj) lower bound for y’j (yI ,yj) we again use the definition of the lower and uppoer bounds: there exist vi and vj so that (li,vj) and (vi,lj) satisfy the constraint. Together with (yi,yj) , these points form a feasible triangle within which we find (li, lj)= (y’i, y’j) . Efficient Solution for 2VIP Problems
Feasibility Algorithm for 2VIP (complexity) (Remembering 2SAT…) • Each lower/upper bound is set at most U times • for every lower/upped bound update, at most m constraints are checked. • Running the constraint propagations in parallel binds the amount of ‘wasted’ time to the amount of time used to propagate adopted lower/upper bound changes. Hence O(mU) time in total. Efficient Solution for 2VIP Problems
Extending 2VIP Yet Again… Q: How can we ensure we aren’t discarding all ‘good’ solutions by searching only one part of the solution space? A: We must extend the problem again, slightly, so that we can ‘cut our losses’ when betting on one part of the solution space. (E2VIP) Instead of minimizing , we minimize the expression for some , satisfying . … Efficient Solution for 2VIP Problems
Decomposition of ‘Weights’ The W function is, in essence, the weight of the part of a vector x which intersects with the (non-integral) range (i.e. the weight of the part x of between and ). Now we can use a partitioning of the solution space with some vector to achieve a sort-of-a-decomposition of weights, without changing the actual weight vector w: Efficient Solution for 2VIP Problems
Applying the Local Ratio Principle We can now apply the Local Ratio theorem: If, for given we can find an so that every feasible solution, in both parts of the solution space (i.e. in the solution space with the effects of either or propagated) is an r-approximation w.r.t. then every feasible solution that is an r-approximation w.r.t. is also an r-approximation w.r.t. . We are left with the task of finding a useful decomposition of , i.e. a useful vector. Efficient Solution for 2VIP Problems
Choosing a Useful ‘Weight’ Decomposition What effects the Choice of ? We have partitioned the solution space, and will only be searching (for example) in the bounds effected by setting (let’s call these bounds ). any feasible solution in would be a 1-approximation with respect to , but… Intuitive choice: Efficient Solution for 2VIP Problems
Choosing a Useful ‘Weight’ Decomposition Problem: although we are sure there are feasible solutions in – the only thing we know about their optimality is that the cost of in is lower than that of (that’s why we would choose over ). Conclusion: the selection of must take into account the possibility that the optimal solution is in the discarded part of the solution space: . We must make every solution in ‘pay’ enough in so that it would still be worthwhile to only search for solutions in . Efficient Solution for 2VIP Problems
Choosing a Useful ‘Weight’ Decomposition Solution: Start with . Now increase the values of in variables for which … until ‘pays’ in as much as ‘pays’ in : Efficient Solution for 2VIP Problems
Choosing a Useful ‘Weight’ Decomposition Remember Dr. Bar-Yehuda’s ‘pay 2 dollars for 1’ rule-of-thumb! What have we achieved? Loss: We have added as much as to , which means the minimum feasible solution in is 2 times more expensive then (which is cheaper-or-equal to any feasible solution in ). Gain: Every solution in now ‘pays’ in the range at least , so it can’t be more than 2 times cheaper, w.r.t , than the feasible solution we shall find in . Thus any feasible solution in is a 2-approximation of the optimum solution w.r.t the range . Efficient Solution for 2VIP Problems
The Approximation Algorithm for 2VIP E2VIP-APPROX If then l ; If then l If l =u then: if l is a feasible solution, return l if l isn’t a feasible solution, return FAILURE Select a variable xk for which lkuk lleft,uleftl,u with the implications of propagated lright,urightl,u with the implications of propagated If both lleft,uleft and lright,uright are directly unsatisfiable return FAILURE … Efficient Solution for 2VIP Problems
The Approximation Algorithm for 2VIP … If lleft,uleft is directly unsatisfible, return E2VIP-APPROX If lright,uright is directly unsatisfible, return E2VIP-APPROX If then better left , worse right else better right , worse left Find so that and If < lbest then lbest Return E2VIP-APPROX Note that calling E2VIP-APPROX(l,u,l,u) means approximating our original 2VIP problem. Efficient Solution for 2VIP Problems
Approximation Algorithm for 2VIP (correctness) At every level of recursion, we ‘cut out’ a piece of the solution space, and with it – a part of the cost of the solution. Since we ensure that any feasible solution in the reduced range (i.e. ) is a 2-approximation in the cut-out range (i.e. ), we end up ‘cutting out’ the entire solution space, so that we are left with a single, trivial, feasible solution for lfinal=ufinal , and to it we add back the entire solution space in the form of the ‘cut-outs’, while maintaining the 2-effectiveness. Thus we end up with a solution which is a 2-approximation for the original problem. Efficient Solution for 2VIP Problems
Approximation Algorithm for 2VIP (complexity) • Unlike 2VIP-Feasibility, we can waste a lot of time propagating bound change effects in the discarded part of the solution space. Thus every single execution of the algorithm (not including the recursive call) takes O(mU) time. • If we choose the xk’s in successive order (from x1 to xn repeatedly), we will have a series of ‘runs’ over all n variables, with each i’th run cutting the range (lk,uk) by half and taking O(nmU/2i) time. • The number of runs is bounded by log(U). Hence = O(nmU) time in total. Efficient Solution for 2VIP Problems
Generalizations • We did not make use of the linearity of the constraints; we only used the covexity of the feasible polyhedron. We can therefore generalize the problem to any ‘axis-convex’ constraints. • We did not make use of the linearity of the cost function. We can generalize the problem to (more or less) any non-negative monotone weight function. Efficient Solution for 2VIP Problems
The End. Efficient Solution for 2VIP Problems