Adaptive general perfectly periodic scheduling

8
Information Processing Letters 98 (2006) 107–114 www.elsevier.com/locate/ipl Adaptive general perfectly periodic scheduling Shailesh Patil , Vijay K. Garg Department of Electrical and Computer Engineering, The University of Texas at Austin, Austin, TX 78712, USA Received 10 November 2004; received in revised form 5 November 2005; accepted 16 December 2005 Available online 20 January 2006 Communicated by P.M.B. Vitányi Abstract We propose an adaptive algorithm Adaptmin to create perfectly periodic schedules. A perfectly periodic schedule schedules a client regularly after a predefined amount of time known as the period of the client. The periodicity of such schedules can be used to save battery life of nodes in a wireless network. The quality of a perfectly periodic schedule is a function of the ratio between the granted and requested periods. We find a worst case performance bound on the quality of schedules produced by Adaptmin. We compare our algorithm to previously proposed algorithm A in [Z. Brakerski, A. Nisgav, B. Patt-Shamir, General perfectly periodic scheduling, in: Proc. 21st Annual Symp. on Principles of Distributed Computing, 2002, pp. 163–172], and show families of input instances where either Adaptmin does no worse than A, or always outperforms A. The better performance of the proposed algorithm is also confirmed by simulations results for randomly generated input instances. Adaptmin produces 25% more efficient schedules as compared to A in our experiments. We also propose a variant of Adaptmin which is computationally much less demanding compared to A, but is very close to Adaptmin in terms of efficiency. Finally, we compare our algorithms to exponential-time optimal scheduling. Our simulation results indicate that the performance of the proposed algorithms is close to that of optimal scheduling. © 2005 Elsevier B.V. All rights reserved. Keywords: Scheduling; Distributed systems; Algorithms; Analysis of algorithms 1. Introduction Power consumption is one of the major challenges faced in the design of portable wireless devices. In an ad-hoc network, multiple portable devices may com- municate with each other for different services. This requires the devices to be awake throughout the session of interaction with another device. One way to reduce power consumption is to schedule devices after a fixed * Corresponding author. E-mail addresses: [email protected] (S. Patil), [email protected] (V.K. Garg). period of time, so that they are awake only when they are being served. Consider a scenario where a device has to serve re- quests from multiple devices. In order to do so, a sched- ule has to be defined that grants access to every request- ing client device. In our setup, for any client i , a request is defined by a tuple (b i i ), where b i is the requested length and τ i is the requested time period. In other words, client i requests to be served for b i consecutive time slots every τ i time slots. Based on the requests, the serving device forms a schedule S . A schedule is said to be perfectly periodic [8] if each client is sched- uled exactly every τ S i time slots, where τ S i is called the 0020-0190/$ – see front matter © 2005 Elsevier B.V. All rights reserved. doi:10.1016/j.ipl.2005.12.009

Transcript of Adaptive general perfectly periodic scheduling

Page 1: Adaptive general perfectly periodic scheduling

Information Processing Letters 98 (2006) 107–114

www.elsevier.com/locate/ipl

Adaptive general perfectly periodic scheduling

Shailesh Patil ∗, Vijay K. Garg

Department of Electrical and Computer Engineering, The University of Texas at Austin, Austin, TX 78712, USA

Received 10 November 2004; received in revised form 5 November 2005; accepted 16 December 2005

Available online 20 January 2006

Communicated by P.M.B. Vitányi

Abstract

We propose an adaptive algorithm Adaptmin to create perfectly periodic schedules. A perfectly periodic schedule schedules aclient regularly after a predefined amount of time known as the period of the client. The periodicity of such schedules can beused to save battery life of nodes in a wireless network. The quality of a perfectly periodic schedule is a function of the ratiobetween the granted and requested periods. We find a worst case performance bound on the quality of schedules produced byAdaptmin. We compare our algorithm to previously proposed algorithm A in [Z. Brakerski, A. Nisgav, B. Patt-Shamir, Generalperfectly periodic scheduling, in: Proc. 21st Annual Symp. on Principles of Distributed Computing, 2002, pp. 163–172], and showfamilies of input instances where either Adaptmin does no worse than A, or always outperforms A. The better performance ofthe proposed algorithm is also confirmed by simulations results for randomly generated input instances. Adaptmin produces 25%more efficient schedules as compared to A in our experiments. We also propose a variant of Adaptmin which is computationallymuch less demanding compared to A, but is very close to Adaptmin in terms of efficiency. Finally, we compare our algorithms toexponential-time optimal scheduling. Our simulation results indicate that the performance of the proposed algorithms is close tothat of optimal scheduling.© 2005 Elsevier B.V. All rights reserved.

Keywords: Scheduling; Distributed systems; Algorithms; Analysis of algorithms

1. Introduction

Power consumption is one of the major challengesfaced in the design of portable wireless devices. In anad-hoc network, multiple portable devices may com-municate with each other for different services. Thisrequires the devices to be awake throughout the sessionof interaction with another device. One way to reducepower consumption is to schedule devices after a fixed

* Corresponding author.E-mail addresses: [email protected] (S. Patil),

[email protected] (V.K. Garg).

0020-0190/$ – see front matter © 2005 Elsevier B.V. All rights reserved.doi:10.1016/j.ipl.2005.12.009

period of time, so that they are awake only when theyare being served.

Consider a scenario where a device has to serve re-quests from multiple devices. In order to do so, a sched-ule has to be defined that grants access to every request-ing client device. In our setup, for any client i, a requestis defined by a tuple (bi, τi), where bi is the requestedlength and τi is the requested time period. In otherwords, client i requests to be served for bi consecutivetime slots every τi time slots. Based on the requests,the serving device forms a schedule S. A schedule issaid to be perfectly periodic [8] if each client is sched-uled exactly every τS time slots, where τS is called the

i i
Page 2: Adaptive general perfectly periodic scheduling

108 S. Patil, V.K. Garg / Information Processing Letters 98 (2006) 107–114

period of client i for schedule S. Note that τSi may be

different from the requested time period τi . In fact forsome set of requests, it is impossible to give the exact re-quested period to all the clients. If τS

i = τi for all i, thenS is called a distortion free schedule. The efficiency ofa schedule is a function of the ratio of τS

i and τi . In thispaper we propose an adaptive algorithm Adaptmin thatproduces efficient perfectly periodic schedules in poly-nomial time.

To formally define the efficiency of a schedule,we introduce some notation. The set of requests orjobs is known as an ‘instance’ and is denoted by J ={(bi, τi)

ni=1}, where n denotes the number of jobs. The

requested bandwidth of job i is defined as βi = bi/τi .The total bandwidth of an instance J is defined to beβJ = ∑n

i=1 βi . To evaluate the quality of a perfectlyperiodic schedule, two measures are suggested in [7,8]. The first measure is an average measure known asCAVE(J, S), and is defined as

CAVE(J, S) = 1

βJ

n∑i=1

βi

τSi

τi

.

The second measure is a maximum measure and is de-fined as CMAX(J, S) = max{τS

i /τi | i ∈ J }.The original motivation for studying perfectly peri-

odic schedules was broadcast disks. In a broadcast disksystem a server broadcasts data ‘pages’ to clients ina perfectly periodic manner; allowing clients to sleepuntil its desired page is broadcast. Note that this is aspecial case of the portable wireless device scenariowhere two-way communication is required. Other mo-tivations include teletext systems [1,2], chairperson as-signment [10], machine maintenance [11,3,4] and fairtime scheduling problems.

It has been shown in [5] by Bar-Noy et al., that evendeciding whether a given set of requests can be sched-uled in a perfectly periodic manner without distortionis NP-hard. However, in [7,6], polynomial complexitytree based scheduling algorithms have been presented assuboptimal solutions to the problem for the case where∀i ∈ J , bi = 1. This work has been extended in [8] torequests with bi greater than or equal to one. To thebest of our knowledge, this is the only proposed solu-tion for the general case. Tree-based perfectly periodicscheduling has also been investigated for possible in-clusion into the IEEE’s 802.11e WAN QoS standard.Dhanakoti et al. in [9] propose a binary-tree-based per-fectly periodic scheduling scheme for fault avoidance in802.11 WLANs. In this paper we study the case wherebi is greater than one and compare our algorithm to Aproposed in [8].

This paper is divided into five sections. Section 2presents an overview of the algorithm presented in [8].This is followed by a description of the proposed algo-rithm Adaptmin. Section 3 of the paper gives analyticalbounds for the same. We also present families of in-stances where Adaptmin either does no worse than A oralways outperforms it. A computationally light variantof Adaptmin, Adapt and simulation results are presentedin Section 4. Simulation results indicate that the pro-posed algorithms not only do much better than A butalso are close to exponential-time optimal scheduling.Section 5 concludes the paper.

2. Adaptmin

We define some notation that will be needed dur-ing the description and analysis of proposed algo-rithms. The free bandwidth of an instance is definedas ΔJ = 1 − βJ . The extent of a instance is definedas RJ = max{bi | i ∈ J }/min{τi | i ∈ J }. The minimumrequested period of an instance is denoted by tJ =min{τi | i ∈ J }, while the maximum period is denotedby TJ = max{τi | i ∈ J }. We will drop the subscript J

when there is no ambiguity about the instance being re-ferred to.

As mentioned earlier, an algorithm called A was pro-posed in [8] to create perfectly periodic schedules. Itwas shown that if all the periods of the instance J are ofthe form τi = 2mi e, where e is a constant, and Δ � R,then a distortion free perfectly periodic schedule ex-ists and can be created using A. It was further shownthat for any instance with periods that are of the form2mi e, if all the periods are scaled by a factor of β + R,then for the resulting instance Δ � R. Algorithm A firstrounded up the periods to powers of two. Then, all theperiods were scaled by a factor of β ′ + R′, where β ′and R′ are the bandwidth and extent of the input in-stance after rounding periods to the nearest power oftwo. A perfectly periodic schedule was produced usingtree scheduling for the scaled up instance. However, therequirement Δ � R is very restrictive. Consider the in-stance J = {(1,1)}. In this example, Δ = 0 and R = 1,but it is easy to produce a distortion free schedule for theinstance. Algorithm A will produce a schedule that dou-bles the period. A more complex example is when J ={(2,4), (1,8), (2,8), (1,16)}. A distortion free schedulecan also be formed for this instance, but A expands eachperiod by a factor of 23

16 . One can easily come up withmore examples where Δ < R, but a distortion free per-fectly periodic schedule exists.

Fig. 1 gives the algorithm for Adaptmin. We ex-plain this proposed algorithm with an example. Con-

Page 3: Adaptive general perfectly periodic scheduling

S. Patil, V.K. Garg / Information Processing Letters 98 (2006) 107–114 109

Algorithm Adaptmin

Input: Instance J

Output: Schedule S

Steps:

1. Round the periods to nearest power of 2, i.e. τ ′t = 2�log τi� for

all i.2. Sort the jobs in the increasing order of periods.3. Find the minimum period t ′ = min{τ ′

i| i ∈ J }, maximum period

T = max{τ ′i| i ∈ J } and the number of intervals α = T ′/t ′ .

4. Starting with the first job (i.e., the first job after sorting in step 2)follow steps 5 to 7.

5. Try to schedule job i in the interval with least job length sched-uled among the first αi = τ ′

i/t ′ intervals.

6. If the job is scheduled, then schedule the job in all intervals thatare at a multiple of αi intervals away (from the first interval inwhich the job is scheduled) and go back to step 4. Else, go to thenext step.

7. Find the interval within the first a, intervals that requires the min-imum expansion to accommodate job i, say interval k. Expandall intervals by the minimum expansion. Schedule job i in inter-val k and the intervals that are at a multiple of a, intervals awayfrom k. Go to step 4.

Fig. 1. Algorithm for Adaptmin.

sider an instance J = {(2,3), (1,5), (1,13), (3,8)}. Thefirst step is to round all periods up to the nearest powerof two, i.e., τ ′

i = 2�log2 τi�. This gives us the modifiedinstance J ′ = {(2,4), (1,8), (1,16), (3,8)}. Step 2 re-quires that the input instance be sorted in the ascendingorder according to periods, i.e., ∀i, j ∈ J , if τi � τj ,then i � j . No order is required among jobs with equalperiods. Note that algorithm A also requires the samekind of ordering in the input instance. The sorted in-stance is given by J ′ = {(2,4), (1,8), (3,8), (1,16)}.

Like algorithm A, our algorithm equally scales therounded up periods τ ′

i , i.e., τSi /τ ′

i will be equal for all i.This is desirable, since it allows the maximum changein the period of a particular job to be bounded and thusensures some level of fairness among the jobs. Also,scaling the rounded up periods differently may lead tohigher computational complexity.

Continuing with the example, we describe step 3now. Step 3 calculates the minimum rounded up periodt ′ = 4, the maximum rounded up period T ′ = 16. Thealgorithm divides the total schedule into α = T ′/t ′ in-tervals, each interval of length t ′. For the given instance,the number of intervals is α = 4, with each interval oflength t ′ = 4. We meet the perfectly periodic property ofthe schedule being produced by ensuring that for any jobi with requested period τ ′

i , the job is scheduled withinαi = τ ′

i /t ′ intervals.In step 4, we consider the first job (2,4). Step 5

tries to schedule this job in the first α1 = 1 interval(s).

Fig. 2. Adaptmin scheduling instance J = {(2,3), (1,5), (1,13),

(3,8)}.

Since there is space, it is possible to do so. Step 6 thenschedules the job in all the intervals that are α1 = 1 in-terval away. This is shown in Fig. 2(a), where 1 denotesthe first job. Next, we loop back to step 4 and con-sider the second job (1,8). Here α2 = 2, and since boththe first and second interval have equal empty space,step 5 schedules the job in the first interval, while step 6,schedules it in the third. Fig. 2(b) illustrates this. Weagain loop back to step 4 and now consider the thirdjob, i.e., (3,8). Since α3 is also equal to 2, this job alsohas to be scheduled in the first two intervals. Howeverin step 5, we are unable to find enough space in eitherof the first two intervals. This means that there is a needto expand the intervals, for this we proceed to step 7.Step 7 finds the interval among the first two intervalsthat requires the minimum expansion to accommodate(3,8). This is clearly the second interval, and it requiresan expansion of one slot. All intervals are expanded bya unit slot, and (3,8) is scheduled in the second andthe fourth interval, as shown in Fig. 2(c). We again loopback to step 4 and consider the last job (1,16). Step 4places the job in the first interval, and this completes theschedule. The completed schedule is shown in Fig. 2(d).This completes our description of the algorithm. Onecan think of Adaptmin as a ‘best fit’ solution, becauseit greedily tries to find the best interval to schedulea job.

3. Analysis of Adaptmin

3.1. Performance bound

In this section we analyze the performance of Adapt-min by finding the upper bounds on CAVE and CMAX ofschedules produced by the algorithm. We first considerthe case where all the periods are powers of two, i.e., ofthe form τi = 2mi e, where e is a constant. In this case,all time periods are of the form 2kt , where k is an in-teger that varies from 0 to K := log2(T /t). We group

Page 4: Adaptive general perfectly periodic scheduling

110 S. Patil, V.K. Garg / Information Processing Letters 98 (2006) 107–114

jobs of equal period together. Let Qk = {(bi, τi) | τi =2kt and i ∈ J } denote the set of jobs with periods equalto 2kt . The sum of lengths for jobs with equal periods isdenoted as Bk = ∑

i∈Qkbi . Define

Lk(b) = maxq⊆Qk

{∑i∈q

bi

∣∣∣∣∑i∈q

bi � b s.t.

∀j ∈ q∑

i∈q−j

bi < b

}.

Let use describe Lk(b) in a more verbose manner. Tofind the quantity, we first find all the subsets q of Qk ,such that

∑i∈q bi � b and if any job j is removed from

q , then∑

i∈q−j bi < b. Then among such subsets, wechoose the set for which the sum of job lengths is max-imum, Lk(b) denotes that maximum.

We define one more quantity before presenting thebound,

Jρ ={(bi, τi) ∈ J | log2

(τi

tJ

)� ρ

},

i.e., an instance containing a subset of jobs of J withperiods less than or equal to 2ρtJ .

Lemma 3.1. For an instance J with periods of the formτi = 2mi e, the maximum length in an interval for aschedule S created using Adaptmin is at most

K∑k=0

Lk

(Bk/2k

).

Proof. The proof is by induction on J̄ρ := Jρ ∪{(0, TJ )}.The bound is obvious on a schedule created for J̄0. As-sume the bound is true on a schedule created for J̄g−1.

Since J̄g−1 contains a zero length job of period TJ ,to obtain a schedule for J̄g one only needs to add jobswith period 2gtJ to the schedule created for J̄g−1. Let U

be the set of intervals and lg−1u be the length scheduled

in interval u, for J̄g−1. By assumption

lg−1u �

g−1∑k=0

Lk

(Bk/2k

)

(BK = 0 in J̄g−1).Considering the worst case, we assume

∀u ∈ U, lg−1u =

g−1∑k=0

Lk

(Bk/2k

).

Jobs of period 2gtJ are divided among 2g intervals.Consider the case where not all jobs of period 2gtJ have

been scheduled, let l(u) be the length scheduled in in-terval u until now. Then if

∃u ∈ U, s.t. l(u) − lg−1u � Bg/2g,

by averaging argument,

∃r ∈ U, s.t. l(r) − lg−1r < Bg/2g.

Since Adaptmin schedules job in the interval with themost empty space, none of the remaining jobs will bescheduled in u. Then, the maximum length added to anyinterval will be Lg(Bg/2g). So,

lgu �

g∑k=0

Lk

(Bk/2k

).

This completes the proof. �Theorem 3.2. For an instance J with periods of theform τi = 2mi e and

∑Kk=0 Lk(Bk/2k) > t , the aver-

age distortion CAVE(J, S) and the maximum distortionCMAX(J, S) measures for a schedule S created usingAdaptmin are less than

Cb =∑K

k=0 Lk

(Bk/2k

)t

.

Proof. The proof follows easily from Lemma 3.1. �Note that when

∑k Lk(Bk/k) � t , CAVE,CMAX = 1.

Consider an instance J = {(2,4), (1,8), (1,8), (2,

16)}, a schedule created using Adaptmin for J triv-ially achieves the bound. This shows that the bound istight. For instances with jobs having periods that arenot power of two, the bound can be trivially shown tobe 2Cb .

3.2. Comparison with A

Since both A and Adaptmin round periods to nearestpower of two, it is sufficient to compare the distortionproduced by each after rounding. Recall that J ′ denotesthe modified instance J after rounding up of periods,with the rounded up periods being denoted by τ ′

i . Theminimum and maximum rounded up periods are de-noted by t ′ and T ′, respectively, while the bandwidthand extent for J ′ are denoted by β ′ and R′.

Note that∑K

k=0 Bk/2kt = β ′, so if (Cb − β ′) � R′,then Adaptmin will always produce a more efficientschedule than that produced by algorithm A. However,if (Cb − β ′) > R′, then Adaptmin may still outperformA, since Cb may not be achieved while A always scalesperiods by β ′ +R′. This indicates that in general Adapt-min may outperform A.

Page 5: Adaptive general perfectly periodic scheduling

S. Patil, V.K. Garg / Information Processing Letters 98 (2006) 107–114 111

From the above discussion, one can come up withfamily of instances where Adaptmin will always out-perform A. These are instances that after rounding ofperiods contain jobs with at most two different periods.

Consider the case where J ′ contains jobs with ex-actly one period. Then Adaptmin will expand roundedup periods by a factor of max{1, β ′}. In other wordsAdaptmin will produce no distortion after rounding forβ ′ < 1. While A will expand the round periods by a fac-tor of max{1, β ′ + R′} (depending on whether Δ′ � R′,or 1 � β ′ + R′). Then it is clear that Adaptmin will al-ways outperform A, i.e., not only Adaptmin will producedistortion for a subset of instance for which A producesdistortion, but the distortion produced by Adaptmin willbe less.

Now consider the case where J ′ contains jobs withexactly two different periods. If Δ′ < R′, Adaptminwill expand rounded up periods at most by a factor ofβ ′ + R′, while A will always expand rounded up peri-ods by a factor of β ′ + R′. However if Δ′ � R′, boththe algorithms do not expand the rounded up periods.It is clear that for such a family of instances Adaptminwill never do worse than A. An example instance thatcontains exactly two different periods after rounding isJ = {(1,3), (1,4), (2,5), (1,7), (1,8)}, so a fairly largenumber of instances may belong to the family.

Let us describe another family where Adaptmin al-ways outperforms A. Define c to be the maximum joblength in an instance, i.e., c := max{bi | i ∈ J }. Notethat c = Rt = R′t ′. Consider a family of instanceswhere each job after rounding contains different peri-ods, i.e., every job in J ′ has a unique period. We claimthat for such a family of instance Adaptmin always out-performs A. To validate our claim, we present the fol-lowing lemma.

Lemma 3.3. Consider an instance J such that therounded up period instance J ′ contains jobs with uniqueperiods. Then the maximum length scheduled in an in-terval of a schedule created using Adaptmin for J isbounded by B0 + c, where B0 is the length of the jobwith minimum period t in J .

Proof. Recall that the first step of Adaptmin is to roundthe periods of jobs to their nearest power of two. This isfollowed by sorting the jobs in increasing order of theirperiods.

We give the proof by induction on jobs being sched-uled. It is clear that the bound will hold when the firstjob is scheduled. By assumption, the bound holds afteri − 1 jobs have been scheduled. We need to prove thatthe bound holds after scheduling of job i.

Let τ ′i = 2gt ′, then job i has to be scheduled once

within the first 2g intervals. Consider jobs 2, . . . , i − 1,i.e., all the jobs scheduled before job i excepting thefirst one. All of them have unique periods of the form2k , where k < g. Then each job will be scheduled in2g−k intervals. Note that ∀g,

g−1∑k=2

2g−k < 2g.

Then there exists at least one interval where the sched-uled length is only B0, the lengths scheduled in allother intervals will be equal or greater. So the maxi-mum length scheduled in an interval after job i has beenscheduled is B0 + c. This completes the proof. �

When the number of jobs n is greater than 1,(B0/t ′) < β ′ it is clear that for instances which con-tain unique periods after rounding up, Adaptmin willalways outperform A. The case where n = 1 has beendiscussed earlier. One can extend our claim to the casewhere J ′ can have multiple jobs with a period of t ′, butrest of the jobs have unique periods.

4. Simulation results

We performed simulations to observe the perfor-mance of the discussed algorithms. Two criteria wereobserved, the efficiency of the schedule produced interms of CAVE and the computational complexity interms of CPU time used. All simulations were per-formed using MATLAB®.

4.1. Adapt and optimal scheduling

Apart from comparing to A, we also compare Adapt-min to two more algorithms. Adapt is a variant of Adapt-min. When scheduling a job i using Adapt, the job isscheduled in the first interval among the first αi inter-vals that has enough space to accommodate i insteadof the interval containing the maximum empty space.However, if none of the first αi intervals has space toaccommodate i, then like Adaptmin, Adapt expands in-tervals by the least amount required. More formally, thealgorithm for Adapt can be obtained by replacing step 5in the algorithm for Adaptmin by “Starting with the firstinterval, try to schedule job i in the first αi = τ ′

i /t ′ in-tervals”. One can think of Adapt as a ‘first fit’ solution.Simulation results show that performance of Adapt isvery close to Adaptmin. However, since Adapt does notalways search for the interval with maximum emptyspace, it is computationally more efficient than Adapt-min.

Page 6: Adaptive general perfectly periodic scheduling

112 S. Patil, V.K. Garg / Information Processing Letters 98 (2006) 107–114

We also implemented a brute force algorithm whichis optimal under the regime where all periods are apower of two and all periods are expanded by the samefactor. This in some sense is the lower bound for perfor-mance of other algorithms discussed in this paper.

4.2. Efficiency of algorithms

To compare the efficiency of algorithms, we plotCAVE versus the requested bandwidth β . The input in-stance having a specific β can be generated in multipleways. We outline our procedure, that tries to be as ran-dom as possible and not necessarily produce instancesbelong to families discussed in Section 3.2. Since allalgorithms round periods to nearest power of two, werestrict the periods to be power of two. The largest pe-riod is set to 128. We also restrict the job lengths tointegers. For a given β , a point x1 is randomly chosenbetween 0 and β . A support set of periods τi is gener-ated such that 1/τi � x1 and τi � 128. From the supportset, a period say τ1i is randomly chosen and the maxi-mum length b1i is chosen such that b1i/τ1i � x. Thena point say x2 is randomly chosen from the interval(b1i/τ1i , β). A support set is again generated, such that1/τi � (x2 − b1i/τ1i ) and τi � 128. A period say τ2i israndomly chosen from the support set and the maximumlength b2i is chosen such that b2i/τ1i � (x2 − b1i/τ1i ).This process is repeated until the requested bandwidthfor the job being generated is within 1/128 of β . Notethat the support set will always contain 128 as one ofthe periods, so the probability of jobs with period 128 ishigher than other periods. We remedy this by truncatingthe support set to the smallest w periods and choosingrandomly among them.

The simulation results are shown in Figs. 3–6. Fig. 3shows the result when no truncation on the support setis performed, while Figs. 4 and 5 represent the casewhen w = 2 and w = 3, respectively. As expected, theCAVE increases with β for all the algorithms. The curvesof Adapt and Adaptmin exactly overlap in all the fig-ures. However, overall Adapt performs slightly betterthan Adaptmin. Our algorithm clearly outperforms al-gorithm A. For example, in Fig. 3 at β = 0.5, the aver-age increase in periods for schedules produced using Ais 0.61, while the same quantity for Adapt is 0.45, i.e.,Adapt is around 25% more efficient. As w decreases,the difference between the algorithms increases further.Note that a smaller w on an average implies a smaller R,so with decreasing R, Adapt gives better performance.Fig. 6 compares all the algorithms with the optimalscheduling with maximum period restricted to 32 in-

Fig. 3. Performance of A, Adapt and Adaptmin.

Fig. 4. Performance of A, Adapt and Adaptmin with w = 2.

Fig. 5. Performance of A, Adapt and Adaptmin with w = 3.

stead of 128. As can be seen from the figure, our al-gorithms’ perform quite close to the optimal scheduler.

Page 7: Adaptive general perfectly periodic scheduling

S. Patil, V.K. Garg / Information Processing Letters 98 (2006) 107–114 113

Fig. 6. Comparison of A, Adapt, Adaptmin with optimal scheduling.

4.3. Computational complexity

The worst case computational complexity for all thealgorithms being discussed is O(nT ′/t ′). (A will haveits worst case when all jobs except one are scheduledon the leaves of the binary tree constructed for the al-gorithm.) However our simulation results indicate thatthey have quite different average case behavior.

To observe computational performance, instanceswere generated in a different manner compared to pre-vious subsection. We studied computational complexityby varying two parameters, the number of jobs n andnumber of intervals, i.e., T ′/t ′. For a given n and T ′/t ′,jobs were randomly generated and the computation timetaken by A, Adapt and Adaptmin was measured. Compu-tational time of the algorithms was measured using the“cputime” command of MATLAB®. The periods wereagain constrained to be power of two, while the lengthswere required to be integral. The lengths for each jobwas chosen randomly between 1 and �t/2�. The resultshave been plotted in Fig. 7. When T/t = 16, T wasequal to 128 and t was set to 8, while when T/t = 4,T = 32 and t = 8. Fig. 7 shows that Adapt has a muchbetter computational time compared to A and Adaptmin,while A does better than Adaptmin. But the differenceamong all the algorithms reduces with lower T/t ratio.Our tests show that the majority of algorithm A’s timeis spent in delegating the jobs between the left and rightchild nodes in the tree that is constructed, while the ma-jority of Adaptmin is spent in finding the interval withmaximum empty space.

Fig. 7 also illustrates that both the algorithms areroughly linear with the number of jobs. However, Adaptseems quite insensitive to variation in T/t , while A andAdaptmin seem to be linear to the variation.

Fig. 7. Complexity comparison of A, Adapt and Adaptmin.

Overall, our results clearly indicate that both Adaptand Adaptmin produce much more efficient schedulesthan A, and from a computational complexity perspec-tive Adapt is more efficient that A.

5. Conclusion

In this paper we proposed two algorithms Adapt-min and Adapt to perform perfectly periodic scheduling.We also developed upper bounds for Adaptmin. Simula-tion results show that both Adaptmin and Adapt performmuch better than A, with Adapt performing slightly bet-ter than Adaptmin. We also compared Adaptmin andAdapt to optimal scheduling. The results show that ouralgorithms produce schedules close to optimal sched-ules. In terms of computational complexity, Adapt out-performed A.

Acknowledgements

The authors would like to thank Alejandro Icaza forthe very fruitful discussions we had with him. We wouldalso like to thank him for helping out with the simula-tions. We are also grateful to the anonymous reviewersfor their insightful comments.

References

[1] M.H. Ammar, J.W. Wong, The design of teletext broadcast cy-cles, Performance Evaluation (1985) 235–242.

[2] M.H. Ammar, J.W. Wong, On the optimality of cyclic transmis-sion in teletext systems, IEEE Trans. Commun. (1987) 1159–1170.

[3] S. Anily, C.A. Glass, R. Hassin, The scheduling of maintenanceservice, Discrete Appl. Math. 80 (1998) 27–42.

[4] S. Anily, C.A. Glass, R. Hassin, Scheduling of maintenance ser-vices to three machines, Ann. Oper. Res. 86 (1999) 375–391.

Page 8: Adaptive general perfectly periodic scheduling

114 S. Patil, V.K. Garg / Information Processing Letters 98 (2006) 107–114

[5] A. Bar-Noy, R. Bhatia, J. Naor, B. Schieber, Minimizing ser-vice and operation costs of periodic scheduling, in: Proc. 9thAnnual ACM–SIAM Symp. on Discrete Algorithms, January25–27, 1998, pp. 11–20.

[6] A. Bar-Noy, A. Nisgav, B. Patt-Shamir, Nearly optimal perfectly-periodic schedules, in: Proc. 20th Annual ACM Symp. on Prin-ciples of Distributed Computing, August 2001, pp. 107–116.

[7] A. Bar-Noy, V. Dreizin, B. Patt-Shamir, Efficient periodicscheduling by trees, in: Proc. 21st Annual Joint Conf. of theIEEE Computer and Communications Societies, vol. 2, June2002, pp. 23–27.

[8] Z. Brakerski, A. Nisgav, B. Patt-Shamir, General perfectly pe-riodic scheduling, in: Proc. 21st Annual Symp. on Principles ofDistributed Computing, 2002, pp. 163–172.

[9] N. Dhanakoti, S. Gopalan, V. Sridhar, Perfectly PeriodicScheduling for Fault Avoidance in IEEE 802.11e in the contextof home networks, in: Proc. 14th Annual IEEE Internat. Symp.on Software Reliability Engineering, November 17–20, 2003.

[10] R. Tijdeman, The chairman assignment problem, DiscreteMath. 32 (1980) 323–330.

[11] W. Wei, C. Liuy, On a periodic maintenance problem, Oper. Res.Lett. 2 (1983) 90–93.