VIEWS: 1 PAGES: 19 POSTED ON: 10/25/2011
Computer Networks 45 (2004) 155–173 www.elsevier.com/locate/comnet Eﬃcient algorithms for periodic scheduling Amotz Bar-Noy a, Vladimir Dreizin b, Boaz Patt-Shamir b,* a AT&T Research Labs, 180 Park Avenue, Florham Park, NJ 07932, USA b Department of Electrical Engineering, Tel Aviv University, Tel Aviv 69978, Israel Received 4 February 2003; received in revised form 14 November 2003; accepted 19 December 2003 Responsible Editor: N. Shroﬀ Abstract In a perfectly periodic schedule, time is divided into time slots, and each client gets a slot precisely every predeﬁned number of time slots. The input to a schedule design algorithm is a frequency request for each client, and its task is to construct a perfectly periodic schedule that matches the requests as ‘‘closely’’ as possible. The quality of the schedule is measured by the ratios between the requested frequency and the allocated frequency for each client (either by the weighted average or by the maximum of these ratios over all clients). Perfectly Periodic schedules enjoy maximal fairness, and are very useful in many contexts of asymmetric communication, e.g., push systems and Bluetooth net- works. However, ﬁnding an optimal perfectly periodic schedule is NP-hard. Tree scheduling is a methodology for developing perfectly periodic schedules based on hierarchical round-robin, where the hierarchy is represented by trees. In this paper, we study algorithms for constructing scheduling trees. First, we give optimal (exponential time) algorithms for both the average and the maximum measures. Second, we present a few eﬃcient heuristic algorithms for generating schedule trees, based on the structure and the analysis of the optimal algorithms. Simulation results indicate that some of these heuristics produce excellent schedules in practice, sometimes even beating the best known non-perfectly periodic scheduling algorithms. Ó 2004 Elsevier B.V. All rights reserved. Keywords: Periodic scheduling; Fair scheduling; Broadcast disks; Hierarchical round robin 1. Introduction diﬃculty is to use scheduling strategies that allow mobile devices to keep their radios turned oﬀ for One of the major problems of mobile commu- most of the time. For example, BluetoothÕs Park nication devices is power supply, partly due to the Mode and Sniﬀ Mode allow a client to sleep except fact that radio communication is a relatively high for some pre-deﬁned periodic interval [10]. An- power consumer. A common way to mitigate this other example is Broadcast Disks [1], where a server broadcasts ‘‘pages’’ to clients. The goal is to minimize the waiting time and, in particular, the * Corresponding author. Tel.: +972-3-640-7036; fax: +972-3- ‘‘busy waiting’’ time of a random client that wishes 640-7095. E-mail addresses: amotz@research.att.com (A. Bar-Noy), to access one of the pages [16]. vld@eng.tau.ac.il (V. Dreizin), boaz@eng.tau.ac.il (B. Patt- One class of particularly attractive schedules Shamir). (from the clientÕs point of view) is the class of 1389-1286/$ - see front matter Ó 2004 Elsevier B.V. All rights reserved. doi:10.1016/j.comnet.2003.12.017 156 A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 perfectly periodic schedules, where each client i gets one time slot exactly every bi time slots, for some A <ABACAD> bi called the period of i. Under a perfectly periodic BCD schedule, a client needs to record only the period length and the oﬀset relative to a globally known Fig. 1. An example of a tree and its corresponding schedule (see time zero to get a full description of its own Section 2.3 for explanation). schedule. In Broadcast Disks, other non-perfectly periodic schedules that guarantee low waiting time may require the client to actively listen until its hard [6], so one must resort to near-optimal turn arrives (busy waiting), while perfectly periodic algorithms. One of the most eﬀective ways to schedules allow the client to actually shut down its construct perfectly periodic schedules is tree receiver. Note that allocating many consecutive scheduling [7]. A tree schedule is essentially a slots to the a client with large bandwidth demand hierarchical composition of round-robin sched- will in fact increase the average waiting time of ules, where the hierarchy is represented by a tree that client. Thus, the appeal for mobile devices (see example in Fig. 1; a detailed explanation is from the power consumption point of view is given later). therefore obvious. In addition, observe that per- In this paper, we study trees that represent fectly periodic schedules have, in some sense, the ‘‘good’’ perfectly periodic schedules. Our strategy best fairness among all schedules (cf., for example, is to analyze the (exponential time) algorithm that the ‘‘chairperson assignment problem’’ [18]). constructs the optimal tree scheduling, and using it The main question related to perfectly periodic as the starting point, we develop ‘‘good’’ heuristic scheduling is how to ﬁnd good schedules. More algorithms that run in polynomial-time. The speciﬁcally, the model is roughly as follows. We goodness of the heuristics is tested by experimen- assume that we are given a set of share requests tally comparing them with the best known non- fa1 ; . . . ; an g where each ai represents the fraction periodic algorithm. of Pn the bandwidth requested by client i, i.e., i¼1 ai ¼ 1. Given this input, an algorithm com- 1.1. Related work putes a perfectly periodic schedule that matches the clients requests as ‘‘closely’’ as possible. The Motivated by the goal of minimizing the wait- schedule implies a period bi and a share bi ¼ 1=bi ing time, much research has focused on scheduling for each client i. Measuring the goodness of a which is not perfectly periodic, using the average schedule is done based on the ratio of the re- measure as the target function. For example, Bar- quested shares to the granted shares ai =bi : it makes Noy et al. [6] presents an algorithm that produces sense, depending on the target application, to be a schedule whose average measure is at most 9 8 concerned either by the weighted average of these times the best possible. Their algorithm uses the ratios, or by the maximum of these ratios. (We will golden ratio schedule [13], and hence gaps between show that weighted maximum and unweighted consecutive occurrences of a client can have any of average do not make sense.) Formally, for each i, three distinct values (whereas in perfect schedules let qi ¼ ai =bi . Using the qi Õs we deﬁne the perfor- there is exactly one possible value). In [15], Ken- mance measures: yon et al. describe a polynomial approximation scheme for the average measure; their solution is Maximum: MAX ¼ maxfqi j1 6 i 6 ng; not perfectly periodic either. Hameed and Vaidya [19,20] propose, using Weighted Fair Queuing, to X n Weighted average: AVE ¼ ai qi : schedule broadcasts (which results in non-perfectly i¼1 periodic schedules). Ammar and Wong [2,3], consider the problem Unfortunately, ﬁnding an optimal schedule (under of minimizing the average response time in Tele- either the maximum or average measure) is NP- text Systems, which is equivalent to Broadcast A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 157 Disks. They show that the optimal schedule is Zipf distribution [22] under both the MAX and cyclic, and give nearly optimal algorithms for this AVE measures. The Zipf distribution is believed problem. Khanna and Zhou [16] show how to use to be the best distribution to approximate ‘‘real indexing with perfectly periodic scheduling to life’’ frequencies (see e.g., [11]). minimize busy waiting, and they also show how to • Finally, we present experimental results. In get a 3 approximation w.r.t. the average measure. 2 extensive tests that we ran, we have found that Bar-Noy et al. prove in [6] that it is NP-hard to our best algorithm manages to beat even the best ﬁnd the optimal perfectly periodic schedule. known non-periodic algorithm for both distri- Baruah et al. [9] and Anderson et al. [4] give butions. This is interesting, since perfect period- algorithms for fair periodic scheduling. Their icity is not always possible (consider, for algorithms build schedules where at every time t a example, the requests a1 ¼ 1=2 and a2 ¼ 1=3). client with share demand ai , must have been scheduled either dai Á te or bai Á tc times. These We note that to the best of our knowledge, this schedules are not perfectly periodic: gaps between work is the ﬁrst to introduce the MAX criterion for consecutive occurrences of a client can be as high measuring performance of schedules in this or as twice the requested period. Additional papers similar settings. with analysis of the average measure (motivated by Broadcast Disks and related problems) are 1.3. Paper organization [1,8,17]. The machine maintenance problem [5,21] and the chairperson assignment problem [18] are The remainder of the paper is organized as also closely related to periodic scheduling. follows. In Section 2, we formally deﬁne periodic The general notion of perfect periodicity and schedules and the performance measures. In Sec- the tree methodology were introduced in [7]. This tion 3, we present the optimal tree scheduling paper presents algorithms for constructing sched- algorithms. Our heuristic algorithms are described ules that are guaranteed to be close to optimum in Section 4. Experimental results are presented in w.r.t. the average measure, depending on the value Section 5. We conclude in Section 6. of the maximal requested share. 1.2. Our contribution 2. Deﬁnitions and preliminaries In this paper, we study the problem of eﬃ- In this section, we deﬁne basic terms and give ciently constructing good tree schedules. Given a several preliminary results (see Fig. 2 for a sum- set of frequencies requests, our goal is to ﬁnd a tree mary). In Section 2.1, we formally deﬁne sched- schedule that grants these frequencies exactly or ules. Quality measures are deﬁned and discussed in approximately. The quality of a schedule is mea- Section 2.2. Tree scheduling is described in Section sured by either the weighted average or the maxi- 2.3. mum of the ratios between the requested frequency and the allocated frequency for each client. 2.1. Schedules • We ﬁrst give optimal (exponential time) algo- We are given a set of n clients 1; 2; . . . ; n. Each rithms for both measures. Their construction client i requests a share 0 < ai < 1 (of a common is based on a well structured bottom–up ap- resource). We refer to ai as a requested share or a proach and is not straightforward. frequency demand of client i. A frequency demand • Next, based on the structure of the optimal vector is a vector A ¼ ha1 ; a2 ; . . . ; an i, where Pn algorithms, we develop a few eﬃcient (good i¼1 ai ¼ 1. Sometimes we state client demands in polynomial time) heuristic algorithms. These terms of requested periods ai ¼ 1=ai . heuristics perform well on frequencies that are A schedule is an inﬁnite sequence S ¼ s0 ; s1 ; . . ., produced by the uniform distribution and the where Sj 2 f1; 2; . . . ; ng for all j. A schedule is 158 A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 Fig. 2. Glossary of notations. cyclic if it is an inﬁnite concatenation of a ﬁnite Intuitively, the ‘‘best’’ (or ‘‘fairest’’) perfect sequence C ¼ hs0 ; s1 ; . . . ; sjCjÀ1 i. C is a cycle of S. A schedule should be the one that provides each schedule is perfectly periodic (or just perfect for client exactly with its demand, i.e., bi ¼ ai for all i. short) if slots allocated to each client are equally In this case we get that MAX ¼ AVE ¼ 1. The spaced, i.e. for each client i there exist non-nega- following lemmas show that this is indeed the best tive integers bi ; oi 2 Zþ called the period and oﬀset possible for the MAX and the AVE measures. of i, respectively, such that i is scheduled in slot j if and only if j oi (mod bi ). Note that perfectly Lemma 2.1. For all frequency vectors A,B, we periodic schedules are cyclic. The frequency bi of a have that MAXA;B P 1. client i in a perfect schedule is the reciprocal of its P P period, i.e., bi ¼ 1=bi . We refer to bi as the granted Proof. Since 1 6 i 6 n ai ¼ 1 6 i 6 n bi ¼ 1, it follows share and to bi as the granted period for client i. from the pigeon hole principle that it cannot be the case that bi > ai for all 1 6 i 6 n. Thus, there exists 2.2. Measures an index j such that aj P bj . As a result we get that MAXA;B P 1. h Given a frequency demand vector A and a granted frequency vector B we consider for each Lemma 2.2. For all frequency vectors A,B, we client the ratio of the requested shares ai , to the have that AVEA;B P 1. granted shares bi : qi ¼ ai =bi . Using qi Õs we deﬁne the following measures: Proof. Let A ¼ ha1 ; a2 ; . . . ; an i be the frequency MAXA;B ¼ maxfqi j1 6 i 6 ng vector and let B ¼ hb1 ; b2 ; . . . ; bn i be a vector such P ai that P i 6 n bi ¼ 1. 16 We show that ¼ max j1 6 i 6 n AVEA;B ¼ 1 6 i 6 n a2 =bi gets the minimum value i bi when bi ¼ ai for all 1 6 i 6 n. bi For simplicity, we show the proof for n ¼ 2, the ¼ max j1 6 i 6 n ; general case follows similar arguments. For the ai n ¼ 2 case A ¼ ha; 1 À ai and B ¼ hb; 1 À bi. We X X a2 X b view AVE as a function on b: i i AVEA;B ¼ qi ai ¼ ¼ : 2 aveðbÞ ¼ a2 =b þ ð1 À aÞ =ð1 À bÞ. Diﬀerentiating, 16i6n 16i6n bi 1 6 i 6 n a2 i 2 2 we get that dðaveÞ=db ¼ Àa2 =b2 þ ð1 À aÞ =ð1 À bÞ . We omit subscripts when they are clear by the Solving dðaveÞ=db ¼ 0, we ﬁnd that the minimum context. is obtained when a ¼ b. h A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 159 Table 1 Schedule ðb1 ; q1 Þ ðb2 ; q2 Þ ðb3 ; q3 Þ MAX AVE RR (3,3/2) (3,1) (3,1/2) 3/2 7/6 C (2,1) (4,4/3) (4,2/3) 4/3 19/18 For both MAX and AVE, the closer to 1 the 1 X ai U AVEA;B ¼ : measure is, the more satisﬁed clientsÕ share de- n 1 6 i 6 n bi mands are. Therefore, our goal is to ﬁnd schedules minimizing performance measures. We say that a measure ‘‘makes sense’’ if granting the clients with their requested shares Example 1. Let a1 ¼ 1=2, a2 ¼ 1=3, and a3 ¼ 1=6. would yield the best performance. This is because We compare the round-robin schedule in most applications the requested shares were RR ¼ h1; 2; 3i with the only other perfect schedule calculated to yield the best performance or to with three clients C ¼ h1; 2; 1; 3i. Table 1 summa- satisfy fairness issues. It may be surprising, but rizes the performance of the two schedules for the unweighted average and weighted max do not two measures. Table 1 shows that C outperforms make sense in this respect. The point with un- RR in both measures. weighted average is that if many low-weight re- quests get larger shares, they bias the measure Example 2. Let a1 ¼ 1=3, a2 ¼ 1=3, a3 ¼ 1=4, and merely by having many of them, even if their total a4 ¼ 1=12. We compare the following (and only) weight is small. The ﬂip side of this anomaly is four perfect schedules with four clients: weighted average: in this case, the measure sup- RR ¼ C1 ¼ h1; 2; 3; 4i; C2 ¼ h1; 2; 3; 1; 2; 4i; presses the eﬀect of granting a larger share to the heaviest client at the expense of the small clients. C3 ¼ h1; 2; 1; 3; 1; 4i; C4 ¼ h1; 2; 1; 3; 1; 2; 1; 4i: In what follows, we construct instances for which granting the requested shares is not optimal for the Table 2 summarizes the performance of the four above two measures. schedules. The table shows that the round-robin The perfect schedule that gives each client its schedule C1 is the best for the MAX measure, while exact shares yields W MAX ¼ maxfai j1 6 i 6 ng C2 is the best schedule for the AVE measure. and U AVE ¼ 1. Consider the following two fre- quency vectors: 2.2.1. Other performance measures: weighted max and unweighted average 1Àa 1Àa In this paper, we work with unweighted MAX A1 ¼ a; ;...; ; nÀ1 nÀ1 and weighted AVE measures. We show why we do 1 1 1 not consider the other two possible measures. The A2 ¼ ; ;...; : 2 2ðn À 1Þ 2ðn À 1Þ ﬁrst is the weighted MAX: 2 Assume that a ¼ 1=a for an integer a such that ai W MAXA;B ¼ max j1 6 i 6 n : a À 1 divides n À 1. For both vectors there exist bi corresponding schedules for which each client gets The second is the unweighted AVE: its exact share: Table 2 Schedule ðb1 ; q1 Þ ðb2 ; q2 Þ ðb3 ; q3 Þ ðb4 ; q4 Þ MAX AVE C1 (4,4/3) (4,4/3) (4,1) (4,1/3) 4/3 7/6 C2 (3,1) (3,1) (6,3/2) (6,1/2) 3/2 13/12 C3 (2,2/3) (6,2) (6,3/2) (6,1/2) 2 47/36 C4 (2,2/3) (4,4/3) (8,2) (8,2/3) 2 11/9 160 A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 C1 ¼ h1; 2; . . . ; a; 1; a þ 1; . . . ; 2a À 1; . . . ; 1; child of u, and u is the parent of v. The degree of a node in a rooted tree is the number of its children. n À a þ 1; . . . ; n À 1i; A leaf is a node with degree 0. Tree scheduling is a methodology for con- C2 ¼ h1; 2; 1; 3; . . . ; 1; n À 1i: structing perfect schedules that can be represented To show the unnatural eﬀect of W MAX, con- by rooted trees [7]. The basic idea is that each sider A1 as the frequency vector, and let C1 and C2 leaf corresponds to a distinct client, and the period denote the frequency vectors corresponding to C1 of each client is the product of the degree of all and C2 , respectively. We have that W MAXA1 ;C1 ¼ the nodes on the path leading from the root to maxfa; ð1 À aÞ=ðn À 1Þg and W MAXA1 ;C2 ¼ the corresponding leaf. In the example of Fig. 1, the maxf2a2 ; 2ð1 À aÞ2 =ðn À 1Þg. If n > 1 þ ða À 1Þ2 period of A is 2 because the root degree is 2, and the then 2a2 > 2ð1 À aÞ2 =ðn À 1Þ and a > ð1 À aÞ= periods of B,C and D are 6, because the root degree ðn À 1Þ. For such large values of n we get is 2 and the degree of their parent is 3. We refer to a W MAXA1 ;C1 ¼ a and W MAXA1 ;C2 ¼ 2a2 . Under tree that represents a schedule as a scheduling tree. the W MAX measure, for a < 1=2, C2 is better than Given a scheduling tree, one can build a corre- C1 that meets exactly the demands of all clients! sponding schedule in several ways. One possible Moreover, the ratio of the performance of the way to construct a schedule is to explicitly compute schedules is a=ð2a2 Þ ¼ a=2, which can be arbi- oﬀsets of clients from the tree [7]. Another way is to trarily large (by selecting n large enough such that use a tree directly. One can build a full listing of a À 1 divides n À 1). Note that in order to achieve schedule cycle from the tree as follows. We con- a better performance for W MAX, the schedule struct a schedule cycle recursively: Each leaf of the might prefer the ﬁrst client as is the case with C2 . scheduling tree corresponds to a schedule cycle of To show the unnatural eﬀect of U AVE, con- length 1 consisting of its client. To construct a sider A2 as the frequency vector. We have that schedule cycle of an internal node, schedules of its U AVEA2 ;C2 ¼ 1 children are brought to the same size by replica- tion, and then the resulting schedules are inter- and leaved in the round-robin manner. Finally, the 1 1 nÀ1 schedule cycle associated with the root is the output U AVEA2 ;C1 ¼ þ : n 2a 2ð1 À aÞ of the algorithm. In the example of Fig. 1, the Plugging in the value of a ¼ 1=a, we get schedule associated with the parent of B, C, and D is hBCDi. The ﬁnal schedule hABACADi is obtained an þ a2 À 2a U AVEA2 ;C1 ¼ : by interleaving the two schedules hAAAi and 2ða À 1Þn hBCDi. More details on usage of scheduling trees We choose a large value for a and then a larger can be found in [12]. We summarize basic proper- value for n to get that U AVEA2 ;C1 ¼ 1 þ Oð1Þ. ties of scheduling trees in the following lemma: 2 Thus, for the U AVE measure, C1 performs almost twice better than the natural schedule C2 that Theorem 2.3 (Bar-Noy et al. [7, Theorem 3.1]). Let meets exactly the demands of all clients. Note that T be a scheduling tree with n leaves labeled 1; . . . ; n, in order to achieve a better performance for where leaf i corresponds to client i. Then there exists U AVE, the schedule might give the ﬁrst client less a perfect schedule for clients 1; . . . ; n; the period of slots as is the case with C1 . each client i in the schedule is the product of the degrees of all ancestors of i in T . 2.3. Scheduling trees A tree is a connected acyclic graph. A rooted 3. Optimal tree scheduling tree is a tree with one node designated as the root. We assume that all edges are directed away from In this section, we describe optimal (exponential the root. If ðu; vÞ is a directed edge, then v is the time) algorithms that construct scheduling trees, A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 161 for both the MAX and the AVE measures. Since the ai 6 aj but bi > bj . Let S 0 be the schedule S in algorithms for MAX and AVE are nearly identical, which the clients i and j are switched: S 0 grants we describe MAX in detail and only point out the client i period bj and grants client j period bi . Let diﬀerences for AVE. T 0 be the scheduling tree that is associated with the Our optimal algorithms use the bottom–up ap- schedule S 0 . Note that T 0 is the tree T in which proach, in the sense that they combine a set of clients i and j switch leaves. By Lemma 3.1, the leaves into a single node and then continue cost of S 0 is at most the cost of S for both mea- recursively. This approach is similar to the con- sures. Therefore, T 0 is also an optimal scheduling struction of Huﬀman codes [14]. tree. We proceed with these switches to get an The optimal algorithms are based on the optimal scheduling tree T 00 for which bi 6 bj for all observation that for both MAX and AVE measures, pairs of clients 1 6 i; j 6 n such that ai 6 aj . h it is always better to give more time slots in the schedule for clients whose requested shares are The above corollary implies that there exists an larger. This means that there exists an optimal tree optimal scheduling tree that preserves the non- where the smallest share in the schedule belongs to increasing order of the requested shares. We use the client with the smallest share demand. To prove this to prove the following key theorem that is this idea, we need the following algebraic lemma. valid for both MAX and AVE measures. This the- orem serves as the ﬁrst step in constructing the Lemma 3.1. For a1 6 a2 and b1 6 b2 , bottom–up optimal algorithms. 1. max fb2 =a1 ; b1 =a2 g P max fb1 =a1 ; b2 =a2 g, Theorem 3.3. For each frequency demand vector A, 2. b2 =a2 þ b1 =a2 P b1 =a2 þ b2 =a2 . there exists an optimal scheduling tree T , an integer 1 2 1 2 2 6 k 6 n, and a node q with k children such that the Proof children of q in T are the clients with the smallest k 1. a1 6 a2 implies that b2 =a1 P b2 =a2 and b1 6 b2 requested shares. implies that b2 =a1 P b1 =a1 . Hence, b2 =a1 P max fb1 =a1 ; b2 =a2 g, and therefore, max fb2 =a1 ; Proof. First, note that by deﬁnition siblings leaves b1 =a2 g P max fb1 =a1 ; b2 =a2 g. have the same granted share. Second, note that if a 2. a1 6 a2 and b1 6 b2 imply that ðb2 À b1 Þða2 À leaf has an internal node as a sibling than all of the 2 a2 Þ P 0. Hence, b2 a2 þ b1 a2 P b1 a2 þ b2 a2 and leaves in the subtree rooted at this node are granted 1 2 1 2 1 therefore b2 =a2 þ b1 =a2 P b1 =a2 þ b2 =a2 . h a smaller share. Therefore, in any tree there exists 1 2 1 2 at least one node q that has k P 2 children all of We say that a scheduling tree is optimal for a them leaves whose granted shares are the smallest given frequency request vector if its corresponding in the tree. By Corollary 3.2, there exists an optimal schedule achieves the best performance achievable tree in which these k leaves are associated with the by schedules that can be represented as trees. The smallest k requested shares. h following corollary states a property of some opti- mal trees. Our optimal tree algorithms rely on Theorem 3.3. The idea is to coalesce k clients with the Corollary 3.2. Let fa1 6 Á Á Á 6 an g be the requested smallest share demands into a new client, and then periods. Then, for both the MAX and the AVE solve the new problem recursively. measures, there exists an optimal scheduling tree whose corresponding granted periods preserve the 3.1. The optMax algorithm non-decreasing order, i.e., b1 6 Á Á Á 6 bn . We ﬁrst explain the optimal algorithm for the Proof. Let S be any optimal tree schedule associ- MAX measure. The algorithm loops through all ated with the optimal scheduling tree T . Assume values of k, and for each value, it coalesces the k that in S there exist two clients 1 6 i; j 6 n such that smallest clients, and solves the new set recursively. 162 A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 Fig. 3. An optimal algorithm for the MAX measure. For the AVE measure, replace the line marked by H with Eq. (2). ( ) The best k is chosen. Pseudo code is presented in aq akþ1 an 0 0 Fig. 3. valðA ;T Þ ¼ max 0 ; 0 ;...; 0 bq bkþ1 bn The crux of the algorithm is the weight a0k that is ( ) assigned to a new client that replaces k old clients k Á maxfa1 ;...;ak g akþ1 an with the smallest share demands ¼ max ; 0 ;...; 0 b0q bkþ1 bn a0k ¼ k Á maxfaja 2 Mk g: ð1Þ ( ) a1 ak akþ1 an To explain this choice, we ﬁrst make the fol- ¼ max 0 ;...; 0 ; 0 ;...; 0 bq =k bq =k bkþ1 bn lowing deﬁnition. Let A ¼ ha1 ; a2 ; . . . ; an i be a vector of frequencies. We do not require that a1 ak akþ1 an Pn ¼ max ;...; ; ;...; i¼1 ai ¼ 1. Let T be a tree with n leaves and b1 bk bkþ1 bn granted frequency vector BðT Þ ¼ hb1 ; . . . ; bn i. ¼ valðA;T Þ: Ã Then we deﬁne We say that an algorithm ﬁnds an optimal tree a1 an valðA; T Þ ¼ max ;...; : T Ã for n clients with a frequency request vector A b1 bn if for any tree T with n leaves We now prove that when optMax coalesces valðA; T Ã Þ 6 valðA; T Þ. The next lemma justiﬁes several clients, val is preserved. the recursive step of the optMax algorithm. We use the following notation. For a vector Lemma 3.4. Let T be a tree with leaves 1; . . . ; n; A ¼ ha1 6 a2 6 Á Á Á 6 an i of frequencies whose sum where clients 1; . . . ; k are siblings with parent q. Let is not necessarily 1, we denote A ¼ ha1 ; . . . ; an i be the frequency requests of the A0 ðkÞ ¼ ha0k ; akþ1 ; . . . ; an i for 1 < k 6 n; clients of T . Let T 0 be the tree generated from T by replacing clients 1; . . . ; k with q, and let A0 be the where a0k ¼ k Á maxfa1 ; . . . ; ak g: frequency request vector resulting from A by replacing a1 ; . . . ; ak with aq ¼ k Á maxfa1 ; . . . ; ak g. Lemma 3.5. Let A be a frequency demand vector, Then valðA; T Þ ¼ valðA0 ; T 0 Þ. and let T 0 ðkÞ be an optimal tree for A0 ðkÞ. Let T ðkÞ be a tree generated from T 0 ðkÞ by adding k clients Proof. Let B ¼ hb1 ; . . . ; bn i and B0 ¼ hb0q ; b0kþ1 ; . . . ; with frequency demands a1 ; . . . ; ak as children of the b0n i be granted frequency vectors implied by T and node with frequency demand a0k . Let k Ã be such that T 0 , respectively. By deﬁnition, bi ¼ b0i for k þ 1 6 valðA0 ðkÞ; T 0 ðkÞÞ is minimized. Then T ðk Ã Þ is an i 6 n and b1 ¼ b2 ¼ Á Á Á ¼ bk ¼ b0q =k. Hence, optimal tree for A w.r.t. the MAX measure. A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 163 Proof. Let T Ã denote T ðk Ã Þ. Assume that T Ã is not computation of the new client share demand. In optimal for A and let R be an optimal tree for A, optAve, coalescing k clients with share demands i.e., valðA; T Ã Þ > valðA; RÞ. By Theorem 3.3, with- ða1 ; . . . ; ak Þ produces the new client with the share out loss of generality, there exists 2 6 m 6 n such demand that m clients with the smallest frequency demands qﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃ are siblings in R. Let R0 be the tree generated from R a0k ¼ kða2 þ Á Á Á þ a2 Þ: ð2Þ 1 k by coalescing these m clients. Note that R0 corre- sponds to the frequency demand vector A0 ðmÞ. (In the pseudo code of Fig. 3, the equation Since coalescing clients does not change the value above replaces the line marked by H.) of the val function by Lemma 3.4, we get For the AVE measure, we deﬁne valðA0 ðmÞ; R0 Þ ¼ valðA; RÞ < valðA; T Ã Þ valðA; T Þ ¼ a2 =b1 þ Á Á Á þ a2 =bn . The following 1 n ¼ valðA0 ðk Ã Þ; T 0 ðk Ã ÞÞ lemma shows that when optAve coalesces several 6 valðA0 ðmÞ; T 0 ðmÞÞ: clients, val is preserved. Hence, valðA0 ðmÞ; R0 Þ < valðA0 ðmÞ; T 0 ðmÞÞ, con- tradicting the assumption that T 0 ðmÞ is optimal Lemma 3.7. Let T be a tree with leaves 1; . . . ; n, tree for A0 ðmÞ. h where clients 1; . . . ; k are siblings with parent q. Let A ¼ ha1 ; . . . ; an i be the frequency requests of the Theorem 3.6 summarizes the correctness and clients of T . Let T 0 be the tree generated from T by optimality of Algorithm optMax. replacing clients 1; . . . ; k with q, and let A0 be the frequency request vector resulting from A by pﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃ Theorem 3.6. Algorithm optMax finds the optimal replacing a1 ; . . . ; ak with aq ¼ kða2 þ Á Á Á þ a2 Þ: 1 k tree w.r.t. the MAX measure in time Oð2n Þ. Then valðA; T Þ ¼ valðA0 ; T 0 Þ. Proof. We ﬁrst prove optimality by induction on n. Proof. Let B ¼ hb1 ; . . . ; bn i and B0 ¼ For n ¼ 1 the claim is trivial. For the inductive 0 0 0 hbc ; bkþ1 ; . . . ; bn i be granted frequency vectors im- step, we have that by Lemma 3.5, optMax ﬁnds the plied by T and T 0 , respectively. Obviously, bi ¼ b0i tree T that minimizes valðA; T Þ. Since for k þ 1 6 i 6 n and b1 ¼ b2 ¼ Á Á Á ¼ bk ¼ b0c =k. valðA; T Þ ¼ MAXA;BðT Þ , we conclude that optMax Hence, ﬁnds the optimal tree. As for the running time, let T ðnÞ denote the running time of optMax for n cli- a2 a2 a2 valðA0 ; T 0 Þ ¼ c þ kþ1 þ Á Á Á þ n ents. Clearly, we have that the time is given by the b0c b0kþ1 b0n recursive relation T ð1Þ ¼ Oð1Þ and kða2 þ Á Á Á þ a2 Þ a2 a2 X nÀ1 ¼ 1 k þ kþ1 þ Á Á Á þ n T ðnÞ ¼ T ðiÞ þ Oðn2 Þ; b0c b0kþ1 b0n i¼1 a2 a2 a2 a2 whose solution is T ðnÞ ¼ Oð2n Þ. h ¼ 1 0 =k þ Á Á Á þ 0 k þ kþ1 þ Á Á Á þ n 0 bc bc =k bkþ1 b0n We remark that there exists a more eﬃcient a2 a2 a2 a2 ¼ 1 þ Á Á Á þ k þ kþ1 þ Á Á Á þ n implementation of the optMax algorithm that b1 bk bkþ1 bn performs at each recursion step OðnÞ operations ¼ valðA; T Þ: Ã rather than Oðn2 Þ, but this solution improves the asymptotic time complexity only by a constant factor. Details are omitted. Theorem 3.8. Algorithm optAve finds the optimal 3.2. The optAve algorithm tree w.r.t. the AVE measure in Oð2n Þ time. Algorithm optAve for the AVE measure is The proof is identical to the proof of Theorem identical to the optMax algorithm, except for the 3.6, and it is therefore omitted. 164 A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 4. Heuristics 4.1. The bin algorithms In this section, we describe various ways to re- The binMax algorithms ﬁnd the best binary tree duce the running time of the optimal algorithms by for the given frequencies request vector by coa- restricting their exhaustive search. At each recur- lescing at each stage two leaves with minimal re- sive step, our algorithms coalesce k clients with the quests. Pseudo code appears in Fig. 5. As is the smallest share demands and continue recursively. case with the optimal algorithms, the binAve The optimal algorithms try each 2 6 k 6 n, result- algorithm is identical to binMax except for the ing in exponential running time. To save time, computation of the share demand of the new we examine only some restricted subsets of values client. for k. The following lemma analyzes the running time We now list all of our heuristics. We use the of both binMax and binAve. following convention in naming algorithms: the suﬃxes Ave and Max denote the measure targeted Lemma 4.1. The running time of the bin algorithms by the algorithm. for n clients is Oðn log nÞ. bin: The bin algorithm performs recursive calls for k ¼ 2 only, i.e., it generates the best possible Proof. We use a heap for storing frequencies. The binary trees. procedure of building a heap from the original rr: It turns out that the bin algorithms perform frequencies array costs OðnÞ. At each step we badly especially when all remaining clients have perform two delete-min operations and one insert similar demands, and this gave rise to the follow- operation, i.e., Oðlog nÞ operations. Therefore, the ing algorithm: at each step, the algorithm tries running time T ðnÞ is deﬁned by T ð1Þ ¼ Oð1Þ and both the recursive call, and the round-robin option T ðnÞ ¼ T ðn À 1Þ þ Oðlog nÞ. The solution of this (which will ﬁnalize the tree). We add the rr-preﬁx recursive equation is T ðnÞ ¼ Oðn log nÞ. h to names of these algorithms. binMixed: In the recursive step where ‘ clients It is not diﬃcult to show that the binMax are considered, binMixed recursively calls the bin algorithm guarantees an approximation ratio of at algorithm if ‘ > logðn log nÞ, and otherwise it calls most 2; we omit the details (see [12]). We remark the optimal algorithm. that it is known [7] that some binary tree schedules pseudoOpt: The idea in pseudoOpt is to check, have approximation ratio of at most 4 þ 2 maxfai g 3 3 at each step, what is the best k according to some for the AVE measure. Since binAve produces the heuristic. Speciﬁcally, pseudoOpt tests the k best possible binary tree schedule, it follows that smallest elements for all k, by coalescing them and its approximation ratio is never worse than 4 applying rrBinMixed. The best k is chosen, the 3 þ 2 maxfai g. Simulations show that practically, 3 corresponding clients are coalesced, and the pro- the performance of the algorithm is much better. cess continues. Note that our other heuristics for both measures The hierarchy among the algorithms is de- outperform bin, and hence their approximation scribed in Fig. 4. In the following subsections, we ratio is also at most 2 for the MAX measure and at study these algorithms in more detail. most 4 þ 4 maxfai g for the AVE measure. 3 3 4.2. The rrBin algorithms The rrBin algorithms choose at each step the best solution among the recursive solution and the round-robin solution. Clearly, the rrBin heuristics Fig. 4. The hierarchy among heuristic algorithms. An algo- outperform the bin heuristics. Pseudo code for rithm to the left of another looks at more trees and runs longer rrBinMax is presented in Fig. 6; the code for time. rrBinAve is nearly identical. A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 165 Fig. 5. binMax algorithm. Fig. 6. rrBinMax algorithm. 166 A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 Fig. 7. binMixedMax algorithm. ıve A na€ implementation of these algorithms ine also the best binary tree as a possible solution, calculates the performance of the round-robin and therefore, outperform the bin algorithms. We schedule at each step by looking at all elements present the pseudo code for the binMixedMax of A, thus performing OðnÞ computations at procedure in Fig. 7. The binMixedAve algorithm is each step. We employ a more eﬃcient imple- identical to binMixedMax except for a computation mentation, that calculates the performance of of a share demand of a new client. The analysis of the round-robin schedule in the current step both binMixed algorithms appears in the next using its value in the previous step in constant lemma. time. Since the overhead of the round-robin extension is only constant at each step, the total Lemma 4.3. The running time of the binMixed running time remains asymptotically the same as algorithms is Oðn log nÞ. in the bin algorithms, namely Oðn log nÞ. Thus, Proof. TbinMixed ðnÞ 6 OðTbin ðnÞ þ Topt ðlogðn log nÞÞÞ ¼ we have Oðn log n þ 2logðn log nÞ Þ ¼ Oðn log nÞ. h Lemma 4.2. The running time of the rrBin algo- 4.4. The rrBinMixed algorithms rithms for n clients is Oðn log nÞ. The rrBinMixed algorithms are the round-robin 4.3. The binMixed algorithms extension of the binMixed algorithms. At each step they try both the round-robin solution and the The main idea of the binMixed algorithms is as recursive call, and then choose the better solution. follows. In the recursive step where ‘ clients are We omit the pseudo codes of rrBinMixed for both considered, recursively call the bin algorithms if measures, since they result from a straightforward ‘ > logðn log nÞ, otherwise call the optimal algo- merging of the pseudo codes of rrBin and rithms. Note that, the binMixed algorithms exam- binMixed. A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 167 Fig. 8. pseudoOptMax algorithm. We note that the result achieved by the main idea of the pseudoOpt algorithms is to sim- rrBinMixed algorithms on an input fai g is the ulate recursive calls in the optimal algorithms by minimum of the results of rrBin and binMixed. It calls to rrBinMixed, thus saving on the running follows from the following observation: time. Clearly, the pseudoOpt algorithms outper- form the rrBinMixed algorithms, since among • if the rrBinMixed algorithms choose the round- others they examine all the trees examined by robin solution at the ﬁrst stage of the algorithm the rrBinMixed algorithms. Pseudo code of (a recursive call of the binary algorithm), their pseudoOptMax is given in Fig. 8; the pseudo code performance is equal to the performance of of the pseudoOptAve algorithm is very similar to the rrBin algorithm. pseudoOptMax. The running time of pseudoOpt is • if the rrBinMixed algorithms never choose the Oðn3 log nÞ for both measures, since at each step round-robin solution at the ﬁrst stage of the the algorithm call up to n times the rrBinMixed algorithm, their performance is equal to the per- algorithms, which run in Oðn log nÞ time. formance of the binMixed algorithms. Lemma 4.5. The running time of the pseudoOpt The running time of the rrBinMixed algorithms is algorithms for n clients is Oðn3 log nÞ. the same as the running time of the binMixed algo- rithms following the same reasoning that showed that the running time of the rrBin algorithms is the 5. Simulations same as the running time of the bin algorithms. We study the performance of our heuristics for Lemma 4.4. The running time of the rrBinMixed two distributions of share demands: the Zipf dis- algorithms for n clients is Oðn log nÞ. tribution [11,22] and the uniform distribution, under both the MAX and AVE measures. 4.5. The pseudoOpt algorithms • The Zipf distribution. This distribution depends The optimal algorithms choose the number of on a skew coeﬃcient h. The value of the share of clients to be coalesced by a recursive call. The the ith client is proportional to iÀh . That is, 168 A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 h ð1=iÞ the AVE measures. Quantitatively, the algorithms ai ðhÞ ¼ Pn h : get better results for AVE. For small numbers of j¼1 ð1=jÞ clients, we compared our algorithms to the optimal We use h ¼ 0:8 in our simulations [11]. algorithm (Figs. 9 and 10). For large numbers of • The uniform distribution. Each client randomly clients, we present in Figs. 11 and 12 the perfor- chooses an ‘‘absolute’’ share demand a0i , which mance achieved by our algorithms, noting that for is later normalized. Formally, a0i $ U ð0; 1Þ and Pn both measures, the best possible performance of ai ¼ a0i = j¼1 a0j . We repeat each experiment any perfect schedule is 1 by Lemmas 2.1 and 2.2. for the uniform distribution 10 times, and then Our empirical results follow the hierarchy of the average results. heuristic algorithms (Fig. 4) for both distributions considered. The weakest results are due to the bin In general, we found that the relative quality of algorithms (about 1.45 for MAX and 1.04 for the the algorithms is the same for both the uniform AVE). While the rrBin algorithms perform only and the Zipf distributions, for both the MAX and slightly better than bin, the binMixed algorithms Algorithms for the MAX measure (Zipf distribution) Algorithms for the MAX measure (Uniform distribution) 1.6 1.6 binMax/OptMax binMax/OptMax binMixedMax/OptMax binMixedMax/OptMax 1.5 rrBinMax/OptMax 1.5 rrBinMax/OptMax rrBinMixedMax/OptMax rrBinMixedMax/OptMax pseudoOptMax/OptMax pseudoOptMax/OptMax 1.4 1.4 Alg. result Alg. result 1.3 1.3 1.2 1.2 1.1 1.1 1 1 0 5 10 15 20 25 30 0 5 10 15 20 25 Number of clients Number of clients Fig. 9. The performance of algorithms for small number of clients for the MAX measure. Algorithms for the AVE measure (Zipf distribution) Algorithms for the AVE measure (Uniform distribution) 1.1 binAve/OptAve binAve/OptAve binMixedAve/OptAve binMixedAve/OptAve rrBinAve/OptAve 1.08 rrBinAve/OptAve 1.08 rrBinMixedAve/OptAve rrBinMixedAve/OptAve pseudoOptAve/OptAve pseudoOptAve/OptAve 1.06 Alg. result Alg. result 1.06 1.04 1.04 1.02 1.02 1 1 0 5 10 15 20 25 30 0 5 10 15 20 25 Number of clients Number of clients Fig. 10. The performance of algorithms for small number of clients for the AVE measure. A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 169 Algorithms for the MAX measure (Zipf distribution) Algorithms for the MAX measure (Uniform distribution) binMax binMax 1.7 binMixedMax 1.7 binMixedMax rrBinMax rrBinMax rrBinMixedMax rrBinMixedMax 1.6 pseudoOptMax 1.6 pseudoOptMax Alg. result Alg. result 1.5 1.5 1.4 1.4 1.3 1.3 1.2 1.2 1.1 1.1 50 100 150 200 50 100 150 200 Number of clients Number of clients Fig. 11. The performance of algorithms for large number of clients for the MAX measure. Algorithms for the AVE measure (Zipf distribution) Algorithms for the AVE measure (Uniform distribution) 1.1 binAve 1.1 binAve binMixedAve binMixedAve rrBinAve rrBinAve 1.08 rrBinMixedAve 1.08 rrBinMixedAve pseudoOptAve pseudoOptAve Alg. result Alg. result 1.06 1.06 1.04 1.04 1.02 1.02 1 1 50 100 150 200 50 100 150 200 Number of clients Number of clients Fig. 12. The performance of algorithms for large number of clients for the AVE measure. provide a signiﬁcant improvement. The pseudoOpt Recall that in Section 4.4 we argued that the algorithms improve on the results of the rrBinMixed algorithms achieve the minimum be- rrBinMixed algorithms as expected. To conclude, tween the rrBin and the binMixed algorithms. In this for both distributions, our best heuristic scheme section, the binMixed algorithms demonstrate in our produces schedules which are about 0.5% over the experiments much better performance than the optimum for the AVE measure and about 15% rrBin algorithms. This observation explains why the over the optimum for the MAX measure. graphs of rrBinMixed and binMixed almost coincide. All algorithms behave similarly for both the It can be seen that for the uniform distribution, Zipf and the uniform distributions of share de- when very small number of clients is considered, the mands. Changing the h parameter of the Zipf graphs of rrBinMixed and binMixed are very close to distribution does not change the performance each other, but do not coincide completely (see signiﬁcantly, as can be seen in Fig. 13. Figs. 9 and 10). Each point on the graph for the 170 A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 Algorithms for the MAX measure (Zipf distribution, 100 clients) Algorithms for the AVE measure (Zipf distribution, 100 clients) 1.18 binMax binAve rrBinMixedMax 1.16 rrBinMixedAve 1.7 pseudoOptMax pseudoOptAve 1.14 1.6 1.12 1.5 Alg. result Alg. result 1.1 1.4 1.08 1.3 1.06 1.2 1.04 1.02 1.1 1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Theta Theta Fig. 13. The performance of algorithms for diﬀerent values if h in Zipf distribution. uniform distribution is a result of 10 independent clients in order to choose one to schedule, i.e., XðnÞ experiments. If for some n, rrBin is better than operations. In addition, non-trivial computations binMixed in at least one experiment, and, hence, for need to be carried out. Therefore, in many cases this particular experiment rrBinMixed achieves one computes the schedule up to some point, and better result than binMixed, the overall average repeats it [8]. We use the same approach in order result of 10 experiments achieved by rrBinMixed is to be able to measure the performance of the better as well. Thus, for such values of n, rrBinMixed greedy heuristics. We found that the best perfor- is slightly better than binMixed. mance is achieved by greedy when the schedule length is about 100n. Following empirical obser- 5.1. Performance for the broadcast disks problem vation of [8] that the performance of greedy as a function of the schedule length performs oscilla- The Broadcast Disks problem [1] can be viewed tions with period n, we chose the schedule length as a relaxation of the AVE measure, in the sense that to be the best point in the interval [100n, 101n]. We the schedule needs not be perfectly periodic. In this assume that the demand probability of pages fol- case, a bi value represents only the average fre- lows the Zipf distribution. It is known that the quency for client i. The best known results for the optimal schedule for the Broadcast Disks problem, Broadcast Disks problem, from simulations point if exists, is a perfect schedule in which page i is pﬃﬃﬃﬃ P pﬃﬃﬃﬃ of view, are based on some variations of a greedy granted the share qi ¼ pi = n i¼1 pi . Hence, we heuristic (e.g., [6,19]). The idea in the greedy algo- build a perfect broadcast schedule by calling our rithms is to compute, every time slot, for each client algorithms with the frequency request vector i, what would be the ‘‘cost’’ of the schedule in case i A ¼ hq1 ; . . . ; qn i. Then we compare a ratio be- is now scheduled, where cost is computed according tween the average waiting time achieved by perfect the AVE measure. The client that minimizes the cost schedules to the one achieved by the greedy algo- increase is scheduled. Note that the greedy algo- rithm. It can be seen in Fig. 14, that our algorithms rithm requires knowledge of the demand vector, or perform very well compared to greedy and even else the cost cannot be computed. In the next par- give better results for some database sizes. agraph we explain how we compare the output of We note that for the Zipf distribution, many the greedy heuristics with our heuristics. studies demonstrated that greedy is very close to The greedy algorithms, in general, produce non- optimal. In most of the cases, greedy does not cyclic schedules. In each time slot, they scan all the produce a perfect schedule. Our results show that A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 171 Perfectly periodic schedules vs. greedy schedule 1.01 rrBinMixedAve/greedy 1.008 pseudoOptAve/greedy 1.006 ratio: alg/greedy 1.004 1.002 1 0.998 0.996 0.994 0 50 100 150 200 250 300 Database size Fig. 14. The performance of our algorithms vs. greedy heuristic algorithm for Broadcast Disks problem. The heuristics are better than greedy whenever their graph is below 1. we can approach optimality with perfectly periodic schedules as well. 5.2. Performance for perfectly periodic schedules without a tree representation In this paper we considered perfectly periodic Fig. 15. The performance of pseudoOptAve and pseudoOptMax schedules that have a tree representation. In [7] it on instances that have a perfect schedule but do not have a tree was demonstrated that there are perfect schedules representation. that have no tree representation. In this section, we evaluate the performance of our algorithms with such instances. can be scheduled optimally (there is no known Consider the following parametric instances. algorithm for ﬁnding such schedules in general). In Let p, q, r be three distinct prime numbers. The Fig. 15, we present the results for four such in- requested shares are either 1=pq, 1=pr, 1=qr, or stances. For each instance, the number of clients 1=pqr. It is straightforward to construct demand and the performance of pseudoOptAve and vectors that can be satisﬁed optimally, i.e., each pseudoOptMax are given. By construction, there client gets precisely its requested share. However, are perfect schedules for these instances with value there cannot be any tree representation for clients of 1 for both the MAX and the AVE measures. The with periods pq, pr, and qr: this follows from the table demonstrates that the performance penalty observation that the degree of the root of the tree for tree schedules is not very large. must divide all periods, and the greatest common divisor of these periods is 1. More concretely, let p ¼ 2, q ¼ 3, and r ¼ 5. We have constructed a few examples where some 6. Discussion and open problems clients have requested periods 6, 10 and 15, and remaining ones have period of 30. The requests In this paper, we studied a scheduling trees were manually constructed so that each instance design problem. We considered the problem of 172 A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 constructing good scheduling trees and described a to maintain than perfect schedule, but on the bottom–up structure exponential time algorithms other hand they might yield better performance. to ﬁnd the optimal scheduling trees for both the MAX and the AVE measures. Then we proposed Acknowledgements several eﬃcient polynomial-time heuristic algo- rithms based on the structure of the optimal We thank the anonymous referees for their algorithms. We tested our solutions by simulation. useful suggestions. We concluded that for the Zipf and the Uniform frequency distributions, our approximation algo- rithms perform very well sometimes even beating References the best known non-perfectly periodic scheduling algorithms. [1] S. Acharya, R. Alonso, M. Franklin, S. Zdonik, Broadcast disks: data management for asymmetric communications 6.1. Open problems and further research environments, in: Proc. 1995 ACM SIGMOD, 1995, pp. 199–210. [2] M.H. Ammar, J.W. Wong, The design of teletext broad- • We studied the average and maximum measures cast cycles, Performance Evaluation 5 (4) (1985) 235– for periodic schedules. It seems interesting to 242. study other measures that arise in practice. [3] M.H. Ammar, J.W. Wong, On the optimality of cyclic For example, the AVE measure ‘‘rewards’’ the transmission in teletext systems, IEEE Transactions on Communication COM-35 (1) (1987) 68–73. system for clients who receive more than their [4] J. Anderson, A. Srinivasan, A new look at pfair priorities, requested share. In some applications, no re- 1999. Available from <http://www.cs.unc.edu/~anands/ ward is given in such case. Intuitively, this papers.html>. means ‘‘free upgrades,’’ i.e., only clients whose [5] S. Anily, C.A. Glass, R. Hassin, The scheduling of granted share is strictly less than the requested maintenance service, Discrete Applied Mathematics 80 (1998) 27–42. one inﬂuence the performance measure. [6] A. Bar-Noy, R. Bhatia, J. Naor, B. Schieber, Minimizing • We showed that in a way the unweighted aver- service and operation cost of periodic scheduling, in: Proc. age measure does not make sense. One could 9th SODA, 1998, pp. 11–20. think of a given weight (priority) vector, where [7] A. Bar-Noy, A. Nisgav, B. Patt-Shamir, Nearly optimal averaging is done according to this vector. In perfectly periodic schedules, in: Proc. 20th PODC, 2001, pp. 107–116. this case, it is acceptable not to grant clients [8] A. Bar-Noy, B. Patt-Shamir, I. Ziper, Broadcast disks with their requests share if they have low priorities. polynomial cost functions, in: Proc. INFOCOM Õ00, vol. 2, • It is known that deciding whether there exists a IEEE, 2000, pp. 575–584. perfect schedule for given values of shares is [9] S.K. Baruah, N.K. Cohen, C.G. Plaxton, D.A. Varvel, NP-hard [6]. Is it NP-hard to ﬁnd the optimal Proportionate progress: A notion of fairness in resourse allocation, Algorithmica 15 (1996) 600–625. tree? Is it possible to ﬁnd the optimal tree with [10] Bluetooth technical speciﬁcations, version 1.1. Available a polynomial-time algorithm? from <http://www.bluetooth.com/>, February 2001. • There are perfect schedules that have no tree [11] L. Breslau, P. Cao, L. Fan, G. Phillips, S. Shenker, Web representation [7]. Is there a better way to rep- caching and Zipf distributions: evidence and implications, resent, design and use perfect schedules? in: Proc. INFOCOM Õ99, 1999, pp. 126–134. [12] V. Dreizin, Eﬃcient periodic scheduling by trees, MasterÕs • In this paper, we assumed that all the clients re- thesis, Tel Aviv University, 2001. Available from <http:// quire exactly one slot. In a more general prob- www.eng.tau.ac.il/~vld/Th.html>. lem, each client may require to be scheduled [13] M. Hofri, Z. Rosberg, Packet delay under the golden ratio for more than one slot at a time. weighted tdm policy in a multiple-access channel, IEEE • It is interesting to explore ‘‘almost’’ perfect Transactions on Information Theory 11–33 (1987) 341– 349. schedule. For example, schedules in which each [14] D.A. Huﬀman, A method for the construction of minimum client gets two diﬀerent periods that alternate. redundancy codes, in: Proceedings of IRE, vol. 40, 1962, On one hand, they are a bit more complicated pp. 1098–1101. A. Bar-Noy et al. / Computer Networks 45 (2004) 155–173 173 [15] C. Kenyon, N. Schabanel, N. Young, Polynomial-time trical Engineering-Systems department of Tel Aviv University, approximation scheme for data broadcast, in: Proc. 32th Israel. From September 1999 to December 2001 he was with AT&T Research Labs in New Jersey. Since February 2002 he is Ann. ACM Symp. on Theory of Computing, 2000, pp. a Professor with the Computer and Information Science 659–666. Department of Brooklyn College––CUNY, Brooklyn New [16] S. Khanna, S. Zhou, On indexed data broadcast, in: Proc. York. 30th Ann. ACM Symp. on Theory of Computing, New York, 1998, pp. 463–472. Vladimir Dreizin received the B.Sc. [17] C.J. Su, L. Tassiulas, Broadcast scheduling for information degree in Computer Science and Elec- distribution, in: Proc. INFOCOMÕ 97, vol. 1, IEEE, 1997, trical Engineering in 2000, and the M.Sc. degree in Electrical Engineering pp. 109–117. in 2001, from Tel-Aviv University, [18] R. Tijdeman, The chairman assignment problem, Discrete where he is currently working towards Mathematics 32 (1980) 323–330. the Ph.D. degree. He has been soft- [19] N. Vaidya, S. Hameed, Data broadcast: on-line and oﬀ-line ware engineer in Algorithmic Re- search, Israel, from 1998 to 2001. algorithms, Technical Report 96–017, Department of From 1999 to 2001, he worked as a Computer Science, Texas A&M University, 1996. teaching assistant in Tel-Aviv Univer- [20] N. Vaidya, S. Hameed, Log time algorithms for scheduling sity. From 2001, he is with IBM Haifa single and multiple channel data broadcast, in: Proc. Research Labs. MOBICOM Õ97, 1997, pp. 90–99. [21] W. Wei, C. Liu, On a periodic maintenance problem, Boaz Patt-Shamir received his B.Sc. Operations Research Letters 2 (1983) 90–93. from Tel Aviv University in Mathe- matics and Computer Science in 1987, [22] G. Zipf, Human Behaviour and the Principle of Least M.Sc. in Computer Science from the Eﬀort, Addison-Wesley, Reading, MA, 1949. Weizmann Institute in 1989, and Ph.D. in Computer Science from MIT in 1995. He was an assistant professor in Amotz Bar-Noy received the B.Sc. degree in 1981 in Mathe- Northeastern University between 1994 matics and Computer Science and the Ph.D. degree in 1987 in and 1997, and since 1997 he is with the Computer Science, both from the Hebrew University, Israel. Department of Electrical Engineering From October 1987 to September 1989 he was a post-doc fellow in Tel Aviv University, where he di- in Stanford University, California. From October 1989 to Au- rects the Computer Communication gust 1996 he was a Research Staﬀ Member with IBM T.J. and Multimedia Laboratory. In 2002– Watson Research Center, New York. From February 1995 to 2004 he is visiting HP Labs in Cam- September 2001 he was an associate Professor with the Elec- bridge, Mass.