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

Evaluation of Algorithms for the List Update Problem

  • Upload
    fonda

  • View
    34

  • Download
    0

Embed Size (px)

DESCRIPTION

Evaluation of Algorithms for the List Update Problem. Suporn Pongnumkul R. Ravi Kedar Dhamdhere. Online Algorithms. Definition: An algorithm that must process each input in turn, without detailed knowledge of future inputs. Examples: Ski Rental, List Update. - PowerPoint PPT Presentation

Citation preview

Page 1: Evaluation of Algorithms for the List Update Problem

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

Online AlgorithmsOnline Algorithms

• Definition: An algorithm that must process each input in turn, without detailed knowledge of future inputs.

• Examples: Ski Rental, List Update

Page 3: Evaluation of Algorithms for the List Update Problem

Example Online Problem:Example Online Problem:Ski Rental ProblemSki Rental Problem

Scenario• I am a skier.• Each day, I have to either rent a pair of

skis for $1 per day, or buy them for $T.• BUT I don’t know when the ski season will

end. • What should I do?????

Page 4: Evaluation of Algorithms for the List Update Problem

Strategies for Ski Rental Strategies for Ski Rental ProblemProblem

• First Strategy: I will buy the skis on the first day.

• Second Strategy: I will keep renting the skis.

What should I do??????

Page 5: Evaluation of Algorithms for the List Update Problem

• Wait!

• Why did I talk about paying a number of times more than I should have?

• Why not some amount of dollars more than I should have?

Page 6: Evaluation of Algorithms for the List Update Problem

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 7: Evaluation of Algorithms for the List Update Problem

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 8: Evaluation of Algorithms for the List Update Problem

Back to Ski Rental ProblemBack to Ski Rental Problem

• Consider this algorithm: I’ll rent the skis for T days, and buy them on the T+1st day.

• Claim: The competitive ratio of this algorithm is 2.

Page 9: Evaluation of Algorithms for the List Update Problem

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 10: Evaluation of Algorithms for the List Update Problem

List Update Problem (Cont.)List Update Problem (Cont.)• Must access the requested item.• We can reorganize the list.

– We can move the requested element to any position closer to the front of the list for FREE.

– Any other transposition costs 1.

Page 11: Evaluation of Algorithms for the List Update Problem

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 12: Evaluation of Algorithms for the List Update Problem

FREQUENCY-COUNT (FC)FREQUENCY-COUNT (FC)• Maintain a frequency counter for each

item, and keep the list in nonincreasing order of their frequencies.

• FC has a bad competitive ratio = Ω(n), where n is the length of the list.

• FC does well in typical cases.

Page 13: Evaluation of Algorithms for the List Update Problem

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 nonincresing order of pi.

• Fact: FC converges to optimal solution.

Page 14: Evaluation of Algorithms for the List Update Problem

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 15: Evaluation of Algorithms for the List Update Problem

Previous WorkPrevious Work

• Diffuse Adversary – Beyond Competitive Analysis

[Koutsoupias, Papadimitriou, 2000]

• Statistical Adversary– A Statistical Adversary for On-line

Algorithms [Raghavan, 1991]

Page 16: Evaluation of Algorithms for the List Update Problem

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 17: Evaluation of Algorithms for the List Update Problem

Current DifficultiesCurrent Difficulties• Cannot settle on a proper OPT to evaluate

performance under this model.– Finite vs. infinite horizon.– Competitive ratio with optimal offline

adversary: reduces to online case– Comparison with static list is inappropriate

Page 18: Evaluation of Algorithms for the List Update Problem

Lead-Time Quotation ProblemLead-Time Quotation Problem

Scheduling Problem• Each job takes 1 day to process.• Everyday, I get some number of jobs.• For each job j, I have to accept with a

deadline (dj), or reject it right away.

• Profit = l – dj.

• Goal: Maximize the total profit

Page 19: Evaluation of Algorithms for the List Update Problem

Lead-Time Quotation ProblemLead-Time Quotation Problem

• Competitive Ratio of Q-FRAC algorithm = 1.618

[Keskinocak, Ravi, Tayur, 2001]

• We are working on – Average Case Analysis– Hybrid Model

Page 20: Evaluation of Algorithms for the List Update Problem

Our goalsOur goals

• Investigate the OPT for our List Update Hybrid Model.

• Average Case Analysis and Hybrid Model for Lead-time Quotation.

Page 21: Evaluation of Algorithms for the List Update Problem

Questions?Questions?

Page 22: Evaluation of Algorithms for the List Update Problem

Thank youThank you !!! !!!