An FPTAS for #Knapsack and Related Counting Problems Parikshit Gopalan Adam Klivans Raghu Meka...
-
Upload
willis-pierce -
Category
Documents
-
view
218 -
download
2
Transcript of An FPTAS for #Knapsack and Related Counting Problems Parikshit Gopalan Adam Klivans Raghu Meka...
An FPTAS for #Knapsack and Related Counting Problems
Parikshit GopalanAdam KlivansRaghu Meka
Daniel ŠtefankovičSantosh Vempala
Eric Vigoda
An FPTAS for #Knapsack and Related Counting Problems
Parikshit Gopalan, Adam Klivans, Raghu MekaDaniel Štefankovič, Santosh Vempala, Eric Vigoda
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)
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)
Approximate counting(in polynomial-time)
deterministic:
INPUT OUT
OUT Q
randomized:INPUT
OUT
OUT Q
P( )1-
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 ofsize C (Ajtai, Wigderson’1985)
more examples; Monte Carlo, usuallyusing a Markov chain (dependence 1/2)
1) is randomness necessary ?
Is P = BPP ?
Primes P (Agarwal, Kayal, Saxena 2001)
2) dependence on ?
Monte Carlo (1/2)
Knapsack (optimization)INPUT: (w1,v1),...(wn,vn), L
OUTPUT: S [n]
i Smax vi
i S wi L
weights
values
(integers)
Dynamic program #1(L is small)
T[i,M](optimal solution withitems 1,...,i and limit M)
T[i,M] = max {T[i-1,M]
T[i-1,M-wi] + vi
Dynamic program #2(vi’s are small)
T[i,V](smallest weight ofa subset of 1,...,i,with value V)
T[i,V] = min{T[i-1,V]
T[i-1,V-vi] + wi
approximation algorithm
Counting knapsackINPUT: w1,...,wn, L
OUTPUT: S [n]
i S wi L
How many
with
#P-hard
are there?
Counting knapsackDyer, Frieze, Kannan, Kapoor, Perkovic, Vazirani’1993 exp(O*(n1/2)) / 2
randomized approximation algorithm
Morris, Sinclair’1999 O( nc / 2 )
randomized approximation algorithm (MCMC, canonical paths)
Dyer’2003 O(n2.5 + n2/2)
randomized approximation algorithm (dynamic programming)
OURS: O*(n3/)
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-wi]
+ rejection sampling approximate counter
+ rejection sampling
approximate counter
wi’ =n2 wi
L
wi’’ = wi’ rounding:
L’ = n2
1) get more solutions, ’’ ’2) not too many more, |’’| (n+1)|’|
S’’ ’’ - ’, X heaviest in S’’, then S’’ - {X}’ Proof:
Our dynamic program
(i,A) = smallest M such that knapsackwith w1,...,wi,M has A solutions
(i,A) = min max[0,1]
{(i-1, A)
(i-1,(1- A)+wi
deterministic approximation algorithm
Q = 1+ /(n+1)s = n logQ 2
T(i,j)=min max[0,1]
{T(i-1,j+lnQ )
T(i-1,j+lnQ(1-)+wi
T[0..n,0..s]
Lemma 1: (i,Qj-i) T[i,j] (i,Qj)
T(i,j)=min max[0,1]
{T(i-1,j+lnQ )
T(i-1,j+lnQ(1-)+wi
Lemma 2: can compute recursion efficiently
Q-j,....,Q0, 1-Q0, .... , 1-Qj
only few values of matter
can use binary search
TOTAL RUN TIME = O( log(n/))n3
How to deal with more constraints ?
S [n]
i S wj,i Lj
How many with
are there?
j{1,...,k}
O( (n/)O(k2) log W) algorithm
(e.g., contingency tables,multi-dimensional knapsack, ...)
multi-dimensional knapsack:
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)
n layers
ROBP for knapsack
Problem: width too large
Solution: reduce width by approximating
Monotone ROBPs
• ordering: given u,v, is u v ?
• midpoint: given u,v, get w s.t. |{x;uxw}| = |{x;wxv}| 1
• transitions: given u, get the outneighbors of u
u v A(u) A(v)monotone:
given implicitly
accepting paths from u
u
v
group the vertices in the layers according to the rough number of accepting paths processing right-left
already “shrunk”
can be generalized to distributions given by small space sources.
n layers
p1
1-p1
small space sources = ROBP + probability distributions on outgoing edges
More constraints?
More constraints?
n layers
n layers
can be combined to get (S2,n)-ROBP forintersection
additive approximation preserved
1) uniform distribution given by ’’ can be given by small space source
2) additive approximation multiplicative approximation
Other problems:
contingency tableswith constant number of rows
What other problems are solvable using the technique?
Thanks!