Information Elsevier
Processing
Letters
9 August
17 (1993) 5-9
A lower bound for randomized update algorithms
1993
list
Boris Teia * Graduiertmkoileg
Informatik,
Unicersitiit
des Snarlandes,
Saarbriicken.
Germany
Communicated by H. Ganzinger Received 28 June 1991 Revised 6 May 1993
Abstract Teia, B.. A lower bound
for randomized
list update
algorithms,
Information
Processing
Letters
47 (1993) j-9.
There has been considerable effort to prove lower bounds for the competitiveness of a randomized list update algorithm. Lower bounds of 1.18 and (by a numerical technique) 1.27 were so far the best result. In this paper we construct a randomized request sequence c? that no deterministic on-line algorithm can service with an expected cost less than 3/2-j/(, +5) times the off-line cost (n denoting the length of the list). Using a result of Yao this establishes a new lower bound of 1.5 for the competitiveness of randomized list update algorithms.
Keywords:
Analysis
of algorithms
1. Introduction
In recent time much attention has been paid to competitive analysis of deterministic and randomized on-line algorithms [ 1,4-61. Loosely speaking, a randomized on-line algorithm is said to be c-competitive against a weak adversary iff for any request sequence its expected cost is (up to an additive constant) no more than c times the cost of the optimal off-line algorithm for that sequence. This paper deals with randomized online algorithms for the static list update problem in the standard model. We give a proof that no randomized list update algorithm can be better than 15competitive. Correspondence to: B. Teia, Graduiertenkolleg Informatik, Universitat des Saarlandes, Im Stadtrvald, 6600 Saarbriicken, Germany. * Research by the Deutsche Forschungsgemeinschaft. 0020-0190/93/%06.00
0 1993 - Elsevier
Science
Publishers
The list update problem [2-4,6] is the problem to maintain a set of items as an unsorted list, while minimizing the total cost of access. In the static list update problem only access operations but no insertions or deletions take place. The cost of accessing an item is determined by its distance from the front of the list. So accessing the ith item costs i. The list may be rearranged during the processing of a sequence of requests so that later accesses will be cheaper. Immediately after an access the accessed item can be moved any distance forward in the list. Such a movement is free of charge and is called a free exchange. Any other movement costs 1 per distance unit and is called a paid exchange. For a precise notion of competitiveness and a broader discussion of the list update problem see for instance [4]. For a randomized list update algorithm RAND
B.V. All rights reserved
5
Volume
17. Number
1
INFORMATION
PROCESSING
the cost to service a request sequence u, denoted RAND(a). is the sum over all expected costs due to accesses and paid exchanges. Let c 2 0. We will say that RAND is c-competitive against weak adversaries (we will omit this in the sequel) iff there is a constant k such that, independently of the size of the list, for all request sequences u and all off-line algorithms OFF inequality RAND(a) - cOFF(a) Q k holds. The smallest number c such that RAND is c-competitive is called the competitive factor of RAND. It has been shown that a deterministic list update algorithm in general incurs a cost not less than (2 - 2/(n + 1)) times the off-line cost, where n is the length of the item list (that is the number of items). In [4] there are presented various randomized algorithms that beat this bound. The best result was reached with a random-reset algorithm which has a competitive factor fi. The same paper states that no randomized list update algorithm can have a competitive factor less than 1.27. This leaves a considerable gap between lower and upper bound. In this paper we prove a lower bound of 1.5 for the competitive factor of the randomized list update algorithm. We use a result of Yao [7] in order to replace the averaging over the random choices of the algorithm by an averaging over the random distribution & of the input sequence. Thus it suffices to consider deterministic algorithms. The random distribution 6 constructed below forces every deterministic algorithm DET to spend at least 3/2 - .5/(n + 5) times the off-line cost. Since & can be made arbitrarily long this proves that no randomized list update algorithm can be better than 1.5-competitive. In the analysis we use the technique to consider pairs (i, j} of items and to estimate the cost of RAND and OFF for servicing the requests of i and j. Let (i, j} be a pair of items. Without loss of generality we may assume that in the OFF-list i is in front of j, denoted (i, j). Then we call the pair (i, j} inverted iff in the RAND-list j is in front of i. The cost to RAND turns out to be the higher the more inversions arise and the longer they are maintained. This gives a hint how a better than \/7-competitive list update algorithm (if it exists) must look like. 6
LETTERS
9 August
1993
2. A lower bound In the following n will always denote the length of the item list. Let u=(s~,..., s,) be a request sequence of length m. We will use the notation u(r) to denote the item s, requested at time f: u(t) = s,. Let uI = (st,. . .,s;‘>, u1 = <.J:, . . . . 5:) be request sequences of length II and L’ respectively. The combination uI 0 u, of u, and u, is defined by uLQu,= _ (St (..., s;:s; )..., s;>. Theorem.
For ecety integer p. there is a set 9 of request sequences of length p &pO, II random distribution 6 ol’er 9’ and an off-fine list update algorithm OFF such that the expected cost of erery deterministic list update algorithm DET fullfils
(DET(&) denotes the expected cost (the expectation taken ocer ~9) to DET in order to process the input. > Corollary 1. No randomized list uptake algorithm can achiece a cost less than 3/2 - 5/(n + 5) times the off-line cost. Corollary 2. No randomized list update algorithm can be better than 1.5-competitice.
Corollary 2 is an immediate implication of Corollary 1. Observing that a randomized algorithm is a random distribution over a set of deterministic algorithms, Corollary 1 is a consequence of the theorem above and the following theorem of Yao [7]. Theorem [7]. Let 9’ be a set of inputs, 19 a random distribution ocer 9, & a set of deterministic algorithms, and RAND a random distribution ouer &. Then
s;p .;;Lti
D.ET( 6) = 2i1-1~sup R4ND( u) . OES
(The supremum on the left side taken ouer all random distributions 6 ocer 9, the infimum on the right side taken over all random distributions RAND ocer _w’.)
Volume
-17. Number
1
INFORMATION
PROCESSING
We describe the set 9 of request sequences and the random distribution 3 on 9 by constructing a random element (J of 5“. The request sequence u is defined as a combination of subsequences a, each of which is defined by the following rule: Let L, denote the item list in the initial state, before any move has been done, and let L, (defined below) denote the list after construction of u7. Given L, we construct v~+, and L,+, as follows (see also the verbal description below): Proof of the Theorem.
L =L, let Y be a random set of items, such that for each item i with probability l/2, i EY while z Q n do I= L,(z) u,+,(k)=l z=z+l,k=k+l if IEYdo L = (111L) u,+,(k) = I, a,+,(k+
l)=I
1993
request costs i. Summing up over all items we obtain an upper bound for the cost to OFF in order to process gr: OFF( ur) d i( n + l)n + 2n = i( n + 5)n.
(1)
Since OFF keeps its list a precise copy of L, OFF’s list after round r (i.e. after the last request of a, is serviced) equals the initial list of round r + 1 (i.e. the list before the first request of a,, , is serviced). This implies
OFF(u)
z=l,k=l
9 August
LETTERS
=
COFF(U,). r
Let Gr denote the random distribution corresponding to the subsequences a,. Using the potential function 4 defined below, writing A+(u) resp. d&u,) for the change in potential during the processing of u resp. a, and A+(&) resp. A~~J(c?~,> for the corresponding expected values, we will prove A@,)
+DET(&)
a [; - &)OFF(uJ
k=k+2 od
(2)
L r+l =L
for every a, as constructed above and for all initial states of DET’s list. Then clearly
Here (11/L) denotes the list produced by moving item I in list L to the front. For instance (3110, 2, 3, 4)) = (3, 1, 2, 4).
Ac$(c?) +DET(G)
od
Described verbally, a,,, starts at the front of L, and requests in increasing order all items of the list. On the average every second item is requested three times and moved to the front. Since the items are requested from the front towards the end, the position of an item is not affected by a possible move of a previously requested item. The other half of the items stay at their place. The way our off-line algorithm OFF will service u is natural. OFF will simply keep as its list a precise copy of L. So an item that is requested three times in a row is moved in a free exchange to the front immediately after the first request. Items that are requested only once stay at their place. If i is the position of the item, the cost of the three requests is i + 2 where a single
a (i--&)OFF(u).
Since r_?can be made arbitrarily long, this proves the theorem. (Although we will not state the following argument formally, the reader should be able to follow the explanation.) Our analysis will leave the model of the linear list and allow DET to service each pair of items independently (compare [4]). This strengthens DET’s position. Consider e.g. the three item list (A, B, C). Then DET will be allowed to move C in front of A but to keep C behind B and B behind A although in the real list this is not possible. This implies that paid exchanges will not improve DET’s performance. To see this, note that a paid exchange costs 1, which is the same as the additional cost if the item is one position behind. After the access the item can be moved by a free exchange. So we may 7
Volume
47. Number
1
INFORMATION
PROCESSING
assume without loss of generality that DET does not use paid exchanges. For A E (DET, OFF) and every pair (i, j} of items we define Ai, and A,,(u~,>(analogously)
requested before j. Let uij be the restriction a, to requests of i and j. Note that
+ A4,, (requests
-$-f#(requests + #(requests
(i, i>
(0
in the A-list). (Remember: Then
(j, i) means “j is in front of i”.)
ACur)= C [Atj(Ur)+Aj,(Ur)] 1
of
j)
We distinguish four cases: (A) Uij = (i, j), (B) uij = (i, i, i, j),
of i)
of i where
1993
A4i,( ur) = Adij( u,~) = Aqbi,( requests i)
by A,j("r,> =
9 August
LETTERS
(3)
(i.j)
For any pair Ii, j} of items define the potential +ij to equal 0 iff (i, j} is not inverted, that is, i and j occur in the DET-list and the OFF-list in the same order, and being 1 iff (i, j} is inverted. 4 is the sum over all such +ij:
uij
=
(i, j, j, j),
(D) uij = (i, i, i, j, j, j). An item is requested three times if and only if it is in 9. Since each item is in 9 with probability l/2, each of the cases (A), (B), (0, (D) occurs with probability l/4. In order to estimate the left side in (4) we have to distinguish different situations and strategies: Let time r be the moment immediately before DET starts processing a,. Case 1: At time r there is no incersion. In this case, accessing i leaves 4ij unchanged. The expected value for DEqj(u,) is DE7;.j( 3,) = -&.
Obviously 0 G #J d n(n - D/2. We will prove
For the access of j we consider two strategies: 1.1: j is moced to the front after the first access. Then
Ac&~(&J + DEKj( &) + DEq;( &J 2 ; + A.
in cases (A) and (B) : (4)
Since there are n(n - D/2 inequality (4) implies
distinct pairs {i, j},
A4( er,> + DET( Gr) 2 +n( n - 1) + 2n
DEqi( a,) + A+ij( requests j) = 2 + A,
in cases (C) and (D): DEqi(
3
ur) + A4ij( requests j) = 1 + n_l.
1.2: j stays at its place after the first access. Then in cases (A) and (B) : Combining (1) and (5) gives (2). Since the left side of (4) can change only on a request of i or j, it suffices to consider the requests of i and j. Without loss of generality we assume (i, j> for the OFF-list immediately before the processing of Us starts. That implies that i is 8
DE?;,( a,) + A4ij( requests j) = 1 + A,
in cases (C) and (D) : DEq,(
a,) + A$ij( requests j) 2 2 + -
3
n-l
.
Volume 47. Number 1
IbiFORMATION
PROCESSING LETTERS
Note that DET,,(a;) becomes the larger, the longer it takes DET to move j to the front. Independently of the chosen strategy, DET,,(u,) + DET,$u,) + J~~(o;> has an expected value DET,,( ~~) + DET,,( ~~,) + d~lj( ~~,> _) 3 a?+2 n- 1’ Next we consider the case that at time r there is an inversion. Case 2: At time r there is an inr,ersion. That is, in the DET-list j is in front of i. We again distinguish two strategies: 2.1: At the time of the first access to j the incersion has been remoced. Looking first at the access of i and observing that A$,j(requests i> = - 1 we have
9 August 1993
Now look at the request of j. In case (C) and (D) the off-line algorithm OFF will move j in front of i and remove the inversion. In cases (A) and (B) the inversion will be maintained. So we have in cases (A) and (B) : 1 DET,,( a,) + 4di,( requests j) = n-l, incases (C) and (D): DET,,( a,) + 4dlj( requests j) = - 1 + A. Adding up the costs, we again obtain DET,,( &J + DET,,( &J + 4bij( Gr,) 3 a--+2
4 n-l’
This gives (4) and the proof is complete.
Cl
in cases (A) and (C): 1 DET,j( a,) + 4qbii( requests i) = -, n-1 in cases (B) and (D) : 3 DEK.j( a,) + 4q5ij( requests i) 2 n-1. Since after accessing i the inversion has been removed, the cost for accessing j is the same as in case that there is no inversion. Combining the two results gives DETij( ~~,) + DEqi( 6r) + 4$i,( sr,) 3 4 7+_ n-l’ 2.2: At the time of the first access to j there is still an inversion. Looking again first at access i and observing that A+ij(requests i> = 0 we have in cases (A) and (C) : 1 DEcj( ur) + Ar$ij( requests i) = 1 + n-1’ in cases (B) and (D): DEqj( a,) + 44ij( requests i) = 3 + A.
Acknowledgement
I am indebted to Kurt Mehlhorn for valuable suggestions. I also thank two anonymous referees for helpful comments.
References [I] S. Ben-David, A. Borodin, R. Karp, G. TQrdos and A. Wigderson. On the power of randomization in online algorithms, in: Proc. 22nd ACM Symp. on Theory of Computing (1990) 379-386. t21 J.L. Bentley and C.C. McGeoch, Amortized analyses of self-organizing sequential search heuristics, Comm. ACM 28 (4) (1985) 404-411. [31 S. Irani, Two results on the list update problem, Inform. Process. Left. 38 (1991) 301-306. [aI S. Irani, N. Reingold, J. Westbrook and D. Sleator, Randomized competitive algorithms for the list update problem, in: Proc. 2nd ACM-SL4M Symp. on Discrete Algorithms (1991) 251-260. 151M. Manasse, L. McGeoch and D. Sleator, Competitive algorithms for on-line problems, in: Proc. 2Orh ACM Symp. on Theory of Compuring (1988) 322-333.
[61D. Sleator and R. Tatjan, Amortized efficiency of list update and paging rules, Comm. ACM 2% (2) (1985) 202208. (71 A. Yao, Probabilistic computations: Towards a unified measure of complexity, in: Proc. 18th Symp. on Foundarion of Computer Science (1977) 222-227.
9