evaluation of algorithms for the list update problem
DESCRIPTION
Evaluation of Algorithms for the List Update Problem. Suporn Pongnumkul R. Ravi Kedar Dhamdhere. Overview. List Update Problem Competitive Analysis Average Case Analysis Our Hybrid Model Setup of our experiment Results from our experiment Conjecture. L:. y. w. z. x. v. u. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/1.jpg)
Evaluation of Algorithms Evaluation of Algorithms for the List Update for the List Update
Problem Problem
Suporn PongnumkulR. Ravi
Kedar Dhamdhere
![Page 2: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/2.jpg)
OverviewOverview
• List Update Problem• Competitive Analysis• Average Case Analysis• Our Hybrid Model• Setup of our experiment• Results from our experiment• Conjecture
![Page 3: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/3.jpg)
List Update ProblemList Update Problem• Self-organizing sequential search
• Unsorted list
• Received a sequence of requests
• Cost of accessing the ith element of the list is i.
y w z x v uL:
![Page 4: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/4.jpg)
y w z x v uL:
List Update ExampleList Update Example
Action Cost Total Cost
![Page 5: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/5.jpg)
y w z x v uL:
List Update ExampleList Update Example
Action Cost Total Cost
Access x
![Page 6: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/6.jpg)
y w z x v uL:
List Update ExampleList Update Example
Action Cost Total Cost
Access x 4 4
![Page 7: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/7.jpg)
y w z x v uL:
List Update ExampleList Update Example
Action Cost Total Cost
Access x 4 4
Access v
![Page 8: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/8.jpg)
y w z x v uL:
List Update ExampleList Update Example
Action Cost Total Cost
Access x 4 4
Access v 5 9
![Page 9: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/9.jpg)
y w z x v uL:
List Update ExampleList Update Example
Action Cost Total Cost
Access x 4 4
Access v 5 9
Move v forward to before w
![Page 10: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/10.jpg)
y v w z x uL:
List Update ExampleList Update Example
Action Cost Total Cost
Access x 4 4
Access v 5 9
Move v forward to before w 0 9
![Page 11: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/11.jpg)
y v w z x uL:
List Update ExampleList Update Example
Action Cost Total Cost
Access x 4 4
Access v 5 9
Move v forward to before w 0 9
Access y
![Page 12: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/12.jpg)
y v w z x uL:
List Update ExampleList Update Example
Action Cost Total Cost
Access x 4 4
Access v 5 9
Move v forward to before w 0 9
Access y 1 10
![Page 13: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/13.jpg)
y v w z x uL:
List Update ExampleList Update Example
Action Cost Total Cost
Access x 4 4
Access v 5 9
Move v forward to before w 0 9
Access y 1 10
Access v
![Page 14: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/14.jpg)
y v w z x uL:
List Update ExampleList Update Example
Action Cost Total Cost
Access x 4 4
Access v 5 9
Move v forward to before w 0 9
Access y 1 10
Access v 2 12
![Page 15: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/15.jpg)
y v z w x uL:
List Update ExampleList Update Example
Action Cost Total Cost
Access x 4 4
Access v 5 9
Move v forward to before w 0 9
Access y 1 10
Access v 2 12
Transpose w and z
![Page 16: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/16.jpg)
y v w z x uL:
List Update ExampleList Update Example
Action Cost Total Cost
Access x 4 4
Access v 5 9
Move v forward to before w 0 9
Access y 1 10
Access v 2 12
Transpose w and z 1 13
![Page 17: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/17.jpg)
Competitive AnalysisCompetitive 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.
![Page 18: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/18.jpg)
Competitive RatioCompetitive Ratio
A:Our online algorithm
CA()
OPT:Optimal Offline
algorithm
COPT()
A is c-competitive if aCA() ≤ c COPT() + a
for all request sequences
![Page 19: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/19.jpg)
Move-to-Front (MTF)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.
![Page 20: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/20.jpg)
Average Case AnalysisAverage Case Analysis• Assume each request comes from a
fixed probability distribution, independent of previous requests. Suppose the ith item has probability pi. Design algorithms to minimize the expected cost.
• Optimal strategy is to keep the list sorted in non-increasing order of pi.
![Page 21: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/21.jpg)
STAT = Static ListSTAT = 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.
![Page 22: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/22.jpg)
Need a new model?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?
![Page 23: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/23.jpg)
Hybrid ModelHybrid 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.
),...,,( 21 npppp
01
10
![Page 24: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/24.jpg)
Hybrid Algorithm?Hybrid Algorithm?• Parameterized by
• Matches best average case performance when is low, and matches best competitive ratio when is high.
![Page 25: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/25.jpg)
Move-From-Back-EpsilonMove-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 px + .
![Page 26: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/26.jpg)
y w z x v uL:
MFBE Example (MFBE Example ( = 0.2) = 0.2)
Request Cost Total Cost
v y z yProb py = 0.5 pw = 0.2 pz = 0.15 px = 0.1 pv = 0.03 pu = 0.02
![Page 27: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/27.jpg)
y w z x v uL:
MFBE Example (MFBE Example ( = 0.2) = 0.2)
Request Cost Total Cost
x v y vProb py = 0.5 pw = 0.2 pz = 0.15 px = 0.1 pv = 0.03 pu = 0.02
![Page 28: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/28.jpg)
y w z x v uL:
MFBE Example (MFBE Example ( = 0.2) = 0.2)
Request Cost Total Cost
Access x (and move to before w)
x v y vProb py = 0.5 pw = 0.2 pz = 0.15 px = 0.1 pv = 0.03 pu = 0.02
![Page 29: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/29.jpg)
y x w z v uL:
MFBE Example (MFBE Example ( = 0.2) = 0.2)
Request Cost Total Cost
Access x (and move to before w) 4 4
x v y vProb py = 0.5 px = 0.1 pw = 0.2 pz = 0.15 pv = 0.03 pu = 0.02
![Page 30: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/30.jpg)
y x w z v uL:
MFBE Example (MFBE Example ( = 0.2) = 0.2)
Request Cost Total Cost
Access x (and move to before w) 4 4
x v y vProb py = 0.5 px = 0.1 pw = 0.2 pz = 0.15 pv = 0.03 pu = 0.02
![Page 31: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/31.jpg)
y x w z v uL:
MFBE Example (MFBE Example ( = 0.2) = 0.2)
Request Cost Total Cost
Access x (and move to before w) 4 4
Access v (and move to before x)
x v y vProb py = 0.5 px = 0.1 pw = 0.2 pz = 0.15 pv = 0.03 pu = 0.02
![Page 32: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/32.jpg)
y v x w z uL:
MFBE Example (MFBE Example ( = 0.2) = 0.2)
Request Cost Total Cost
Access x (and move to before w) 4 4
Access v (and move to before x) 5 9
x v y vProb py = 0.5 pv = 0.03 px = 0.1 pw = 0.2 pz = 0.15 pu = 0.02
![Page 33: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/33.jpg)
y v x w z uL:
MFBE Example (MFBE Example ( = 0.2) = 0.2)
Request Cost Total Cost
Access x (and move to before w) 4 4
Access v (and move to before x) 5 9
x v y vProb py = 0.5 pv = 0.03 px = 0.1 pw = 0.2 pz = 0.15 pu = 0.02
![Page 34: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/34.jpg)
y v x w z uL:
MFBE Example (MFBE Example ( = 0.2) = 0.2)
Request Cost Total Cost
Access x (and move to before w) 4 4
Access v (and move to before x) 5 9
Access y
x v y vProb py = 0.5 pv = 0.03 px = 0.1 pw = 0.2 pz = 0.15 pu = 0.02
![Page 35: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/35.jpg)
y v x w z uL:
MFBE Example (MFBE Example ( = 0.2) = 0.2)
Request Cost Total Cost
Access x (and move to before w) 4 4
Access v (and move to before x) 5 9
Access y 1 10
x v y vProb py = 0.5 pv = 0.03 px = 0.1 pw = 0.2 pz = 0.15 pu = 0.02
![Page 36: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/36.jpg)
y v x w z uL:
MFBE Example (MFBE Example ( = 0.2) = 0.2)
Request Cost Total Cost
Access x (and move to before w) 4 4
Access v (and move to before x) 5 9
Access y 1 10
x v y vProb py = 0.5 pv = 0.03 px = 0.1 pw = 0.2 pz = 0.15 pu = 0.02
![Page 37: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/37.jpg)
y v x w z uL:
MFBE Example (MFBE Example ( = 0.2) = 0.2)
Request Cost Total Cost
Access x (and move to before w) 4 4
Access v (and move to before x) 5 9
Access y 1 10
Access v
x v y vProb py = 0.5 pv = 0.03 px = 0.1 pw = 0.2 pz = 0.15 pu = 0.02
![Page 38: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/38.jpg)
y v x w z uL:
MFBE Example (MFBE Example ( = 0.2) = 0.2)
Request Cost Total Cost
Access x (and move to before w) 4 4
Access v (and move to before x) 5 9
Access y 1 10
Access v 2 12
x v y vProb py = 0.5 pv = 0.03 px = 0.1 pw = 0.2 pz = 0.15 pu = 0.02
![Page 39: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/39.jpg)
Difficulties in ProofsDifficulties in Proofs
• It’s not easy to understand the behavior of OPT.– OPT can be computed by Dynamic
programming • Trivial way = O((n!)2m)• Improvement = O((2n)(n!)m)
[Reingold, Westbrook, 1996]
![Page 40: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/40.jpg)
Our ExperimentOur 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.
![Page 41: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/41.jpg)
Our ExperimentOur Experiment• Variables in our experiment
– Type of List Update Algorithm (MTF, STAT, MFBE)
– Type of Probability Distribution– Type of Adversary
– Epsilon:
![Page 42: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/42.jpg)
Our ExperimentOur Experiment• We generate a request sequence of
length 100, with a chosen probability distribution.
• Then, with probability let the adversary change the request sequence.
![Page 43: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/43.jpg)
Our ExperimentOur Experiment• Record the cost incurred by the online
algorithm = CostA()
• Use Dynamic Programming to find optimum cost of that request sequence = CostOPT().
• Competitive Ratio = CostA()/CostOPT()
• Repeat this 100 times to find the average competitive ratio.
![Page 44: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/44.jpg)
DistributionDistribution• Geometric Distribution:
– P[i] / 1/2i
• Uniform Distribution:– P[i] = 1/n, n = length of the list
• Zipfian Distribution (Zipf(2)):– P[i] / 1/i2
![Page 45: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/45.jpg)
Cruel AdversaryCruel Adversary
• This is an adaptive adversary
• Looks at the current list and request for the last item in the list.
y w z x v uL:
![Page 46: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/46.jpg)
Cruel Adversary, Geometric Cruel Adversary, Geometric Distribution, n=6Distribution, n=6
Average Competitive Ratio
1
1.5
2
2.5
3
3.5
4
4.5
5
5.5
6
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Epsilon
Ave
rage
Com
petit
ive
Rat
io
STAT
MFBE
MTF
![Page 47: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/47.jpg)
Cruel Adversary, Geometric Cruel Adversary, Geometric Distribution, n=6Distribution, n=6
Average Competitive Ratio
1
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
2
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Epsilon
Ave
rage
Com
petit
ive
Rat
io
STAT
MFBE
MTF
![Page 48: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/48.jpg)
Reversed Geometric Reversed Geometric AdversaryAdversary
• 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
![Page 49: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/49.jpg)
Reversed Geometric Adversary, Reversed Geometric Adversary, Geometric Distribution, n=6Geometric Distribution, n=6
Average Competitive Ratio
1
1.1
1.2
1.3
1.4
1.5
1.6
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Epsilon
Ave
rage
Com
petit
ive
Rat
io
STAT
MFBE
MTF
![Page 50: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/50.jpg)
Uniform AdversaryUniform 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.
![Page 51: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/51.jpg)
Uniform Adversary, Zipfian2 Uniform Adversary, Zipfian2 Distribution, n=6Distribution, n=6
Average Competitive Ratio
1
1.05
1.1
1.15
1.2
1.25
1.3
1.35
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Epsilon
Ave
rage
Com
petit
ive
Rat
io
STAT
MFBE
MTF
![Page 52: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/52.jpg)
ObservationObservation
• 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.
![Page 53: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/53.jpg)
ConjectureConjecture
• The average competitive ratio of MFBE is dominated by the maximum of the average competitive ratios of STAT and MTF.
![Page 54: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/54.jpg)
ConjectureConjecture• Request sequence is generated by p• Adversarial settings:
• = k/m• 8 adversarial settings,
Ep(Cost(MFB)) · max Ep (Cost(MTF))
Ep (Cost(STAT))
)(),1(),....,5(),4(),3(),2(),1(: mm )(),....,3(),2(),1( k
{
![Page 55: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/55.jpg)
Questions?Questions?
![Page 56: Evaluation of Algorithms for the List Update Problem](https://reader033.vdocument.in/reader033/viewer/2022061616/56814b36550346895db8400f/html5/thumbnails/56.jpg)
Thank youThank you !!! !!!