1 / 71

Random Knapsack in Expected Polynomial Time

Random Knapsack in Expected Polynomial Time. 老師:呂學一老師. Team members. R91921028 陳姿樺 R92921084 何明彥 R92921083 余宗恩. Outline. Introduction ………………………… 姿樺 The uniform distribution ………… 姿樺 Long-tailed distributions Analysis …………………………………… 姿樺 Applications ……………………………… 明彥

mira-sparks
Télécharger la présentation

Random Knapsack in Expected Polynomial Time

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Random Knapsack in Expected Polynomial Time 老師:呂學一老師

  2. Team members • R91921028 陳姿樺 • R92921084 何明彥 • R92921083 余宗恩

  3. Outline • Introduction…………………………姿樺 • The uniform distribution…………姿樺 • Long-tailed distributions • Analysis……………………………………姿樺 • Applications………………………………明彥 • Lower bound…………………………明彥 • General distributions………………宗恩

  4. Introduction • Speaker : R91921028 陳姿樺

  5. Today • Random Knapsack in Expected Polynomial Time

  6. The problem • Input : • Given n items with positive weights w1, . . . ,wn • and profits p1, . . . , pn • and a knapsack capacity c, • Output : • find a subset S [n] :={1,2, . . . ,n} such that ∑iS wic and ∑iS pi is maximized.

  7. Domination concept • Two subset: • A subset S  [n] with weight w(S)=∑iSwi and profit p(S) = ∑iSpi • Another subset T  [n] with weight w(T)=∑iT wi and profit p(T) = ∑iTpi • We say S dominates T if w(S)  w(T) and p(S)  p(T).

  8. Assume • For simplicity assume that no two subsets have the same profit.

  9. Example • n=3 • S={1,3}; w(S)=3; p(S)=1.4 • T={1,2}; w(T)=5; p(T)=0.8 • S dominates T

  10. observation • No subset dominated by another subset can be an optimal solution to the knapsack problem, regardless of the specified knapsack capacity. • It suffices to consider those sets that are not dominated by any other set, the so-called dominating sets.

  11. observation • In the dominating sets, the solutions that cannot be improved in weight and profit simultaneously by other solutions. • Why? • By domination concept

  12. The Nemhauser/Ullmann algorithm • For i  [n], let S(i) be the sequence of dominating subsets over the items 1,...,i. • The sets in S(i) are assumed to be listed in increasing order of their weights.

  13. The Nemhauser/Ullmann algorithm • Given S(i), S(i+1) can be computed as follows: • duplicate all subsets in S(i) and then add item i+1 to each of the duplicated sets. • Removing the sets dominated by any other set. • The result is the ordered sequence S(i+1) of dominating sets over the items 1, . . . , i+1.

  14. Example • n=3

  15. Naïve algorithm • List total state and find dominating set • 21=0,1; • S(1)={0,1} • 22=0,1,2,12; • S(2)={0,1,12} • 23=0,1,2,3,12,13,23,123; • S(3)={0,3,13,123}

  16. Nemhauser/Ullmann algo. • S(1)={0,1} • Find S(2) • From {0,1,2,12} to find dominating set • S(2)={0,1,12} • Find S(3) • From {0,1,12,3,13,123} to find • S(3)={0,3,13,123} • The same as naïve algorithm

  17. Something • Let us assume that add and compare numbers in constant time. • Then the sequence S(i+1) can be calculated from the sequence S(i) in time linear. • The optimal knapsack filling is described by one of the subsets in the list S(n) • Generating S(n) basically solves the knapsack problem.

  18. Lemma • For every i[n], let q(i) denote an upper bound on the (expected) number of dominating sets over the items in 1,...,i, and assume q(i+1)  q(i). The Nemhauser/Ullmann algorithm computes an optimal knapsack filling in (expected) time

  19. By the lemma • We can only think the number of dominating sets, i.e., q(n) • Goal: counting E[q]

  20. THE UNIFORM DISTRIBUTION • Assumption: • Profits are assumed to be chosen uniformly at random from [0,1] and, • In all of our analyses, weights are chosen by an adversary.

  21. Definition • Let m=2n and let S1,...,Sm denote the sequence of all subsets of [n] listed in non-decreasing order of their weights. • Let the profit of subset Su be Pu=ΣiSu pi. • For any 2  u  m, define Δu=maxv[u]Pv - maxv[u-1] Pv 0.

  22. Observation • Observe that S1 is always a dominating set. • For all u  2, Su is dominating if and only if Δu > 0.

  23. Example • n=3 • Su

  24. Example • Δ2=P2 - P1 =0.9 • Δ3=P2 - P2 =0 • Δ4=P2 - P2 =0 • Δ5=P5 - P2 =0.5 • Δ6=P5 - P5 =0 • Δ7=P5 - P5 =0 • Δ8=P8 - P5 =0.3 • Dominating sets: S1, S2, S5, S8,

  25. Lemma • For every u  {2,...,m},

  26. Theorem • Suppose the weights are arbitrary positive numbers and profits are chosen according to the uniform distribution over [0,1]. Let q denote the number of dominating sets over all n items. Then E[q] = O(n3).

  27. Proof theorem • Pm=ΣiSmpi=Σi[n]pi and P1=ΣiS1pi=0 • E[Pm]=n/2 because each individual item has profit 1/2 on expectation. P1=0 By lemma

  28. Proof theorem • Consequently,

  29. Proof Lemma(1) • For every u  {2,...,m},

  30. Proof Lemma(2) • Find a easy way • The goal is change to

  31. Definition • For every v[u-1], define Xv=Su\Sv and Yv=Sv\Su. • Lv=∑iXvpi • Define two set • Clearly, AB

  32. Definition • For ε[0,1], we define • Obviously, B=B0 and, in general, Bε can be obtained by shrinking B in each dimension by a factor of 1-ε. • As the number of dimensions is n-k, it holds

  33. Help1 • Lv1/4n • Proof:

  34. Help1 • we assume pj  1/4n, for every j[k]. • Lv=∑iXvpi, Under our assumption, Lv 1/4n, for every v[u-1], • Why? • because each set Xv contains at least one element of size at least 1/4n .

  35. Help2 • Observe that Lv(1-1/4n )  Lv-1/16n2 because Lv1/4n. Thus setting ε=1/4n implies Bε A.

  36. Proof new Lemma By definition By help2

  37. Long-tailed vs. short-tailed • if the tail function of a distribution can be lower-bounded by the tail function of the exponential function, then we say the distribution has a “long tail”, and if the tail function can be upper-bounded by the exponential tail function, then we talk about “short tails”.

  38. Definition • Given any continuous probability distribution with density function f:R0→R0, the tail function T:R0→[0,1] is defined by T(t)=∫t∞f(x)dx. • We define the slope of T at xR0 to be the first derivative of the function -ln(T(·)) at x, i.e., slopeT(x)=-[ln(T(x))]’.

  39. Long-tailed definition • The tail of a continuous probability distribution is defined to be long if there exists α>0 such that slopeT(x) α, for every xR 0.

  40. Theorem • For i[n], let profit pi be a random variable with tail function Ti:R 0→[0,1]. Define µi = E[pi] and let αi be an appropriate positive real number satisfying slopeTi(x)αi for every x0, i[n]. Let α=maxi[n]αi and µ=maxi  [n]µi. Finally, let q denote the number of dominating sets over the elements in [n]. • Then

  41. Proof theorem • µi = E[pi], so E[Pm]=∑i[n]µi. • Help3: • Proof of theorem

  42. Help3 • Help3 can be proved by the former lemma

  43. Part II • Speaker : R92921084 何明彥

  44. Application(1/2) • by theorem: if profits are chosen according to the exponential distribution ,then

  45. Application(2/2) • The exponential and other long tailed distribution: • We can generalize the upper bound towards all continuous distributions with finite mean.

  46. Lower Bound

  47. Goal • a lower bound for the number of dominating set for continuous distributions with non-increasing density function.

  48. Theorem(1/4) • draw profitrandomly according to a continuous probability distribution with non-increasing density function: • then a vector of weight w1,…,wn • Therefore,

  49. Theorem(2/4) • : the weight for i-th item • : the profit • For every jn • : the dominating set for item 1,…j-1

More Related