• Aucun résultat trouvé

On-line Time-Constrained Scheduling Problem for the Size on k machines

N/A
N/A
Protected

Academic year: 2021

Partager "On-line Time-Constrained Scheduling Problem for the Size on k machines"

Copied!
6
0
0

Texte intégral

(1)

HAL Id: hal-00341386

https://hal.archives-ouvertes.fr/hal-00341386

Submitted on 18 Jul 2009

HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

On-line Time-Constrained Scheduling Problem for the Size on k machines

Nicolas Thibault, Christian Laforest

To cite this version:

Nicolas Thibault, Christian Laforest. On-line Time-Constrained Scheduling Problem for the Size on k machines. ISPAN, 2005, United States. pp.20–24, �10.1109/ISPAN.2005.65�. �hal-00341386�

(2)

On-line Time-Constrained Scheduling Problem for the Size onk machines

Nicolas Thibault and Christian Laforest

Tour Evry 2, LaMI, Universit´e d’Evry, 523 place des terrasses, 91000 EVRY France {nthibaul,laforest}@lami.univ-evry.fr

Abstract

In this paper we consider the problem of scheduling on- line jobs onkidentical machines. Technically, our system is composed ofkidentical machines and each job is defined by a tripletΓ = (l, r, p), whereldenotes its left border,rits right border andpits length. When a job is revealed, it can be rejected or scheduled on one of thekmachines. In this last case, it can suppress already scheduled jobs. The goal is to maximize the size of the schedule (i.e. the number of jobs scheduled and not (later) suppressed). We propose an algorithm calledOLU W. It is(4 min (β,⌊log2(γ)⌋+ 1))- competitive, whereβ is the number of different job lengths appearing in the on-line input sequence and γ is the ra- tio between the length of the longest job and the length of the shortest job in the sequence. To the best of our knowl- edge,OLU W is the first on-line algorithm maximizing the size with guarantees on the competitive ratio for the time- constrained scheduling problem onkidentical machines.

1 Introduction

We consider the problem of scheduling on-line jobs onk identical machines (for anyk 1). We define a jobΓby the tripletΓ = (l, r, p), wherelis the left border,rthe right border andprlthe length ofΓ. A job is scheduled on machinejif it occupies machinejon a continuous interval of lengthpbetween its two borders. Jobs are independent and two jobs scheduled on the same machine cannot inter- sect.

Previous works. This problem is known as the Time- Constrained Scheduling Problem (TCSP). The aim is to maximize the weight of the constructed schedule (i.e. the sum of the weight of scheduled jobs). There are several cat- egories of weights: the same for all jobs (corresponding to the maximization of the size of the schedule), equal to the length or arbitrary. In [5], all these variants of TCSP are studied in the off-line setting. As each variant is NP-hard, approximation algorithms are proposed, with constant ap-

proximation ratios. But the methods in [5] are off-line, thus they cannot be used for solving our on-line problem.

In the on-line setting (where jobs are revealed and treated one by one) particular variants of TCSP have been studied.

The version where a job is an interval (i.e. with tight left and right borders,p=rl) has been extensively studied.

In [2, 3, 4, 7, 9, 12], algorithms for this model are proposed.

More recently, several papers [1, 8, 10, 11] have inves- tigated variant of on-line TCSP and have proposed algo- rithms for the case where jobs have not tight left and right borders. But all these papers only consider the particular case of a single machine.

In this paper, we propose the first on-line algorithm solv- ing TCSP for the unit weight model (i.e. for the maximiza- tion of the size of the schedule) onkidentical machines (in part, our work is more general than previous works on a single machine).

Definitions. We describe now more precisely our notations.

When a jobΓ = (l, r, p)is revealed, all informations in the triplet(l, r, p)are revealed. JobΓis said to be scheduled on machinej if it continuously occupies machinej between l0 andr0 with: p = r0l0 andl l0 r0 r. The resulting numerical intervalσ= [l0, r0)is called the inter- val associated toΓ. Note that the length ofσispand that σ [l, r)(i.e. jobΓis scheduled between its two borders on a lengthp). A scheduleSis feasible if on any machine, no scheduled jobs (i.e. their associated intervals) intersect.

The size|S|ofS is the number of scheduled jobs. In the following, we will denote bySj the sub-part of a schedule Son machinej.

Given any on-line sequence of jobsΓ1, . . . ,Γn, . . . re- vealed one by one in this order, any on-line algorithm must construct at each step a feasible schedule on kmachines.

In our model, when a new jobΓ = (l, r, p)is revealed, an on-line algorithm can reject it or schedule it. In this second case, if it schedulesΓas the intervalσon machine number j, it interrupts all the already scheduled intervals intersect- ingσon this machine (rejected jobs and interrupted inter- vals are definitively lost and do not appear in the current and future schedules). In order to evaluate the quality of an on-line scheduling algorithm, we introduce the follow-

(3)

ing definition of the competitive ratio (see [6] for references on competitive ratios).

Definition 1 (Competitive ratio) Let Γ1, . . . ,Γn, . . . be any on-line sequence of jobs revealed in this order to on- line AlgorithmA. LetSnbe the corresponding schedule on kmachines constructed by AlgorithmAat stepn1. Let Sn∗be the (optimal off-line) maximum size schedule onk machines of the set of jobs1, . . . ,Γn}. AlgorithmAhas a competitive ratio ofc(or isc-competitive) if and only if:

∀n1, c· |Sn| ≥ |Sn∗|

Application to networks. Our model can be applied (but is not limited) to the following situation. Consider a link in a communication network, made ofksub-links of identical capacities (for example an optical fiber in whichkindepen- dent frequencies can be used simultaneously). To schedule on-line requests (revealed one by one) on this link, an on- line algorithm has to choose which one is accepted and on which sub-link. In this application, one request is defined by a length (corresponding to the duration of transmission of the request on one sub-link), a release date and a deadline (after which completing the request is of no use). Here, we want to maximize the number of accepted requests.

Outline of the paper. In Section 2, we propose an on-line algorithm (called OLU W), solving TCSP on k identical machines. In Section 3, we prove it is (4 min (β,⌊log2(γ)⌋+ 1))-competitive, where β is the number of different job lengths appearing in the on-line in- put sequence and γis the ratio between the length of the longest job and the length of the shortest job in the input sequence. In the particular case of a single machine sys- tem (i.e.k= 1), our algorithm has (in order of magnitude) the best possible competitive ratio, since it is proved in [9]

that even for the interval model, no on-line algorithm has a competitive ratio better thanΩ(logγ).

2 Our algorithmOLU W

We define AlgorithmOLU Was follows.

On-line Unit Weight Algorithm -OLU W LetSbe the current schedule made ofksub-schedulesSj(1jk), one on each machine numberjand letΓ = (l, r, p)be the new revealed job.

IFthere exists a machine numberj such that there exists an interval σ[l, r)of lengthpsatisfying:

(∀σSj, σσ=∅)or

(∃σ0Sj, σσ0and2p(σ)p(σ0)) THENinterruptσ0(if necessary) and scheduleΓas intervalσon machinej ELSErejectΓ.

Note that at each step, AlgorithmOLU W constructs a fea- sible schedule.

To simplify the notations, for every intervalσ, we say thatσsatisfies condj(σ)if and only if(∀σSj, σσ=

∅)or(∃σ0 Sj, σ σ0and2p(σ) p(σ0)). By using the following algorithm (calledIBfor Important Borders, running on one machine), finding an intervalσ [l, r)of lengthpsatisfying condj(σ) if there exists one (correspond- ing to lines 4 and 5 of AlgorithmOLU W) can be done in polynomial time for each machinej.

Important Borders Algorithm -IB LetΓ = (l, r, p)be the new revealed job.

Letj,1jkbe the number of the machine currently checked. On machine numberj:

Let{[l1, r1), . . . ,[ln, rn)}be the set of intervals already scheduled on machine numberjsuch that

l < r1l2< r2≤ · · · ≤ln< rn< r.

Letl, l1, r1, l2, r2, . . . , ln, rnbe the sequence of important borders.

Letdbe the first important border satisfying[d, d+p)[l, r) and condj([d, d+p)).

IFsuch adexists

THENthere exists an interval

σ= [d, d+p)[l, r)satisfying condj(σ) ELSEthere is no intervalσ[l, r) of lengthpsatisfying condj(σ).

The following Theorem proves the correctness of Algo- rithmIB.

Theorem 1 For every machine number j (1 j k), AlgorithmIBfinds an intervalσ = [d, d+p) [l, r)of lengthpsatisfying condj([d, d+p)) if and only if there exists one.

Proof. Of course, if AlgorithmIBfinds an intervalσ = [d, d+p)[l, r)of lengthpsatisfying condj([d, d+p)), then there exists one.

We now prove that if there exists an intervalσ [l, r) of length psatisfying condj(σ), then AlgorithmIB finds one. Indeed, suppose, by contradiction, that there exists an interval[l0, r0)[l, r)of lengthp(i.e. withr0l0 =p) satisfying condj([l0, r0)) and that Algorithm IB finds no interval. Letd0∈ {l, l1, r1, l2, r2, . . . , ln, rn}be the largest important border such thatd0 l0. By definition of Algo- rithmIB, the interval[d0, d0+p)is checked. Let us now consider the two following cases:

If[l0, r0)intersects no interval scheduled on machine j. As d0 is the largest important border such that d0 l0 and as [l0, r0) and [d0, d0 +p) both have lengthp,[d0, d0+p)intersects no interval scheduled

2

(4)

on machinej. This means that [d0, d0+p)satisfies condj([d0, d0+p)). Thus, AlgorithmIBchooses this interval (contradiction).

Otherwise, there exists an interval σ scheduled on machine j intersecting [l0, r0). As [l0, r0) satisfies condj([l0, r0)), we have[l0, r0)σ. Moreover, asd0

is the largest important border such thatd0 l0 and as[l0, r0)and[d0, d0+p)both have lengthp, we also have[d0, d0+p)σ. This means that[d0, d0+p)sat- isfies condj([d0, d0+p)). Thus, AlgorithmIBchooses this interval (contradiction).

¤

3 Analysis of AlgorithmOLU W

In the following, we consider any on-line sequence Γ1, . . . ,Γn, . . . as input. In order to analyze its competitive ratio, we will compareS(the schedule given by Algorithm OLU W on k machines at step nfor the input sequence Γ1, . . . ,Γn) withS(the optimal schedule given onkma- chines at stepnfor the input set1, . . . ,Γn}).

Main result. In order to express our main result, we need the following definitions of the parametersβandγ.

Definition 2 For every on-line sequence Γ1, . . . ,Γn, we defineβ as the number of different job lengths appearing inΓ1, . . . ,Γn:

β=

¯

¯

¯

¯

¯

¯ [

Γ∈Γ1,...,Γn

{p(Γ)}

¯

¯

¯

¯

¯

¯

Definition 3 For every on-line sequence Γ1, . . . ,Γn, we defineγas the ratio between the length of the longest job and the length of the shortest job inΓ1, . . . ,Γn:

γ= max

½p(Γ)

p(Γ) : Γ,Γ∈ {Γ1, . . . ,Γn}

¾

Our main result is the following theorem, expressed with the previous notations, proving that Algorithm OLU W is (4 min (β,⌊log2(γ)⌋+ 1))-competitive.

Theorem 2 4 min (β,⌊log2(γ)⌋+ 1)· |S| ≥ |S|

In order to prove Theorem 2, we need the following defini- tions.

Notation 1 For everyj, (1 j k), letSj(resp. Sj) be the sub-schedule ofS(resp.S) on machine numberj.

Notation 2 For every machine numberj (1 j k), let Tjbe the set of associated intervals scheduled by Algorithm OLU W on machine numberj, including the intervals that have been scheduled and later interrupted.

Note that two intervals inTj can overlap, since in general, Tjis not a feasible schedule.

Definition 4 For every machine numberj(1jk), we defineSj∗AandSj∗Bas follows:

LetS∗Aj be the sub-schedule ofSjsuch thatSj∗ASj and for everyσaSj∗A, there existsσb S

1≤j≤kTj such that σa and σb are associated to the same job Γ(i.e. Γis scheduled inSj∗Aas intervalσa and has been accepted and scheduled by AlgorithmOLU Was intervalσb).

LetSj∗Bbe the sub-schedule ofSjsuch thatS∗Bj Sj and for everyσa Sj∗B, there is noσb S

1≤j≤kTj

such thatσa andσb are associated to the same jobΓ (i.e.Γis scheduled inSj∗Bas intervalσabut has been rejected by AlgorithmOLU W).

Note that we haveSj∗ASj∗B =andSj∗ASj∗B=Sj. Definition 5 (The functionf) Letjbe any machine num- ber (1 j k). LetΓx be the new revealed job sched- uled in the optimal solution as intervalxon machinejand rejected by OLU W (i.e. x Sj∗B). Let Sj be the cur- rent sub-schedule ofS on machine j whenΓxis revealed and let Tj be the set of all associated intervals scheduled by AlgorithmOLU W on machine numberj beforeΓx is revealed (including the intervals that have been scheduled and later interrupted). Note that bothSj andTj are con- sidered here as they currently are when jobΓxis revealed.

LetYx={ySj: (p(y)<2p(x)and xy)or(x∩y6=

and x*y)}. We define the functionf as follows f : Sj∗B Tj

x 7→ y= [ly, ry)such thatyYx andly = min{ly :yYx} Note that we want y be such that ly = min{ly : y Yx} just to ensure that there is only oney = f(x). We now introduce some technical Lemmas in order to prove Theorem 2.

Lemma 1 For every machine numberj (1 j k), for every intervalxSj∗B, we have

|{y:y=f(x)}|= 1

Proof. LetΓxbe the new revealed job scheduled inS∗Bj as intervalx. LetSj be the current sub-schedule ofSon ma- chinejwhenΓxis revealed. Sincex Sj∗B,Γxhas been rejected by AlgorithmOLU W. In particular, this means that AlgorithmOLU Whas rejectedΓxof machinej. Thus, by definition of OLU W and by Theorem 1, there exists y0Sjsuch that(p(y0)<2p(x)and xy0)or(x∩y06=

and x * y0). If there exist several suchy0, choose the one with the minimum left border. By definition off, we havey0=f(x), thus|{y:y=f(x)}|= 1. ¤

(5)

Lemma 2 Letjbe any machine number (1 j k). Let Γxbe the new revealed job scheduled inSj∗Bas intervalx.

LetSjbe the current sub-schedule ofSon machinejwhen Γxis revealed and letTj be the set of all associated inter- vals scheduled by AlgorithmOLU Won machine numberj before thatΓxis revealed (including the intervals that have been scheduled and later interrupted). For every interval yTj, we have

|{x:y=f(x)}| ≤3

Proof. By contradiction, suppose that there existsy Tj such that |{x : y = f(x)}| ≥ 4. We denote by{x1 = [l1, r1), x2= [l2, r2), . . . , xn = [ln, rn)}(withn4) the set of intervals such thatS

1≤l≤n{xl} ={x: y =f(x)}, ordered by increasing left borders (i.e.l1< l2<· · ·< ln).

Asy =f(x), we have

xy6= (1)

Moreover, sincex Sj∗B Sj, for everya, b(1 a bn), we havexa∩xb=(becauseSjis a valid schedule on one machine). Thus, we have

r1l2< r2l3<· · ·< rn−1ln (2) By (1) and (2), we obtain

∀l, 2ln1, xly (3) Without loss of generality, suppose that p(x2) = minn

p(x) :xS

2≤l≤n−1{xl}o

. Thus, we have (n2)p(x2) Pn−1

l=2 p(xl)

2p(x2) Pn−1 l=2 p(xl) (becausen4)

2p(x2) p(y)

(by (3) )

This contradicts the fact thaty =f(x2)(indeed, by defini- tion off, we havep(y)<2p(x2)).

¤ Lemma 3 |S| ≤4Pk

j=1|Tj|

Proof. By Lemma 1, for every machinej(1j k), we have{x:yTjand y=f(x)}=Sj∗B. Thus, we have

|{x:yTjand y=f(x)}| = |Sj∗B| (4) By Lemma 2, we have

|{x:yTjand y=f(x)}| ≤ 3|Tj| (5) By (4) and (5), we obtain

|Sj∗B| ≤ 3|Tj| (6)

Two cases may happen:

If|S| ≤4Pk

j=1|Sj∗A|. By definition ofSj∗A,∀σa Sj∗A, ∃σb S

1≤j≤kTj such that σa and σb come from the same jobΓ. Thus, we havePk

j=1|Sj∗A| ≤ Pk

j=1|Tj|. We obtain:

|S| ≤4

k

X

j=1

|Tj|

If |S| ≥ 4Pk

j=1|S∗Aj |. By definition of S∗Aj and Sj∗B, we haveSj∗ASj∗B =andSj∗ASj∗B =Sj. Thus, we obtain:

|S| = Pk

j=1|Sj∗A|+Pk

j=1|Sj∗B|

|S| |S4|+Pk

j=1|Sj∗B|

34|S| Pk

j=1|Sj∗B|

|S| 43Pk

j=1|Sj∗B|

|S| 4Pk

j=1|Tj| (by (6))

¤

Lemma 4 For every machine numberj (1 j k), we have

min (β,⌊log2(γ)⌋+ 1)· |Sj| ≥ |Tj|

Proof. For everyσ Sj, we define the sequence of as- sociated intervals “rooted” inσbyR(σ) = x1, x2, . . . , xi whereσ=xiandiis the largest integer such that for every l(1l i1),xlhas been replaced byxl+1during the execution of AlgorithmOLU W. By definition ofOLU W, we have

p(x1)2p(x2)22p(x3)≥ · · · ≥2i−1p(xi)

p(x1(σ))

p(xi(σ)) 2i−1

γ 2i−1 (because γ = maxnp(Γ)

p(Γ): Γ,ΓΓ1, . . . ,Γn

o and x1

andxiare intervals associated to jobs in1, . . . ,Γn})

⌊log2(γ)⌋ ≥ |R(σ)| −1

(because|R(σ)|=iis an integer) Thus, we obtain

⌊log2(γ)⌋+ 1≥ |R(σ)| (7)

4

(6)

By definition ofβ, we have

β =

¯

¯

¯

¯

¯

¯ [

Γ∈{Γ1,...,Γn}

{p(Γ)}

¯

¯

¯

¯

¯

¯

¯

¯

¯

¯

¯

¯ [

σ∈R(σ)

{p(σ)}

¯

¯

¯

¯

¯

¯

= |R(σ)| (because, by definition ofOLU W, p(x1)> p(x2)>· · ·> p(xi))

Thus, we obtain

β≥ |R(σ)| (8)

By definition ofSj,TjandR(σ), we have:

[

σ∈Sj

R(σ) = Tj

¯

¯

¯

¯

¯

¯ [

σ∈Sj

R(σ)

¯

¯

¯

¯

¯

¯

= |Tj|

X

σ∈Sj

|R(σ)| ≥ |Tj|

X

σ∈Sj

min (β,⌊log2(γ)⌋+ 1) ≥ |Tj| (by (7) and (8))

min (β,⌊log2(γ)⌋+ 1)· |Sj| ≥ |Tj|

¤ We are now able to give a proof of Theorem 2.

Proof of Theorem 2. By Lemmas 3 and 4, we have

|S| ≤ 4Pk j=1|Tj|

4Pk

j=1min (β,⌊log2(γ)⌋+ 1)· |Sj|

= 4 min (β,⌊log2(γ)⌋+ 1)· |S|

¤ 3.1 Conclusion

We have proposed a (4 min(β,⌊log2(γ)⌋ + 1))- competitive on-line algorithm (called OLU W), solving TCSP onk identical machines, whereβ is the number of different job lengths appearing in the on-line input sequence andγis the ratio between the length of the longest job and the length of the shortest job in the input sequence (note that AlgorithmOLU Wdo not need to know neitherβnorγbe- forehand). We underline the fact that in many situations (corresponding to “homogeneous” jobs), this competitive ratio is constant. For example, whenβ=c(withcany con- stant), AlgorithmOLU Wis4c-competitive. Whenγ= 2c (with c any constant), Algorithm OLU W is (4c + 4)- competitive.

References

[1] R. Adler and Y. Azar. Beating the logarithmic lower bound: Randomized preemptive disjoint paths and call control algorithms. Journal of Scheduling, 6(2):113–

129, 2003.

[2] F. Baille, E. Bampis, C. Laforest, and N. Thibault. On- line bicriteria interval scheduling. In Euro-Par, 2005.

[3] F. Baille, E. Bampis, C. Laforest, and N. Thibault.

On-line simultaneous maximization of the size and the weight for degradable intervals schedules. In CO- COON, 2005.

[4] A. Bar-Noy, R. Canetti, S. Kutten, Y. Mansour, and B. Schieber. Bandwidth allocation with preemption.

SIAM J. Comput., 28(5):1806–1828, 1999.

[5] A. Bar-Noy, G. S., N. J., and S. B. Approximating the throughput of multiple machines in real-time schedul- ing. SIAM Journal on Computing, 31:331–352, 2001.

[6] A. Borodin and R. El-Yaniv. Online computation and competitive analysis. Cambridge University press, 1998.

[7] U. Faigle and W. Nawijn. Note on scheduling intervals on-line. Discrete Applied Mathematics, 58(58):13–17, 1994.

[8] J. Garay, J. Naor, B. Yener, and P. Zhao. On-line admission control and packet scheduling with inter- leaving. In Proceedings of INFOCOM, pages 94–103, 2002.

[9] J. A. Garay, I. S. Gopal, S. Kutten, Y. Mansour, and M. Yung. Efficient on-line call control algorithms.

Journal of Algorithms, 23(1):180–194, 1997.

[10] M. H. Goldwasser. Patience is a virtue: the effect of slack on competitiveness for admission control. In 10th Annual ACM-SIAM Symposium on Discrete Al- gorithms, SIAM, Philadelphia, pages 396–405, 1999.

[11] J. S. Naor, A. Rosen, and G. Scalosub. Online time- constrained scheduling in linear networks. In Proceed- ings of INFOCOM, 2005.

[12] G. Woeginger. On-line scheduling of jobs with fixed start and end times. Theoritical Computer Science, 130(130):5–16, 1994.

Références

Documents relatifs

Note that besides being a valid relaxation of the RCPSP, the problem (P ∆ ) can be used in a project planning context, when resource consumption have to be aggregated over sev-

We consider a project scheduling problem in a context such that temporal aspects (start and completion of activities, precedence between activities) are handled precisely,

In this work, we study real-time energy scheduling strategies to be used by smart control devices within a contract collaboration framework, established between two systems,

We have discussed the well known pulse (PDDT) and step (SDDT) time-indexed formulations and the less well-known on/off time-indexed formulation (OODDT) for the RCPSP, that are

Lopez, 2015, &#34;Flow and energy based satisability tests for the Continuous Energy-Constrained Scheduling Problem with concave piecewise linear functions&#34;, CP Doctoral

Polyhedral results and valid inequalities for the Continuous Energy-Constrained Scheduling Problem.. Margaux Nattaf, Tamás Kis, Christian Artigues,

The objective (16) is to minimize the project duration, assigning a unique start date to each activity [constraints (17)], under both precedence constraints (18) and

In order to model the software pipelining problem, [DAA08] proposes an extension of the clas- sic modulo scheduling problem to Resource-Constrained Modulo Schedul- ing Problems