Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Random Knapsack in Expected Polynomial Time 老師:呂學一老師."— 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 w 1,...,w n –and profits p 1,..., p n –and a knapsack capacity c, Output : –find a subset S  [n] :={1,2,...,n} such that ∑ i S w i  c and ∑ i S p i is maximized.

7

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

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

10 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 123 Profit0.50.30.9 weight231

11 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.

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

13 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.

14 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.

15 Example n=3 123 Profit0.50.30.9 weight231

16 Naïve algorithm List total state and find dominating set 2 1 =0,1; –S(1)={0,1} 2 2 =0,1,2,12; –S(2)={0,1,12} 2 3 =0,1,2,3,12,13,23,123; –S(3)={0,3,13,123} 0121231323123 p00.50.30.80.91.41.21.7 w02351346

17 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 0121231323123 p00.50.30.80.91.41.21.7 w02351346

18 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.

19 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

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

21 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.

22 Definition Let m=2 n and let S 1,...,S m denote the sequence of all subsets of [n] listed in non-decreasing order of their weights. Let the profit of subset S u be P u =Σ iS u p i. For any 2  u  m, define Δ u =max v[u] P v - max v[u-1] P v  0.

23 Observation Observe that S 1 is always a dominating set. For all u  2, S u is dominating if and only if Δ u > 0.

24 Example n=3 S u 123 Profit0.50.30.9 weight231 SuSu S1S1 S2S2 S3S3 S4S4 S5S5 S6S6 S7S7 S8S8 0312132312123 PuPu 00.90.50.31.41.20.81.7 wuwu 01233456

25 Example Δ 2 =P 2 - P 1 =0.9 Δ 3 =P 2 - P 2 =0 Δ 4 =P 2 - P 2 =0 Δ 5 =P 5 - P 2 =0.5 Δ 6 =P 5 - P 5 =0 Δ 7 =P 5 - P 5 =0 Δ 8 =P 8 - P 5 =0.3 Dominating sets: S 1, S 2, S 5, S 8, SuSu S1S1 S2S2 S3S3 S4S4 S5S5 S6S6 S7S7 S8S8 0312132312123 PuPu 00.90.50.31.41.20.81.7 wuwu 01233456

26 Lemma For every u  {2,...,m},

27 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(n 3 ).

28 Proof theorem P m =Σ iS m p i =Σ i[n] p i and P 1 =Σ iS 1 p i =0 E[P m ]=n/2 because each individual item has profit 1/2 on expectation. P 1 =0 By lemma

29 Proof theorem Consequently,

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

31 Proof Lemma(2) Find a easy way The goal is change to

32 Definition For every v[u-1], define X v =S u \S v and Y v =S v \S u. L v = ∑ i  X v p i Define two set –Clearly, A  B

33 Definition For ε[0,1], we define Obviously, B=B 0 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

34 Help1 L v 1/4n Proof:

35 Help1 we assume p j  1/4n, for every j[k]. L v = ∑ i  X v p i, Under our assumption, L v  1/4n, for every v[u-1], Why? –because each set X v contains at least one element of size at least 1/4n.

36 Help2 Observe that L v (1-1/4n )  L v -1/16n 2 because L v 1/4n. Thus setting ε=1/4n implies Bε A.

37 Proof new Lemma By definitio n By help2

38 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 ”.

39 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., slope T (x)=-[ln(T(x))] ’.

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

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

42 Proof theorem µ i = E[p i ], so E[P m ]= ∑ i  [n] µ i. Help3: Proof of theorem

43 Help3 Help3 can be proved by the former lemma

44 Speaker : R92921084 何明彥

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

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

47 Lower Bound

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

49 Theorem(1/4) draw profit randomly according to a continuous probability distribution with non-increasing density function: then a vector of weight w 1, …,w n Therefore,

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

51 Theorem(3/4) All those sets of S(j-1) have weight < All sets containing item j have weight at least These sets can ’ t dominate the sets in S(j-1). S(j) contains all sets from S(j-1). SЄS(j-1) with profit create new dominating sets in S(j) with profit

52 Theorem(4/4) S(3)=(0;1;3;1, 2;1, 3;1, 2, 3) S(4)=(0;1;3;1, 2;1, 3;1, 2, 3; 1 23 4 P0.50.1 10.7 W 2 4 816 Ex : j=4  To create new dominating set 0 0 0.5 2 1 8 0.6 6 1.5 10 1.6 14 3,4;1,3,4;1,2,3,4)

53 Lower Bound(1/5) Given α>0, :# of dominating sets in S(j) with profit > (note: don ’ t count the last set [j] in this sequence) next, by induction we shows that

54 Lower Bound(2/5) ; for j>1, it holds

55 Lower Bound(3/5) : # of new dominating set in S(j)  (+1 because the set[j-1] doesn’t count in but yields a new set in S(j)) 

56 Lower Bound(4/5) #of dominating set in S(n) is therefore,

57 Lower Bound(5/5) is uniformly distributed in [0,1] so that consequently,

58 Conclusion for PartII the expected #of dominating sets for the exponential distribution is tight. For the exponential distribution, lower and upper bound deviate by

59 General Distributions Speaker : R92921083 余宗恩

60 Objective Profit 與以下兩者呈線性關係: 1. 期望收穫的最大值 2. 機率密度函數的上界

61 Method Lemma 9: => Lemma 10: Theorem

62 Define: ( 比 x 大的機率 )

63 因為引入 X k 的 T i (t) 並不是可完美 bound E[q] 的 long tailed function ,所以還需要進一步的調整。

64 Define: 把短尾的 mask 起來,再於 lemma 10 分析 E[q k ] 。

65 Rewrite Equation 2:

66 其實只要證明 : 為了套用 Theorem 4 ,再定義:

67

68

69 (by lemma 9) (by lemma 10)

70 Conclusion

71 Conclusion


Download ppt "Random Knapsack in Expected Polynomial Time 老師:呂學一老師."

Similar presentations


Ads by Google