Presentation is loading. Please wait.

Presentation is loading. Please wait.

Evaluation of Algorithms for the List Update Problem Suporn Pongnumkul R. Ravi Kedar Dhamdhere.

Similar presentations


Presentation on theme: "Evaluation of Algorithms for the List Update Problem Suporn Pongnumkul R. Ravi Kedar Dhamdhere."— Presentation transcript:

1 Evaluation of Algorithms for the List Update Problem Suporn Pongnumkul R. Ravi Kedar Dhamdhere

2 Overview List Update Problem Competitive Analysis Average Case Analysis Our Hybrid Model Setup of our experiment Results from our experiment Conjecture

3 List Update Problem Self-organizing sequential search Unsorted list Received a sequence of requests Cost of accessing the i th element of the list is i. ywzxvu L:

4 ywzxvu List Update Example ActionCostTotal Cost

5 ywzxvu L: List Update Example ActionCostTotal Cost Access x

6 ywzxvu L: List Update Example ActionCostTotal Cost Access x44

7 ywzxvu L: List Update Example ActionCostTotal Cost Access x44 Access v

8 ywzxvu L: List Update Example ActionCostTotal Cost Access x44 Access v59

9 ywzxvu L: List Update Example ActionCostTotal Cost Access x44 Access v59 Move v forward to before w

10 yvwzxu L: List Update Example ActionCostTotal Cost Access x44 Access v59 Move v forward to before w09

11 yvwzxu L: List Update Example ActionCostTotal Cost Access x44 Access v59 Move v forward to before w09 Access y

12 yvwzxu L: List Update Example ActionCostTotal Cost Access x44 Access v59 Move v forward to before w09 Access y110

13 yvwzxu L: List Update Example ActionCostTotal Cost Access x44 Access v59 Move v forward to before w09 Access y110 Access v

14 yvwzxu L: List Update Example ActionCostTotal Cost Access x44 Access v59 Move v forward to before w09 Access y110 Access v212

15 yvzwxu L: List Update Example ActionCostTotal Cost Access x44 Access v59 Move v forward to before w09 Access y110 Access v212 Transpose w and z

16 yvwzxu L: List Update Example ActionCostTotal Cost Access x44 Access v59 Move v forward to before w09 Access y110 Access v212 Transpose w and z113

17 Competitive Analysis Definition: An analysis in which the performance of an online algorithm is compared to the best that could have been achieved if all the inputs had been known in advance.

18 Competitive Ratio A: Our online algorithm C A (  ) OPT: Optimal Offline algorithm C OPT (  ) A is c-competitive if  a C A (  ) ≤ c C OPT (  ) + a for all request sequences 

19 Move-to-Front (MTF) When an element is accessed, move it to the front of the list. Theorem: [Sleator, Tarjan, 1985] MTF has competitive ratio 2 against optimal offline algorithm.

20 Average Case Analysis Assume each request comes from a fixed probability distribution, independent of previous requests. Suppose the i th item has probability p i. Design algorithms to minimize the expected cost. Optimal strategy is to keep the list sorted in non-increasing order of p i.

21 STAT = Static List List is sorted in non-increasing order of the probabilities Never moves anything Good for when we have a good estimate of the probability distribution.

22 Need a new model? Most real-world settings don't behave either like a discrete distribution, or like a worst-case one. Can we design an algorithm that does well in both typical and worst-case? How could we analyze such algorithms?

23 Hybrid Model Assume a fixed probability distribution, For each request, with probability, let the adversary change the request.  Average Case Analysis  Competitive Analysis  Known probability distribution with uncertainty.

24 Hybrid Algorithm? Parameterized by  Matches best average case performance when  is low, and matches best competitive ratio when  is high.

25 Move-From-Back-Epsilon List initially sorted in non-increasing order of probabilities. When an element x is accessed, promote it past others that have probability up to p x + .

26 ywzxvu L: MFBE Example (  = 0.2) RequestCostTotal Cost  vyzy vyzy Probp y = 0.5 p w = 0.2 p z = 0.15 p x = 0.1 p v = 0.03 p u = 0.02

27 ywzxvu L: MFBE Example (  = 0.2) RequestCostTotal Cost  xvyv xvyv Probp y = 0.5 p w = 0.2 p z = 0.15 p x = 0.1 p v = 0.03 p u = 0.02

28 ywzxvu L: MFBE Example (  = 0.2) RequestCostTotal Cost Access x (and move to before w)  xvyv xvyv Probp y = 0.5 p w = 0.2 p z = 0.15 p x = 0.1 p v = 0.03 p u = 0.02

29 yxwzvu L: MFBE Example (  = 0.2) RequestCostTotal Cost Access x (and move to before w)44  xvyv xvyv Probp y = 0.5 p x = 0.1 p w = 0.2 p z = 0.15 p v = 0.03 p u = 0.02

30 yxwzvu L: MFBE Example (  = 0.2) RequestCostTotal Cost Access x (and move to before w)44  xvyv xvyv Probp y = 0.5 p x = 0.1 p w = 0.2 p z = 0.15 p v = 0.03 p u = 0.02

31 yxwzvu L: MFBE Example (  = 0.2) RequestCostTotal Cost Access x (and move to before w)44 Access v (and move to before x)  xvyv xvyv Probp y = 0.5 p x = 0.1 p w = 0.2 p z = 0.15 p v = 0.03 p u = 0.02

32 yvxwzu L: MFBE Example (  = 0.2) RequestCostTotal Cost Access x (and move to before w)44 Access v (and move to before x)59  xvyv xvyv Probp y = 0.5 p v = 0.03 p x = 0.1 p w = 0.2 p z = 0.15 p u = 0.02

33 yvxwzu L: MFBE Example (  = 0.2) RequestCostTotal Cost Access x (and move to before w)44 Access v (and move to before x)59  xvyv xvyv Probp y = 0.5 p v = 0.03 p x = 0.1 p w = 0.2 p z = 0.15 p u = 0.02

34 yvxwzu L: MFBE Example (  = 0.2) RequestCostTotal Cost Access x (and move to before w)44 Access v (and move to before x)59 Access y  xvyv xvyv Probp y = 0.5 p v = 0.03 p x = 0.1 p w = 0.2 p z = 0.15 p u = 0.02

35 yvxwzu L: MFBE Example (  = 0.2) RequestCostTotal Cost Access x (and move to before w)44 Access v (and move to before x)59 Access y110  xvyv xvyv Probp y = 0.5 p v = 0.03 p x = 0.1 p w = 0.2 p z = 0.15 p u = 0.02

36 yvxwzu L: MFBE Example (  = 0.2) RequestCostTotal Cost Access x (and move to before w)44 Access v (and move to before x)59 Access y110  xvyv xvyv Probp y = 0.5 p v = 0.03 p x = 0.1 p w = 0.2 p z = 0.15 p u = 0.02

37 yvxwzu L: MFBE Example (  = 0.2) RequestCostTotal Cost Access x (and move to before w)44 Access v (and move to before x)59 Access y110 Access v  xvyv xvyv Probp y = 0.5 p v = 0.03 p x = 0.1 p w = 0.2 p z = 0.15 p u = 0.02

38 yvxwzu L: MFBE Example (  = 0.2) RequestCostTotal Cost Access x (and move to before w)44 Access v (and move to before x)59 Access y110 Access v212  xvyv xvyv Probp y = 0.5 p v = 0.03 p x = 0.1 p w = 0.2 p z = 0.15 p u = 0.02

39 Difficulties in Proofs It’s not easy to understand the behavior of OPT. –OPT can be computed by Dynamic programming Trivial way = O ((n!) 2 m) Improvement = O ((2 n )(n!)m) [Reingold, Westbrook, 1996]

40 Our Experiment Motivation: To see the behavior of algorithms in our hybrid model. Measurement: We measure the performance of an online algorithm by the average competitive ratio.

41 Our Experiment Variables in our experiment –Type of List Update Algorithm (MTF, STAT, MFBE) –Type of Probability Distribution –Type of Adversary –Epsilon: 

42 Our Experiment We generate a request sequence of length 100, with a chosen probability distribution. Then, with probability  let the adversary change the request sequence.

43 Our Experiment Record the cost incurred by the online algorithm = Cost A () Use Dynamic Programming to find optimum cost of that request sequence = Cost OPT (). Competitive Ratio = Cost A ()/Cost OPT () Repeat this 100 times to find the average competitive ratio.

44 Distribution Geometric Distribution: –P[i] / 1/2 i Uniform Distribution: –P[i] = 1/n, n = length of the list Zipfian Distribution (Zipf(2)): –P[i] / 1/i 2

45 Cruel Adversary This is an adaptive adversary Looks at the current list and request for the last item in the list. ywzxvu L:

46 Cruel Adversary, Geometric Distribution, n=6

47

48 Reversed Geometric Adversary This adversary chooses elements randomly, according to the geometric distribution on the reversed STAT order. This adversary requests small probability items more frequently. Oblivious Adversary = doesn’t look at the current list

49 Reversed Geometric Adversary, Geometric Distribution, n=6

50 Uniform Adversary This adversary requests elements from the list uniformly at random. Oblivious Adversary With this adversary, the sorted order of elements in the combined probability distribution doesn’t change.

51 Uniform Adversary, Zipfian2 Distribution, n=6

52 Observation The performance of any algorithm in this hybrid model depends heavily on the type of adversary. Yet MFBE seems better than the worse of STAT and MTF.

53 Conjecture The average competitive ratio of MFBE is dominated by the maximum of the average competitive ratios of STAT and MTF.

54 Conjecture Request sequence is generated by p Adversarial settings:  = k/m 8 adversarial settings, E p (Cost(MFB)) · maxE p (Cost(MTF)) E p (Cost(STAT)) {

55 Questions?

56 Thank you !!!


Download ppt "Evaluation of Algorithms for the List Update Problem Suporn Pongnumkul R. Ravi Kedar Dhamdhere."

Similar presentations


Ads by Google