Date post: | 21-Dec-2015 |
Category: |
Documents |
Upload: | brianne-turner |
View: | 216 times |
Download: | 0 times |
Competitive Competitive Paging Paging
AlgorithmsAlgorithmsAmos Fiat, Richard Karp, Michael Amos Fiat, Richard Karp, Michael
Luby, Lyle McGeoch, Daniel Luby, Lyle McGeoch, Daniel Sleator, Neal YoungSleator, Neal Young
presented by Seth Phillipspresented by Seth Phillips
OverviewOverview
IntroductionIntroduction Server ProblemsServer Problems Marking AlgorithmMarking Algorithm EATREATR Lower BoundLower Bound Competitive Against Other Competitive Against Other
AlgorithmsAlgorithms
Introduction – Paging Introduction – Paging ProblemProblem
System with k pages of fast memory System with k pages of fast memory (cache/RAM)(cache/RAM)
Has n-k pages of slow memory Has n-k pages of slow memory (RAM/virtual)(RAM/virtual)
Requesting a page not in fast Requesting a page not in fast memorymemory
Eject a page to make room (page Eject a page to make room (page fault)fault)
Online paging algorithmOnline paging algorithm
Decision made without knowledge of Decision made without knowledge of future requestsfuture requests
Performance analyzed against off-Performance analyzed against off-line algorithm – complete knowledgeline algorithm – complete knowledge
Deterministic algorithms are k-Deterministic algorithms are k-competitivecompetitive
Randomized AlgorithmsRandomized Algorithms
Analyzed as a sum cost of the Analyzed as a sum cost of the algorithmalgorithm
Cost on a sequence of input Cost on a sequence of input averaged over all the random averaged over all the random choices that the algorithm makes choices that the algorithm makes while processing the sequencewhile processing the sequence
OverviewOverview
IntroductionIntroduction Server ProblemsServer Problems Marking AlgorithmMarking Algorithm EATREATR Lower BoundLower Bound Competitive Against Other Competitive Against Other
AlgorithmsAlgorithms
K-server ProblemK-server Problem
Let G be an n-vertex graph with Let G be an n-vertex graph with positive edge lengths obeying the positive edge lengths obeying the triangle inequalitytriangle inequality
Let k mobile servers occupy vertices Let k mobile servers occupy vertices of Gof G
Given a sequence of requests, each Given a sequence of requests, each of which specifies a vertex, decide of which specifies a vertex, decide how to move the servers in response how to move the servers in response to each requestto each request
K-server continuedK-server continued
Requests must be satisfied in order Requests must be satisfied in order of their occurrence in the sequenceof their occurrence in the sequence
Cost of handling a sequence is equal Cost of handling a sequence is equal to the total distance moved by the to the total distance moved by the serversservers
It is conjectured that there exists a It is conjectured that there exists a k-competitive k-server algorithm for k-competitive k-server algorithm for any graphany graph
Uniform k-server Uniform k-server problemproblem
Cost of moving a server from any Cost of moving a server from any vertex to any other vertex is 1vertex to any other vertex is 1
Isomorphic to the paging problem: Isomorphic to the paging problem: any vertex with a server is in fast any vertex with a server is in fast memory and the vertices of the memory and the vertices of the graph represent the address spacegraph represent the address space
OverviewOverview
IntroductionIntroduction Server ProblemsServer Problems Marking AlgorithmMarking Algorithm EATREATR Lower BoundLower Bound Competitive Against Other Competitive Against Other
AlgorithmsAlgorithms
Marking AlgorithmMarking Algorithm
Randomized algorithm for uniform k-Randomized algorithm for uniform k-server problem on graph with n server problem on graph with n verticesvertices
Servers are initially on vertices 1 Servers are initially on vertices 1 through kthrough k
Algorithm maintains a set of marked Algorithm maintains a set of marked verticesvertices
Initially these are the vertices Initially these are the vertices covered by the serverscovered by the servers
MarkingMarking
Each time a vertex is requested, it is Each time a vertex is requested, it is markedmarked
If k+1 vertices are marked, all If k+1 vertices are marked, all marks except the most recently marks except the most recently requested vertex are erasedrequested vertex are erased
ServingServing
If vertex is covered, then no servers If vertex is covered, then no servers movemove
If vertex is not covered, then a If vertex is not covered, then a server is chosen uniformly at server is chosen uniformly at random from the unmarked verticesrandom from the unmarked vertices
That server is moved to coverThat server is moved to cover
CompetitivenessCompetitiveness
2*H_k competitive (H_k on the order 2*H_k competitive (H_k on the order of ln(k))of ln(k))
Algorithm implicitly divides request Algorithm implicitly divides request sequence into phases.sequence into phases.
First phase begins with r(i), where I First phase begins with r(i), where I is the smallest integer such that r(i) is the smallest integer such that r(i) is not in the set {1 through k}.is not in the set {1 through k}.
Comp. continuedComp. continued
In general the phase starting with In general the phase starting with r(i) ends with r(j)r(i) ends with r(j)
j is the smallest integer such that the j is the smallest integer such that the set {r(i), r(i+1), . . ., r(j+1)} has set {r(i), r(i+1), . . ., r(j+1)} has cardinality k+1cardinality k+1
Comp. continuedComp. continued
Implicitly the first request of every Implicitly the first request of every phase is made to an unmarked vertexphase is made to an unmarked vertex
A vertex is clean if it was not A vertex is clean if it was not requested in the previous phase and requested in the previous phase and has not yet been requested in this has not yet been requested in this phase – we’ll say there are l of thesephase – we’ll say there are l of these
A vertex is stale if it was requested in A vertex is stale if it was requested in the previous phase and has not yet the previous phase and has not yet been requested in this phasebeen requested in this phase
Adversary Amortized Adversary Amortized CostCost
At least l/2 because:At least l/2 because: Let d be the number of servers that Let d be the number of servers that
do not coincide with marking’s at the do not coincide with marking’s at the beginning of the phasebeginning of the phase
Let d’ be this quantity at the end of Let d’ be this quantity at the end of the phasethe phase
Cost(A) >= l – d because l requests Cost(A) >= l – d because l requests have to be met, mitigated by a have to be met, mitigated by a possible d different server locationspossible d different server locations
Adversary Cost Adversary Cost ContinuedContinued
C(Adv) >= d’ because:C(Adv) >= d’ because: The vertices of S are those covered The vertices of S are those covered
by Marking at the end of the phase, by Marking at the end of the phase, so d’ servers are not in Sso d’ servers are not in S
Since Adversary is lazy (does not Since Adversary is lazy (does not unnecessarily move servers) at least unnecessarily move servers) at least d’ of A’s servers were outside of S d’ of A’s servers were outside of S for the entire phasefor the entire phase
Adversary Cost Adversary Cost ContinuedContinued
C(Adv) >= max(l – d, d’) >= ½(l – d C(Adv) >= max(l – d, d’) >= ½(l – d + d’)+ d’)
D and d’ naturally telescope so D and d’ naturally telescope so simply C(Adv) >= l/2simply C(Adv) >= l/2
Marking Expected CostMarking Expected Cost l requests to clean vertices – each costs 1l requests to clean vertices – each costs 1 k – l requests to stale vertices – each k – l requests to stale vertices – each
based on the probability that there is no based on the probability that there is no server thereserver there
Highest cost is when the l requests to Highest cost is when the l requests to clean vertices come first (allows the most clean vertices come first (allows the most stale vertices to be reassigned)stale vertices to be reassigned)
That leaves the cost of the k-l stales to be:That leaves the cost of the k-l stales to be: l/k + l/(k-1) + l/(k-2) + .. . + l/(l+1) = l/k + l/(k-1) + l/(k-2) + .. . + l/(l+1) =
l*(H_k – H_l)l*(H_k – H_l)
Final Cost Final Cost CompetitivenessCompetitiveness
l*H_k – l*H_l + l <= l*H_kl*H_k – l*H_l + l <= l*H_k Since the cost of the adversary is l/2:Since the cost of the adversary is l/2: The Marking algorithm is 2*H_k The Marking algorithm is 2*H_k
competitivecompetitive For the n-1 server problem it is H_n-For the n-1 server problem it is H_n-
1 competitive, but for time 1 competitive, but for time constraints I’ll skip thisconstraints I’ll skip this
OverviewOverview
IntroductionIntroduction Server ProblemsServer Problems Marking AlgorithmMarking Algorithm EATREATR Lower BoundLower Bound Competitive Against Other Competitive Against Other
AlgorithmsAlgorithms
EATREATR
Stands for End After Twice RequestedStands for End After Twice Requested This is an algorithm specific to the This is an algorithm specific to the
uniform 2-server problemuniform 2-server problem Servers initially on vertices 1 + 2Servers initially on vertices 1 + 2 Stale redefined to not clean and not Stale redefined to not clean and not
the most recently requested vertexthe most recently requested vertex When a stale vertex is requested, the When a stale vertex is requested, the
servers are placed on the two most servers are placed on the two most recently requested verticesrecently requested vertices
EATR AnalysisEATR Analysis
Let l be the number of clean vertices Let l be the number of clean vertices requested during a phaserequested during a phase
The number of stale vertices before The number of stale vertices before the request that terminates the phase the request that terminates the phase is l+1is l+1
The probably of a server on each of The probably of a server on each of these is 1/(l+1)these is 1/(l+1)
The expected cost of each phase is l + The expected cost of each phase is l + l/(l+1)l/(l+1)
Adversary AnalysisAdversary Analysis
The best possible cost incurred by The best possible cost incurred by any algorith for each phase is at any algorith for each phase is at least lleast l
The competitive factor is therefore: The competitive factor is therefore: (l + l/(l+1))/l = 1 + 1/(l+1) <= 3/2(l + l/(l+1))/l = 1 + 1/(l+1) <= 3/2
OverviewOverview
IntroductionIntroduction Server ProblemsServer Problems Marking AlgorithmMarking Algorithm EATREATR Lower BoundLower Bound Competitive Against Other Competitive Against Other
AlgorithmsAlgorithms
Lower BoundLower Bound
There is no c-competitive There is no c-competitive randomized algorithm for the randomized algorithm for the uniform (n-1) server problem on n uniform (n-1) server problem on n vertices with c < H_n-1vertices with c < H_n-1
(Time constraints) The article proves (Time constraints) The article proves this, which also makes the marking this, which also makes the marking algorithm in a class of best possible algorithm in a class of best possible algorithms for this problemalgorithms for this problem
OverviewOverview
IntroductionIntroduction Server ProblemsServer Problems Marking AlgorithmMarking Algorithm EATREATR Lower BoundLower Bound Competitive Against Other Competitive Against Other
AlgorithmsAlgorithms
Algorithms Competitive Algorithms Competitive Against Several OthersAgainst Several Others
Adopt a viewpoint where each algorithm Adopt a viewpoint where each algorithm is tailored for a specific choice of k and n.is tailored for a specific choice of k and n.
The ordered pair (k, n) is called the type The ordered pair (k, n) is called the type of algorithmof algorithm
Let A be adeterministic and B be a Let A be adeterministic and B be a deterministic on-line algorithms of the deterministic on-line algorithms of the same type and c be a positive constantsame type and c be a positive constant
If for every sequence r of requests C_A(r) If for every sequence r of requests C_A(r) <= c*C_B(r) + alpha then A is c-<= c*C_B(r) + alpha then A is c-competitive with Bcompetitive with B
ACASO continuedACASO continued
Let c* = (c(1), c(2), . .. C(m)) be a Let c* = (c(1), c(2), . .. C(m)) be a sequence of postive real numberssequence of postive real numbers
c* is realizable if, for every (k,n) and c* is realizable if, for every (k,n) and every sequence B(1), B(2) . . .B(m) every sequence B(1), B(2) . . .B(m) there exists an algorithm A of type there exists an algorithm A of type (k,n) such then A is c(i) competitive (k,n) such then A is c(i) competitive with B(i)with B(i)
c* realizable iff:c* realizable iff:Sum from 1 to m of (1/c(i)) <= 1Sum from 1 to m of (1/c(i)) <= 1