Fast Additive Constant Approximation Algorithms for Safe Deposit Boxes problem in 2D and 3D. Boaz Ben-Moshe Yefim Dinitz 2/23/2019.

Slides:



Advertisements
Similar presentations
Iterative Rounding and Iterative Relaxation
Advertisements

Incremental Linear Programming Linear programming involves finding a solution to the constraints, one that maximizes the given linear function of variables.
C&O 355 Lecture 23 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
Approximation Algorithms Chapter 14: Rounding Applied to Set Cover.
Introduction to Algorithms
Seminar In Game Theory Algorithms, TAU, Agenda  Introduction  Computational Complexity  Incentive Compatible Mechanism  LP Relaxation & Walrasian.
Outline. Theorem For the two processor network, Bit C(Leader) = Bit C(MaxF) = 2[log 2 ((M + 2)/3.5)] and Bit C t (Leader) = Bit C t (MaxF) = 2[log 2 ((M.
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Instructor Neelima Gupta Table of Contents Lp –rounding Dual Fitting LP-Duality.
Totally Unimodular Matrices Lecture 11: Feb 23 Simplex Algorithm Elliposid Algorithm.
Approximation Algorithms
Job Scheduling Lecture 19: March 19. Job Scheduling: Unrelated Multiple Machines There are n jobs, each job has: a processing time p(i,j) (the time to.
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy under contract.
Distributed Combinatorial Optimization
1 Introduction to Approximation Algorithms Lecture 15: Mar 5.
Approximation schemes Bin packing problem. Bin Packing problem Given n items with sizes a 1,…,a n  (0,1]. Find a packing in unit-sized bins that minimizes.
Design Techniques for Approximation Algorithms and Approximation Classes.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
UNC Chapel Hill M. C. Lin Linear Programming Reading: Chapter 4 of the Textbook Driving Applications –Casting/Metal Molding –Collision Detection Randomized.
Linear Programming Data Structures and Algorithms A.G. Malamos References: Algorithms, 2006, S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani Introduction.
Linear Program Set Cover. Given a universe U of n elements, a collection of subsets of U, S = {S 1,…, S k }, and a cost function c: S → Q +. Find a minimum.
Approximation Algorithms Department of Mathematics and Computer Science Drexel University.
Lecture.6. Table of Contents Lp –rounding Dual Fitting LP-Duality.
The bin packing problem. For n objects with sizes s 1, …, s n where 0 < s i ≤1, find the smallest number of bins with capacity one, such that n objects.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
TU/e Algorithms (2IL15) – Lecture 12 1 Linear Programming.
Common Intersection of Half-Planes in R 2 2 PROBLEM (Common Intersection of half- planes in R 2 ) Given n half-planes H 1, H 2,..., H n in R 2 compute.
Approximation Algorithms based on linear programming.
INTRO2CS Tirgul 8 1. Searching and Sorting  Tips for debugging  Binary search  Sorting algorithms:  Bogo sort  Bubble sort  Quick sort and maybe.
Computational Geometry
Approximation algorithms
Discrete Optimization
The Theory of NP-Completeness
Linear Programming Many problems take the form of maximizing or minimizing an objective, given limited resources and competing constraints. specify the.
8.3.2 Constant Distance Approximations
Lap Chi Lau we will only use slides 4 to 19
The Duality Theorem Primal P: Maximize
Chap 10. Sensitivity Analysis
New Characterizations in Turnstile Streams with Applications
Topics in Algorithms Lap Chi Lau.
Solver & Optimization Problems
Approximation algorithms
11.4 The Comparison Tests In this section, we will learn:
Chapter 5. Optimal Matchings
CSCE 411 Design and Analysis of Algorithms
Computability and Complexity
Linear Programming.
Discrete Mathematics for Computer Science
Chapter 6. Large Scale Optimization
Multi-Way Search Trees
Analysis of Algorithms
Integer Programming (정수계획법)
Chapter 6. Large Scale Optimization
PTAS for Bin-Packing.
Advanced Algorithms Analysis and Design
2. Generating All Valid Inequalities
Polynomial time approximation scheme
Chapter 11 Limitations of Algorithm Power
CMPS 3130/6130 Computational Geometry Spring 2017
Branch and Bound Searching Strategies
Integer Programming (정수계획법)
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
The Theory of NP-Completeness
The Greedy Approach Young CS 530 Adv. Algo. Greedy.
Chapter 1. Formulations.
Integer LP: Algorithms
Chapter 6. Large Scale Optimization
Chapter 2. Simplex method
Complexity Theory: Foundations
Presentation transcript:

Fast Additive Constant Approximation Algorithms for Safe Deposit Boxes problem in 2D and 3D. Boaz Ben-Moshe Yefim Dinitz 2/23/2019

Safe Deposit Boxes problem Given: a set S of n safe boxes, where the i-th box contains ai Dollars, bi Francs, etc. and numbers (restrictions - constrains): A, B, etc. We wish to find the minimal subset of S, such that the total Dollar value is at least A, Franc value at least B, etc. A variant of the knapsack problem, with a fixed cost (of 1) of taking any item. 2/23/2019

Banknotes (one currency) There are banknotes, seen on the table. We would like to take the smallest amount of banknotes, which sums up to at least A. A = 200 2/23/2019

Banknotes (one currency) Solution: take the biggest (till A). A = 200 Opt = 3 2/23/2019

Two currencies: Motivation Shortest link path: Given a set (V) of 2D vectors, find the smallest subset of V, that performs a path from “start” into the half open rectangle “end”. What may be a strategy? 2/23/2019

Two currencies: Motivation Killing processes problems: Given a set S of processes find the smallest subset of S, such that: Killing these processes, by OS, will free at least A cpu and B space. 2/23/2019

The state and results Safe Deposit Box problem (SDB) is NP-hard, beginning from the case of two currencies [DK]. There is a polynomial approximation solution with a constant additive error [DK]. Our new algorithms lead to significant improvements of running time. 2/23/2019

Theorem [DK] Consider m currencies instance of SDB. Let (a : b ...) be the exchange rate for each currency. The value of the i-th box, w.r.t this rate, is aai + bbi + … (in, say, CAD). For any non-degenerate instance of SDB, there exist a certain exchange rate such that the opt+(m-1) most valuable boxes forms a feasible solution. 2/23/2019

Algorithmic proof (sketch) SDB is an ILP problem. Relax it to LP, i.e. let the variables xi be fractional, between 0 and 1. Consider an optimal vertex of the feasible polyhedron. The value is a lower bound for ILP. At most m variables are fractional. Round them up. The resulting solution is feasible and integer, and the error is at most m-1. The optimum of the dual LP problem is the exchange rate as in Theorem. 2/23/2019

Running time For any (constant) m, the running time of the algorithm of [DK] is O(nm+1). The algorithm is of the type primal-dual. There is a specific algorithm of [DK] for the case m=2; it runs in O(n2). Our result for m=2: O(n2)  O(n log2 n). Our result for m=3: O(n4)  O(n2 log2 n). 2/23/2019

Our tools (shown for m=2) Let us normalize any rate to the form (1:b) Given an exchange rate (1:b) we can sort the boxes according to there values. Let #A(b) be the number of best boxes (according to the b-order) needed to reach A. Similarly for #B(b). Obviously, max{#A,#B} is an upper bound, for the optimum (it is a feasible solution). Main Lemma: For any rate (1:b), min{#A,#B} is a lower bound. 2/23/2019

Lower bound proof Obviously, the total (1:b) value of any feasible solution is at least A+bB. Note that min{#A,#B}-1 most valuable boxes, w.r.t. (1:b), do not reach this total value bound A+bB. So, no min{#A,#B}-1 other boxes do; that is, they cannot form a feasible solution, as required. 2/23/2019

Monotonicity of #A and #B Let us sweep b from 0 to ∞, and trace changes in the box order. When two box values become equal, value(i)=value(j), so that before that, box i was better, and after that, box j is better, then holds ai>aj and bi<bj. Assume General Position (for now). 2/23/2019

Geometric representation: A straight line for each box: value(i) = ai+ bbi. When box j becomes better than box i (a swap point): ai>aj & bi<bj. 2/23/2019

2D Binary Search Observation: #A and #B are monotone. Consider the equilibrium point, where a single swap turns #A=<#B into #A>=#B. There, the lower and upper bounds for opt differ by at most one! Thus we obtain an (opt+1) solution. 2/23/2019

Single swap – equilibrium point For given b, assume #A<#B, (before swap). After swap: #B<=#A 2/23/2019

Algorithm of [DK]: There are n*(n-1)/2 different orders (between b swap points). Compute all b values. Sweep all the b values from left to right. O(n^2 log(n)), algorithm. With some more CG mechanism: O(n^2). 2/23/2019

If only we could… Avoid computing all O(n2) b values. Use the convex (monotone) property to find the equilibrium point. Perform binary search over b values (sorted by the x coordinate). Introducing Slope Selection! 2/23/2019

Slope selection Parametric search: known (CG) technique: [Megiddo 83], [Cole 89], [Katz & Sharir 93]. Given a set of n straight lines, the k’th intersection (sorted by x), can be found in O(n*log(n)) run time. We use this algorithm as a “black box”. 2/23/2019

2D algorithm (improved) 1. Compute the next pivot: b‘ (using Slope Selection). 2. Compute #A, #B according to b’. 3. If #A - #B >1 goto 1 - search up 4. If #A - #B < -1 goto 1 - search down 5. else done. 2/23/2019

Results (general position) Running time: Finding the next b: O(n*log(n)). Computing #A, #B for given b: O(n*log(n)). Binary search steps: O(log(n)). Total time: O(n*log^2(n)). 2/23/2019

Degenerate case Breaking “symmetric” inputs. What if 3 boxes (lines) intersect at the same point? Reduction to a combinatorial problem. 2/23/2019

Reduction: 2/23/2019

Solving the reduced problem: All boxes have the same value. Sorted by increasing A (decreasing B) Move a sliding window of size min(#A’, #B’), step by step. Till an equilibrium point is found. 2/23/2019

The 2D NP hardness Suggestions ?? Tricky reduction. 2/23/2019

The 2D NP hardness Reduction to perfect sum: given a set (S) on numbers and a value T is there a subset of S which sums up to A. Spit to n (|S|) different problems: 1<k<n  k’th instance: Dollars: values: S, constraint: A. Francs: values: {smax-si}, constraint: B = k*smax–A. 2/23/2019

The 2D NP hardness If exist a k for which: the safe box optimal* solution is of size k  there is a perfect sum for A (the set of Dollars). If there is a perfect sum for A. Otherwise, the Observe that any safe box optimal* solution must contains at least k boxes (k>=(A+B)/smax) Therefore the safe box optimal* solution will find it … 2/23/2019

The 3D case - overview Each box is a 3D plane. Two exchange rates(b,g). O(n^3) different orders. Main lemma holds. Goal: to find the equilibrium point for which: min(#A,#B,#C)+2 <= max(#A,#B,#C) 2/23/2019

The 3D case - overview 3D algorithm overview: Two level Binary Search, over (b, g). Compute g (BS). Find the matching equilibrium b (2D). If not the g equilibrium point, goto 1. 2/23/2019

Three currencies case Generalization to 3D is not that obvious: For each fixed g, we balance not A and B currencies, but A+gC (an artificial currency) and B - in order to maintain monotonicity. The critical lines in the (b : g) plane are the projections of the intersection lines of n planes ai+bbi+gci. searching for the equilibrium value of g. Binary search over O(n^4) g values. 2/23/2019

Three currencies case (continued) Generalization to 3D is not that obvious: Eventually, we find two neighboring values of g, where #A and #C flips (from the late to early satisfaction). However, this is not all, yet, since the A+gC constraint is only a tool . Hence, a certain fine tuning is needed, between the above two values of g. 2/23/2019

Running time, for three currencies Since there are n2 straight lines, a request to the Slope Selection method costs O(n2 log n). Processing of each line (g is fixed) finding the 2D equilibrium costs O(n log^2 n). Thus, the total time is O(n2 log2 n). 2/23/2019

Degenerate case, for m=3 2/23/2019

Degenerate case, for m=3 A nice combinatorial problem arises, at the g-equilibrium: All values ai+bbi+gci=V (a constant); k=(A+B+C)/V is a lower bound; We look for a feasible set of k+2 boxes. Observation: for any k boxes at least one restriction must be satisfied. 2/23/2019

A combinatorial way for finding a solution of at most k+2 boxes Compute all two constrained solutions: P'AB, P'AC, P'BC Compute TAB , TBC We step swaps from TAB to Tbc maintaining k+1<=#B<=k+2. Hence, either A, or C must be satisfied, at any step. At the equilibrium, #A,#C<=k+1, #B<=k+2. 2/23/2019

Possible directions of research Parametric search ??: for the specific problem  find b (and not k): Open the black box: Reducing the runtime to O(n log(n)). Lower bound 2D: W(n) , W(n log(n)) ?? Lower bound 3D: ? 3sum hard? 2/23/2019

Possible directions of research Simply generalization of the 3D method – leads to inefficient runtime (too many exchange rates) KD: LP approach: could the algorithm ne reduces to O(nm log…) ? 2/23/2019

FIN benmoshe@cs.bgu.ac.il www.cs.bgu.ac.il/~benmoshe/PHD/safeBox 2/23/2019