Download presentation
Presentation is loading. Please wait.
Published byWillis Pierce Modified over 9 years ago
1
An FPTAS for #Knapsack and Related Counting Problems Parikshit Gopalan Adam Klivans Raghu Meka Daniel Štefankovi č Santosh Vempala Eric Vigoda
2
An FPTAS for #Knapsack and Related Counting Problems Parikshit Gopalan, Adam Klivans, Raghu Meka Daniel Štefankovi č, Santosh Vempala, Eric Vigoda
3
What can be counted? exactly? very little... (in polynomial-time) number of spanning trees (using determinant), Kirchoff’1847. perfect matchings in planar graphs (using Pfaffians), Kasteleyn’1960. (rest: usually #P-hard)
4
What can be counted? approximately? a little more... (in polynomial-time) perfect matchings in bipartite graphs (permanent of non-negative matrices), Jerrum, Sinclair, Vigoda’2001. Ferromagnetic Ising model, Jerrum, Sinclair’1989. Independent sets ( 5), Weitz’2004. k-colorings (k (11/6) ), Vigoda’1999..... (approximate counting random sampling, Jerrum, Valiant, Vazirani’1986)
5
Approximate counting (in polynomial-time) deterministic: INPUT OUT Q randomized: INPUT OUT Q P( ) 1-
6
not too many examples: independent sets in degree 5 graphs (Weitz’2004), matchings in bounded degree graphs (Bayati, Gamarnik, Katz, Nair, Tetali’2007), satisfying assignments of DNF formulas with terms of size C (Ajtai, Wigderson’1985) more examples; Monte Carlo, usually using a Markov chain (dependence 1/ 2 )
7
1) is randomness necessary ? Is P = BPP ? Primes P (Agarwal, Kayal, Saxena 2001) 2) dependence on ? Monte Carlo (1/ 2 )
8
Knapsack (optimization) INPUT: (w 1,v 1 ),...(w n,v n ), L OUTPUT: S [n] i S max v i i S w i L weights values (integers)
9
Dynamic program #1 (L is small) T[i,M] (optimal solution with items 1,...,i and limit M) T[i,M] = max { T[i-1,M] T[i-1,M-w i ] + v i
10
Dynamic program #2 (v i ’s are small) T[i,V] (smallest weight of a subset of 1,...,i, with value V) T[i,V] = min { T[i-1,V] T[i-1,V-v i ] + w i approximation algorithm
11
Counting knapsack INPUT: w 1,...,w n, L OUTPUT: S [n] i S w i L How many with #P-hard are there?
12
Counting knapsack Dyer, Frieze, Kannan, Kapoor, Perkovic, Vazirani’1993 exp(O * (n 1/2 )) / 2 randomized approximation algorithm Morris, Sinclair’1999 O( n c / 2 ) randomized approximation algorithm (MCMC, canonical paths) Dyer’2003 O(n 2.5 + n 2 / 2 ) randomized approximation algorithm (dynamic programming) OURS: O * (n 3 / )
13
Dyer’2003: T[i,M] (number of solutions with items 1,...,i and limit M) T[i,M] = T[i-1,M] + T[i-1,M-w i ] + rejection sampling approximate counter
14
+ rejection sampling approximate counter w i ’ = n 2 w i L w i ’’ = w i ’ rounding: L’ = n 2 1) get more solutions, ’’ ’ 2) not too many more, | ’’| (n+1)| ’| S’’ ’’ - ’, X heaviest in S’’, then S’’ - {X} ’ Proof:
15
Our dynamic program (i,A) = smallest M such that knapsack with w 1,...,w i,M has A solutions (i,A) = min max [0,1] { (i-1, A) (i-1,(1- A)+w i deterministic approximation algorithm
16
Q = 1+ /(n+1) s = n log Q 2 T(i,j)= min max [0,1] { T(i-1, j+ln Q ) T(i-1, j+ln Q (1- )+w i T[0..n,0..s] Lemma 1: (i,Q j-i ) T[i,j] (i,Q j )
17
T(i,j)= min max [0,1] { T(i-1, j+ln Q ) T(i-1, j+ln Q (1- )+w i Lemma 2: can compute recursion efficiently Q -j,....,Q 0, 1-Q 0,...., 1-Q j only few values of matter can use binary search TOTAL RUN TIME = O( log(n/ )) n3n3
18
How to deal with more constraints ? S [n] i S w j,i L j How many with are there? j {1,...,k} O( (n/ ) O(k 2 ) log W) algorithm (e.g., contingency tables, multi-dimensional knapsack,...) multi-dimensional knapsack:
19
Read once branching programs n layers Layered directed graph vertices per layer Edges between consecutive layers Edges labeled Input: Output: Label of final vertex reached Counting the number of accepting paths ? dynamic programming, time = O(nS)
20
n layers ROBP for knapsack Problem: width too large Solution: reduce width by approximating
21
Monotone ROBPs ordering: given u,v, is u v ? midpoint: given u,v, get w s.t. |{x;u x w}| = |{x;w x v}| 1 transitions: given u, get the outneighbors of u u v A(u) A(v) monotone: given implicitly accepting paths from u u v
22
group the vertices in the layers according to the rough number of accepting paths processing right-left already “shrunk”
23
can be generalized to distributions given by small space sources. n layers p1p1 1-p 1 small space sources = ROBP + probability distributions on outgoing edges More constraints?
24
n layers can be combined to get (S 2,n)-ROBP for intersection additive approximation preserved
25
1) uniform distribution given by ’’ can be given by small space source 2) additive approximation multiplicative approximation
27
Other problems: contingency tables with constant number of rows What other problems are solvable using the technique? Thanks!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.