Preemptive scheduling on a small number of hierarchical machines

Similar documents
Theoretical Computer Science. Optimal algorithms for online scheduling with bounded rearrangement at the end

Problem Set 8 Solutions

List coloring hypergraphs

Lecture 21. The Lovasz splitting-off lemma Topics in Combinatorial Optimization April 29th, 2004

Convex Hulls of Curves Sam Burton

Social Studies 201 Notes for November 14, 2003

Bogoliubov Transformation in Classical Mechanics

New bounds for Morse clusters

Multicolor Sunflowers

Social Studies 201 Notes for March 18, 2005

Competitive Analysis of Task Scheduling Algorithms on a Fault-Prone Machine and the Impact of Resource Augmentation

CHAPTER 8 OBSERVER BASED REDUCED ORDER CONTROLLER DESIGN FOR LARGE SCALE LINEAR DISCRETE-TIME CONTROL SYSTEMS

μ + = σ = D 4 σ = D 3 σ = σ = All units in parts (a) and (b) are in V. (1) x chart: Center = μ = 0.75 UCL =

Optimal Coordination of Samples in Business Surveys

Chapter 4. The Laplace Transform Method

Clustering Methods without Given Number of Clusters

NCAAPMT Calculus Challenge Challenge #3 Due: October 26, 2011

ALLOCATING BANDWIDTH FOR BURSTY CONNECTIONS

arxiv: v1 [math.mg] 25 Aug 2011

Unavoidable Cycles in Polynomial-Based Time-Invariant LDPC Convolutional Codes

Lecture 9: Shor s Algorithm

Computers and Mathematics with Applications. Sharp algebraic periodicity conditions for linear higher order

7.2 INVERSE TRANSFORMS AND TRANSFORMS OF DERIVATIVES 281

Chapter Landscape of an Optimization Problem. Local Search. Coping With NP-Hardness. Gradient Descent: Vertex Cover

Codes Correcting Two Deletions

Online Parallel Scheduling of Non-uniform Tasks: Trading Failures for Energy

List Coloring Graphs

SOLUTIONS TO ALGEBRAIC GEOMETRY AND ARITHMETIC CURVES BY QING LIU. I will collect my solutions to some of the exercises in this book in this document.

arxiv: v4 [math.co] 21 Sep 2014

Online Appendix for Managerial Attention and Worker Performance by Marina Halac and Andrea Prat

Chapter 2 Sampling and Quantization. In order to investigate sampling and quantization, the difference between analog

Control Systems Analysis and Design by the Root-Locus Method

Moment of Inertia of an Equilateral Triangle with Pivot at one Vertex

ON THE APPROXIMATION ERROR IN HIGH DIMENSIONAL MODEL REPRESENTATION. Xiaoqun Wang

Lecture 7: Testing Distributions

4. Connectivity Connectivity Connectivity. Whitney's s connectivity theorem: (G) (G) (G) for special

TRIPLE SOLUTIONS FOR THE ONE-DIMENSIONAL

Lecture 8: Period Finding: Simon s Problem over Z N

SOME RESULTS ON INFINITE POWER TOWERS

LINEAR ALGEBRA METHOD IN COMBINATORICS. Theorem 1.1 (Oddtown theorem). In a town of n citizens, no more than n clubs can be formed under the rules

Chip-firing game and a partial Tutte polynomial for Eulerian digraphs

An Inequality for Nonnegative Matrices and the Inverse Eigenvalue Problem

White Rose Research Online URL for this paper: Version: Accepted Version

c n b n 0. c k 0 x b n < 1 b k b n = 0. } of integers between 0 and b 1 such that x = b k. b k c k c k

Balanced Network Flows

Singular perturbation theory

2 Hatad, Jukna & Pudlak gate, namely we hall tudy the ize of depth-three circuit. The technique we hall ue ha two ource. The rt one i a \nite" verion

IEOR 3106: Fall 2013, Professor Whitt Topics for Discussion: Tuesday, November 19 Alternating Renewal Processes and The Renewal Equation

Discrete Mathematics

Gain and Phase Margins Based Delay Dependent Stability Analysis of Two- Area LFC System with Communication Delays

Electronic Theses and Dissertations

Primitive Digraphs with the Largest Scrambling Index

arxiv: v2 [math.nt] 30 Apr 2015

CHAPTER 6. Estimation

MATEMATIK Datum: Tid: eftermiddag. A.Heintz Telefonvakt: Anders Martinsson Tel.:

Z a>2 s 1n = X L - m. X L = m + Z a>2 s 1n X L = The decision rule for this one-tail test is

ON A CERTAIN FAMILY OF QUARTIC THUE EQUATIONS WITH THREE PARAMETERS. Volker Ziegler Technische Universität Graz, Austria

Assignment for Mathematics for Economists Fall 2016

The Impact of Imperfect Scheduling on Cross-Layer Rate. Control in Multihop Wireless Networks

Laplace Transformation

Design spacecraft external surfaces to ensure 95 percent probability of no mission-critical failures from particle impact.

DIFFERENTIAL EQUATIONS

1. The F-test for Equality of Two Variances

A PROOF OF TWO CONJECTURES RELATED TO THE ERDÖS-DEBRUNNER INEQUALITY

Nonlinear Single-Particle Dynamics in High Energy Accelerators

Avoiding Forbidden Submatrices by Row Deletions

Reliability Analysis of Embedded System with Different Modes of Failure Emphasizing Reboot Delay

UNIQUE CONTINUATION FOR A QUASILINEAR ELLIPTIC EQUATION IN THE PLANE

Comparing Means: t-tests for Two Independent Samples

Symmetric Determinantal Representation of Formulas and Weakly Skew Circuits

Multicast Network Coding and Field Sizes

Online scheduling of jobs with favorite machines

arxiv: v2 [math.co] 11 Sep 2017

Aggregating value ranges: preference elicitation and truthfulness

5. Fuzzy Optimization

Flag-transitive non-symmetric 2-designs with (r, λ) = 1 and alternating socle

CONGESTION control is a key functionality in modern

Performance Evaluation


Minimum Cost Noncrossing Flow Problem on Layered Networks

Linear Motion, Speed & Velocity

Unbounded solutions of second order discrete BVPs on infinite intervals

Tuning bandit algorithms in stochastic environments

Suggested Answers To Exercises. estimates variability in a sampling distribution of random means. About 68% of means fall

ON A CERTAIN FAMILY OF QUARTIC THUE EQUATIONS WITH THREE PARAMETERS

Memoryle Strategie in Concurrent Game with Reachability Objective Λ Krihnendu Chatterjee y Luca de Alfaro x Thoma A. Henzinger y;z y EECS, Univerity o

Random vs. Deterministic Deployment of Sensors in the Presence of Failures and Placement Errors

One Class of Splitting Iterative Schemes

Alternate Dispersion Measures in Replicated Factorial Experiments

THE SPLITTING SUBSPACE CONJECTURE

Physics 741 Graduate Quantum Mechanics 1 Solutions to Final Exam, Fall 2014

If Y is normally Distributed, then and 2 Y Y 10. σ σ

A relationship between generalized Davenport-Schinzel sequences and interval chains

Lecture 10 Filtering: Applied Concepts

66 Lecture 3 Random Search Tree i unique. Lemma 3. Let X and Y be totally ordered et, and let be a function aigning a ditinct riority in Y to each ele

CONTROL SYSTEMS, ROBOTICS AND AUTOMATION Vol. VIII Decoupling Control - M. Fikar

March 18, 2014 Academic Year 2013/14

Chapter 13. Root Locus Introduction

CS 170: Midterm Exam II University of California at Berkeley Department of Electrical Engineering and Computer Sciences Computer Science Division

LOW ORDER MIMO CONTROLLER DESIGN FOR AN ENGINE DISTURBANCE REJECTION PROBLEM. P.Dickinson, A.T.Shenton

Transcription:

Available online at www.ciencedirect.com Information and Computation 06 (008) 60 619 www.elevier.com/locate/ic Preemptive cheduling on a mall number of hierarchical machine György Dóa a, Leah Eptein b, a Department of Mathematic, Univerity of Pannonia, Vezprem, Hungary b Department of Mathematic, Univerity of Haifa, Mount Carmel, 31905 Haifa, Irael Received 11 December 006; revied 11 September 007 Available online 4 December 007 Abtract We conider preemptive offline and online cheduling on identical machine and uniformly related machine in the hierarchical model, with the goal of minimizing the makepan. In thi model, each job can be aigned to a ubet of the machine which i a prefix of the machine et. We deign optimal offline and online algorithm for two uniformly related machine, both when the machine of higher hierarchy i fater and when it i lower, a well a for the cae of three identical machine. Specifically, for each one of the three variant, we give a imple formula to compute the makepan of an optimal chedule, provide a linear time offline algorithm which compute an optimal chedule and deign an online algorithm of the bet poible competitive ratio. 008 Publihed by Elevier Inc. 1. Introduction In thi paper we tudy preemptive online cheduling for cae where ditinct proceor or machine do not have the ame capabilitie. The mot general non-preemptive online cheduling model aume m machine 1,..., m and n job, arriving one by one, where the information of a job j i a vector p j = (pj 1, p j,..., p j m) of length m, where p j i i the proceing time or ize of job j if it i aigned to machine i. Each job i to be aigned to a machine before the arrival of the next job. The load of a machine i i the um of the proceing time on machine i of job aigned to thi machine. The goal i to minimize the maximum load of any machine. Thi model i known a unrelated machine [1]. Many implified model were defined, both in order to allow the deign of algorithm with good performance (which i often difficult, or even impoible, for unrelated machine), and to make the tudied model more imilar to reality. In the equel we decribe a few model which are relevant to our tudy. We conider online algorithm. For an algorithm A, we denote it cot by A a well. The cot of an optimal offline algorithm that know the complete equence of job i denoted by opt. In thi paper we conider the (abolute) competitive ratio. The competitive ratio of A i the infimum R uch that for any input, A R opt. Correponding author. E-mail addree: doagy@almo.vein.hu (G. Dóa), lea@math.haifa.ac.il (L. Eptein). 0890-5401/$ - ee front matter 008 Publihed by Elevier Inc. doi:10.1016/j.ic.007.11.004

G. Dóa, L. Eptein / Information and Computation 06 (008) 60 619 603 If the competitive ratio of an online algorithm i at mot C, then we ay that it i C-competitive. For randomized algorithm, we replace the cot of the algorithm A by it expected cot E(A), and in thi cae, the competitive ratio of A i the infimum R uch that for any input, E(A) R opt. Uniformly related machine [1, 4] are machine having peed aociated with them, where machine i ha peed i and the information that a job j need to provide upon it arrival i jut it ize, or proceing time on a unit peed machine, which i denoted by p j. Then we have pj i = p j/ i. If all peed are equal, then we get identical machine [1]. Retricted aignment [] i a model where each job may be run only on a ubet of the machine. A job j ha a running time aociated it, which i the time to run it on any of it permitted machine, which are denoted by M j. Thu if i M j, then we have pj i = p j and otherwie pj i =. The hierarchical model repreent a ituation where there i a clear order between the trength of machine, in term of the job they are capable of performing. In the hierarchical model, we get that the et M j i a prefix of the machine for any j. In thi paper we conider the retricted related hierarchical model, where machine i ha peed i, job j ha ize p j on a unit peed machine, and may run on a prefix of the machine 1,..., m j, i.e., M j ={1,..., m j }. Therefore, pj i = p j i if i m j and otherwie pj i =. Thu, in thi model, there are at mot m ditinct poible ubet of permitted machine. For a job j whoe et of permitted machine i 1,..., m j, we ay that the job i in the et P mj,orap mj job. That i, the et of job for which the et of permitted machine i 1,..., i i called P i. We lightly abue notation and for every value of i denote by P i alo the um of all P i job. Poible application of thi model can be computer ytem, where the computer differ not only in peed but alo in the capacity of their memorie. Each job ha a memory threhold, which i the minimum memory that a computer mut have in order to run it. Thi create a hierarchy of the computer. Note that the peed of computer are not necearily related to their memorie, and thu a computer that i higher in the hierarchy that i baed on ize of memorie, i not necearily fater than a computer that i lower in the hierarchy. In thi paper, we focu on mall number of machine. We firt tudy the cae of two machine. In thi cae, it i reaonable to aume that the machine that i capable of running any job i fater, ince thi i a tronger machine. However, the oppoite cae can occur in real life a well, when the machine that cannot run every job, i more pecialized, and work fater when it i running the job that it i capable of running. We further conider the cae of three identical peed machine in the hierarchical model. We tudy preemptive cheduling, where the proceing of a job can be hared between everal machine. Thu upon the arrival of job j, it may be cut into piece to be packed a independent job, under the retriction that no two part of the ame job can run in parallel on different machine. The proceing time of the different part of a job are calculated accordingly (i.e., a if thee are indeed independent job). The notion of preemptive cheduling i relevant only to model where the role of time i clear, and therefore it i irrelevant to the general cae of unrelated machine. Note that in thi model, idle time may be ueful. Thu the load of a machine i the completion time of any part of job aigned to it. Alternatively, the load of a machine i the um of proceing time of part of job aigned to thi machine (a they are defined to be on thi machine) plu the total duration during which the machine i idle (but did not complete all the part of job it need to run). The makepan i again the maximum load of any machine. Previou reult. The hierarchical model for general m wa tudied by Bar-Noy, Freund and Naor [3] (ee alo [7]). They deigned a non-preemptive e + 1 3.718-competitive algorithm. Jiang, He and Tang [13], and independently, Park, Chang and Lee [14] tudied the problem on two identical peed hierarchical machine. They both deigned non-preemptive 5 3-competitive algorithm and howed that thi i bet poible. The paper [13] conidered a preemptive model in which idle time i not allowed. Thi i a retricted type of preemptive cheduling, where all machine need to be occupied tarting from time zero and until they complete to run the part of job aigned to them. They deigned a 3 -competitive algorithm and howed thi i bet poible. It i known that in the retricted aignment model, preemption and even cheduling job fractionally, i.e., poibly cheduling everal part of the ame job in parallel, doe not change the order of growth of the bet poible competitive ratio, which i (log n) []. Preemptive cheduling on identical machine and uniformly related machine wa widely tudied. For many problem tight bound on the competitive ratio are known. Chen, Van Vliet and Woeginger gave a preemptive optimal algorithm and a matching lower bound for identical machine [6] (ee alo [15]). The competitive ratio of the algorithm i m m /(m m (m 1) m ). A lower bound of

604 G. Dóa, L. Eptein / Information and Computation 06 (008) 60 619 the ame value wa given independently by Sgall [16]. For two uniformly related machine, with peed ratio 1 between the peed of the two machine, the tight competitive ratio i known to be ( + 1) /( + + 1), given by Eptein et al. [10] and independently by Wen and Du [17]. Thoe reult were extended for a cla of m uniformly related machine with non-decreaing peed ratio [9]. The tight bound in that cae i a cloed formula, which i a function of all the peed. An optimal (in term of competitive ratio) online algorithm for any et of peed wa given by Ebenlendr, Jawor and Sgall [8]. Given a combination of peed, the competitive ratio i a olution of a linear program, and never exceed e.718. The paper how that the reult of Eptein [9] actually hold for a wider cla of peed et, and give a cloed formula for three machine and any combination of peed. A lower bound of on the overall (maximum over all peed combination) competitive ratio wa given by Eptein and Sgall [11], and improved to.054 by Ebenlendr et al. [8]. Our reult. We provide a complete olution for everal problem. We conider the model of two hierarchical machine with all peed combination a well a the model of three hierarchical machine of identical peed. Thi give three variant of the problem, two machine, where the firt machine i fater, two machine, where the firt machine i lower, and three identical machine. In each of thee three variant that we tudy, we contruct a formula to compute the makepan of an optimal chedule, and deign a linear time offline algorithm which contruct uch a chedule. We deign an online algorithm of bet poible competitive ratio for each one of the three cae. The algorithm are determinitic but the lower bound hold for randomized algorithm a well. All algorithm ue idle time, and we how that determinitic algorithm which do not ue idle time cannot achieve the ame competitive ratio. The competitive ratio are a follow: (+1) for two machine, where i the peed ratio between the machine, 3 + +1 (+1) and the firt machine i fater, for two machine, where i the peed ratio between the machine, and ++1 the econd machine i fater, and 3 for three machine.. Two machine, where machine 1 i fater In thi ection we aume without lo of generality that the peed of machine 1 i 1, and the peed of the other machine i 1. Recall that P 1 i the et of job that mut be aigned to machine 1, and P i the et of job that can be aigned to any machine. Let P max be the ize of the larget job in the et P. We tart with ome bound that are valid for any olution and in particular, for an optimal offline algorithm. { Lemma 1. lb = max P1, P 1+P +1, P max 1 + P 1 hold if and only if lb = P 1. } i a lower bound on the cot of any olution. Moreover, P P 1 Proof. The firt bound hold ince all job in P 1 mut be cheduled on the firt machine. The econd bound i valid due to the fact that the um of all proceing time i P 1 + P and + 1 i the um of machine peed. In the third bound, if P max P 1, then we get P max 1 + P 1 = P 1 + P max P 1 P 1. Thu, we only need to conider the cae P max > P 1. Conider an aignment, and a job j of ize P max. Let be the part of thi job aigned to machine 1 and P max the part aigned to machine. Clearly, we have that the firt machine cannot complete all job aigned to it earlier than the time P 1+. Thu, if P max P 1, then we get the required lower bound on the makepan. On the other hand, in order for j to be completed, it ha to run on machine for a time of P max and on machine 1 for time of. Thee time do not necearily need to be in thi order or continuou, but there can be no overlap and thu we get that thi job i completed no earlier than the time P max ( 1). Now, if P max P 1, then we get the required bound on the makepan. For the econd part, P P 1 hold if and only if P 1+P +1 P 1 hold. Thu we got that if lb = P 1, then P P 1.To complete the other direction, we note that if P P 1 i true, then P max P P 1 hold, and o P max 1 + P 1 P 1. We ue the value lb for our online algorithm. It i poible to how that the value lb i not only a lower bound on the makepan of an optimal olution, but i actually equal to thi value.

G. Dóa, L. Eptein / Information and Computation 06 (008) 60 619 605 Theorem. Given a et of job J, the value lb i equal to the makepan of an optimal chedule, and a chedule of thi cot can be contructed by a linear time algorithm. Proof. In order to prove the theorem, we need to conider the three cae, cae by cae, and how a linear time algorithm for each one of the cae. Clearly, the value lb can be computed in linear time. Let k be an index of a job of ize P max.iflb = P 1, then due to Lemma 1, we have P P 1. Thu we chedule all P 1 -job on the firt machine, exactly during the time lot [0, lb]. All other job are cheduled on the econd machine during the time lot [0, P ] [0, lb]. Next, if lb = P max 1 + P 1, then we divide job k into two part of ize P 1 and P max P 1. During the time lot [0, P 1 ], we run the P 1 -job on the firt machine, and the firt part of job k on the econd machine. Note that given the value of lb we have lb P 1, and P max P 1 [. During the time lot P1, P max P 1 + P 1 ], the firt machine run the remainder of job k, and the econd machine run all remaining P -job, which have a total ize of P P max, until time P 1 + P P max. We need to how that P 1 + P P max lb = P max 1 + P 1. Uing P 1+P +1 lb, we have P 1 + P P max = P 1 + P P max P 1 + P 1 ( + 1)lb lb = lb. It i left to conider the cae P 1+P +1 = lb. Iflb P max, then we aign all job of P 1 to the firt machine until time P 1 lb. Afterward, we keep aigning job to thi machine until time lb. The ret of the job are aigned to the econd machine, tarting from time zero. There i enough pace for them ince ( + 1)lb (P 1 + P ). If ome job wa plit between the two machine, then let a be the part aigned to the firt machine, and b to the econd machine. We have a + b P max. The tarting time on the firt machine i lb a and the completion time on the econd machine i b. We have b lb a ince a + b a + b lb. Thu there i no overlap. Otherwie, we define = P max lb P max ( 1). We aign a part of ize P max of job k on the firt machine from time lb P max until time lb, and the ret on the econd machine from time zero till time lb P max = (1 )P max, by definition of. The remaining lot on the machine are non-overlapping. We next aign all P 1 -job to the firt machine tarting from time zero, and afterward, the remaining P -job, to empty lot. Since lb P 1+P +1, there i enough pace for all job. We need to how that the pace on the firt machine i enough for the P 1 -job, i.e., that P 1 + P max lb. By the definition of, thi i equivalent to, P 1 which hold by the definition of lb. + P max lb 1 lb,orlb P max + P 1( 1), We replace the notation lb with the notation opt ince we have hown that lb i exactly the cot of an optimal chedule. We continue with a lower bound on the competitive ratio. Lemma 3. Any randomized algorithm A ha competitive ratio of at leat (), where () = (+1) (+1)+1. Proof. We pecify a equence which prove the tatement. We ue an adaptation of Yao principle [18] for proving lower bound for randomized algorithm. It tate that a lower bound for the competitive ratio of determinitic algorithm on a fixed ditribution on the input i alo a lower bound for randomized algorithm and i given by E(A) E(opt). Let X 1 be a real number. The lit of job i a follow. The firt job i a P 1 -job, where p 1 =. The following two job are P -job, p = X +1 + and p (X 1) 3 = +1. Note that we have p + p 3 = X, and p 3 = (p 1). The fourth job i a P -job, p 4 = X + 1. The fifth job i a P 1 -job, p 5 = X + X. According to Yao reult, we conider a determinitic algorithm A. Denote by opt k, A k the cot of an optimal olution and of algorithm A for the input which conit of the firt k job. We have opt 3 = p = +X +1 (by aigning job to the econd machine, and the other job to the firt machine), opt 4 = X + 1 (by aigning job 1 to machine 1 in parallel with a part of job 4 on machine, and the other job to machine, in parallel with the other part of job 4 on machine 1), and opt 5 = X + X + 1 (by aigning the P 1 -job, and only thee job, to machine 1). Suppoe that algorithm A i r-competitive, for ome r 1. Let c be the um of part of the econd and third job which are aigned to the firt machine, let d 1 be the um of part of thee job aigned to the econd machine when the firt machine i idle (after the firt three job are aigned), and d the um of part of thee job aigned to the econd machine when the firt machine i buy. Then d 1 + d + c = X. Let b be the part of the fourth job which i aigned to the firt machine, then

606 G. Dóa, L. Eptein / Information and Computation 06 (008) 60 619 a part of ize X + 1 b of thi job i aigned to the econd machine. Then the next inequalitie hold. A 3 1 + c + d 1 A 5 1 + c + b + (X + X) A 4 d + (X + 1 b) + b All inequalitie are lower bound on the makepan at variou time. In the firt inequality, the total ize aigned to run on the firt machine after the firt three job have arrived i + c, and an additional ize of d 1 i aigned to run on the other machine when the firt machine i idle. The econd inequality hold due to the total ize aigned to the firt machine after all job have arrived. The third inequality hold due to the time after four job have arrived. There are d unit of time buy on both machine before the fourth job i cheduled. The time to run thi job due to the way it i plit between machine i b + p 4 b. We ue the equence of the firt three job with probability +1 1, the equence of four firt job with probability 1 1 +1, and the equence of all five job with probability +1. Thu the expected cot of an optimal offline algorithm i 1 + 1 (opt 3 + ( 1)opt 5 + opt 4 ) = 1 ( + X + 1 + 1 On the other hand, the expected cot of A i at leat 1 ) + ( 1)(X + X + 1) + X + 1. +1 (A 3 + ( ( 1)A 5 + A 4 ) (1 ) ) + c + d 1 + ( 1 + c c + b b + X( 1)(+ 1) 1 +1 = + X +X +1 +1, where the lat equality follow from c + d 1 + d = X. Since the algorithm i r-competitive, we get, ( + X + X + X + 1 r + 1 from which follow that ) + ( 1)(X + X + 1) + X + 1, ( + 1) (X + 1) r + X + (+ 1)(X + 1) = ( + 1) +X + (+ 1). X +1 ( )) + d + (X + 1 b) + b (+1) Letting X tend to, the right hand ide can get arbitrarily cloe to (+1)+1/ and therefore the next inequality hold for every 1: ( + 1) r (+ 1) + 1. Now we turn to how that there exit an algorithm which achieve the previou lower bound. In the equel we ue = () = (+1) ++1/, and introduce an -competitive (thu optimal) algorithm. We define t() = t = + 1 ++1/ and 1 t = ; both are poitive and maller than 1 for any peed. 1+1/ ++1/ Lemma 4. The next propertie hold for any 1 for t and defined above. 1. 1 + t =.. (1 t)( + 1) = and thu (1 t)( + 1).

G. Dóa, L. Eptein / Information and Computation 06 (008) 60 619 607 3. (1 t + t/) (+1) + = Proof. 1. 1 + t = ++1/++1 1/ ++1/. (1 t)( + 1) = (1+1/)(+1) ++1/ 3. (1 t + t/) (+1) + = 1++1 ++1/ = +++1 ++1/ = (+1) ++1/ =. (+1) = ( ++1/) =. (+1) + = (+1) ++1/ =. Let J be a given prefix of the input. We ue the following definition for the algorithm. We partition the time lot [0, C] into ub-interval according to the ubet of the machine that are buy during the variou interval. There are three type of interval that can be ued to aign a new job, which are interval where at leat one machine i not buy. An interval i called left hole, if the econd machine i buy and the firt machine i not, and right hole, if the role of machine are oppoite. If both machine are not buy, then we call the interval uper hole. We ue the ame term to denote the union of interval of the ame tatu, thu e.g., we refer by uper hole to the union of interval where both machine are not buy. The fourth type of interval where both machine are buy i called dene, and the union of dene interval i called the dene part. The length of the left hole, right hole, uper hole, and dene part be denoted by L(J), R(J), S(J) and D(J), repectively. Thee value refer to the ituation before the lat job in J i cheduled. The algorithm will follow the next condition. a. All P 1 -job are aigned to the firt machine. P -job are alway plit into two part of ratio t : (1 t) between the ize of thee part. The aignment i done a follow. Firt, the t fraction of the job i aigned to the firt machine, next the remaining part, which i a (1 t) fraction of the job, i aigned to the econd machine. b. We denote by C(J) = opt(j), where opt(j) i the current value of the bound opt (which i computed given the job of J ). Every job i aigned to a et of time interval which are fully contained in the interval [0, C(J)]. We prove later that uch an aignment i alway poible. c. When a new job i aigned, we try to occupy a much a poible of the uper hole. If neceary, the left or right hole are ued a well. Conider the aignment of job j of ize p j, which i a P -job. We define y(j) = max{(1 t)p j R(J),0}, where J ={1,,..., j}. Ify(J) i poitive, then ince we would like to aign a part of ize (1 t)p j of j to the econd machine, at leat a part of ize y(j) mut ue the uper hole on thi machine. Thi mean that we may ue at mot an interval of length S(J) y(j) of the uper hole on the firt machine, to chedule the part of ize tp j, which hould run on the the firt machine. We are now ready to define our algorithm. Algorithm 1. Denote the next job by p j. Let C(J) be defined a C(J) = opt(j) (where J ={1,,..., j}). Job j i cheduled within the interval [0, C(J)] a follow. 1. p j P 1. Schedule a part of j which i a large a poible into the uper hole, if neceary, chedule the remainder of j into the left hole.. p j P. Firt a part of ize tp j i aigned to the firt machine, a maximum amount of it i aigned to the uper hole, but no more than S(J) y(j). The remainder, if it exit, i aigned into the left hole. Next, the part of ize (1 t)p j of the job i aigned to the econd machine. Firt, a maximum amount i aigned to the uper hole, and then the remaining part i aigned into the right hole. We illutrate the action of the algorithm uing the following example. Conider a equence of three job, where the firt two are in P, and the third one i in P 1. Their ize are 13, 6 and 13. Let =, then we get = 18 13, t = 10 13 and 1 t = 13 3. The value of C(J) for the three job are 9, 18 and 4. Before the aignment of the firt job, we have J ={1} and there i only a uper hole of ize 9 (the length of the left hole, the right hole and the dene part are all zero). Therefore the value of y(j) i 3, o only a part of length 6 of the uper hole may be ued on the

608 G. Dóa, L. Eptein / Information and Computation 06 (008) 60 619 Fig. 1. The aignment of the firt job in the example for Algorithm 1. Fig.. The aignment of the econd job in the example for Algorithm 1. firt machine. According to the algorithm, a part of ize 10 hould be aigned to the firt machine, to occupy a lot of ize 5. The part of ize 3 i aigned to the econd machine. Since there i no right hole, it i aigned to the uper hole (ee Fig. 1). Next, before the econd job i aigned, we have J ={1, } and there i a uper hole of length 10, a left hole of length 3, and a right hole of length 5. There i no dene part at thi time (i.e., it ha a length of zero). Therefore, at thi time y(j) = 1. The part of the job of ize 0 hould be aigned into time lot of total length 10 on the firt machine. However, we have S(J) y(j) = 10 1 and thu one unit of time i reerved for the econd job in the left hole (the additional unit of time in the uper hole i reerved to be ued on the econd machine). The part of the job of ize 6 i aigned to the econd machine, one unit of ize into the uper hole, and the ret into the right hole (ee Fig. ). Finally, before the lat job i aigned, we have J ={1,, 3} and there i a uper hole of length 6, a left hole of length 3, a right hole of length 9, and a dene part of length 6. Since thi job i in P 1, a part of the job of ize 1 i aigned to the uper hole (on the firt machine) and the remainder into the left hole (ee Fig. 3). We need to how that the algorithm can aign all the job, that i, that the deignated interval are large enough to contain each job. Theorem 5. The algorithm i correct, i.e., it can aign all the job for any input.

G. Dóa, L. Eptein / Information and Computation 06 (008) 60 619 609 Fig. 3. The aignment of the third job in the example for Algorithm 1. Proof. Firt we prove that the P 1 -job and t part of the P -job alway fit into the time-interval [0, C(J)] on the firt machine, and the (1 t) part of the P -job alway fit into the time-interval [0, C(J)] on the econd machine, where C(J) = opt(j). We firt how that there i enough pace, and later we how that no overlap i created. The key property of the algorithm i to chedule part of job on the firt machine enuring that there i enough available pace left on the econd machine in thi proce. Cae a. P P 1 /. By Lemma 1, opt = P 1 /. Then we have, P 1 + tp P 1 + t P 1 = ( 1 + t ) P1 opt and (1 t)p (1 t) P 1 P 1 = opt, where the firt inequality hold due to Lemma 4, and the econd one trivially hold ince 1 t<1 <. Cae b. P >P 1 /, then, and P 1 +tp = P 1 + +1 1/ ++1/ P = +1 ++1/ P 1 + 1/ ++1/ P 1 + +1 1/ ++1/ P +1 ++1/ P 1 + 1/ ++1/ P + +1 1/ ++1/ P = +1 ++1/ (P 1 + P ) = (+1) ++1/ P 1 +P +1 opt (1 t)p = 1 + 1/ + + 1/ P ( + 1) ( + + 1/ ) P 1 + P opt. + 1 It therefore follow, that job part that are aigned to the two machine alway fit into the time interval [0, C(J)]. It remain to how that the aignment can be done properly, avoiding overlap. All P 1 -job are aigned to one machine, thu they cannot create overlap and it remain to deal with P -job. Let X be the firt P -job for which the algorithm i not correct (we ue X to denote it ize a well). We define J to be the equence of job up to X (including X ). If y(j) = 0, then we get that R(J) (1 t)p j, and thu the part of X of ize (1 t)x can be aigned. Moreover, it i allowed to ue all the empty pace on the firt machine for the part of X of ize tx, we already howed that it i enough to aign thi job. On the other hand, if y(j) > 0, then thi mean that a part of ize y(j) of the uper hole wa reerved for thi part, unle the uper hole i not

610 G. Dóa, L. Eptein / Information and Computation 06 (008) 60 619 large enough. However, we know that there i enough pace for each job, thu S(J) + R(J) (1 t)x, and the econd part can alway be aigned. In the cae opt(j) = P 1, we have P P 1 by Lemma 3, thu, not only the part of ize (1 t)p, but even the entire amount P fit into the right hole, which i of ize at leat P 1. Thu y(j) = 0 in thi cae. Since we proved that on the firt machine there i enough pace for all part of job, if we are allowed to ue the entire pace on that machine, then it i left to conider the other two option of the value of opt and the cae y(j) > 0. We need to how that the amount of pace allocated on the firt machine i large enough to accommodate the part of ize tx. Thi pace include the complete left hole plu a part of the uper hole. We require that, (S(J) [(1 t)x R(J)]) + L(J) tx (S(J) + R(J) + L(J)) (1 t)x + tx (C(J) D(J)) ( + t t) X C(J) D(J) (1 t + t/) X D(J) C(J) (1 t + t/) X (1) A it turned out, the exact ize of the left hole, right hole and uper hole do not matter, but only their total ize, which need to be large enough. That i, the dene part of the chedule mut be mall enough. Thu, now we compute thi dene part of the chedule a follow. Firt uppoe the job that precede X doe not caue an increae of the dene part of the chedule. Note that the function opt(j) and C(J) are non-decreaing in the variable P 1, P and P max, thu, if (1) doe not hold, then we can omit thi job from the intance and get a counterexample. Clearly, if D(J) = 0, then (1) hold. Thi proce mut terminate before all job are removed ince at leat two job need to be aigned in order to create a non-empty dene part. Thu it can be uppoed that the job right before X increae the dene part of the chedule. From thi it follow that jut before X arrive, (before the value of C i updated), there i no uper hole. The dene part can increae only if the uper hole i fully ued, ince if the uper hole i not fully ued on the firt machine, then the pace which i reerved within the uper hole i filled on the econd machine. Conider the moment of the execution of the algorithm jut before aigning X, i.e., right after the lat job before X wa aigned. The total ize of part of job aigned to the firt machine i P 1 + t(p X), and they occupy a total time which i P 1+t(P X). The total ize of part of job aigned to the econd machine i (1 t) (P X). Both machine may ue the interval up to time C(J \X). Since there i (temporarily) no uper hole, the econd machine i buy during the time period where the firt machine i not buy, and thu the overlap when both machine are buy i, D(J) = (1 t)(p X)+ P 1 + t(p X) Subtituting thi value into (1), it remained to how that C(J \X) = P 1 + (1 t + t/) (P X) C(J \X). P 1 + (1 t + t/) (P X) C(J \X) C(J) (1 t + t/) X,i.e., P 1 + (1 t + t/) P (opt(j) + opt(j \X)). () Cae a. opt(j) = P 1+P +1. Let Z 0 be a value uch that P 1+P +1 = P 1 + Z. Then P = P 1 + ( + 1)Z, and ince P max 1 + P 1 P 1+P +1 = P 1 + Z, the maximum ize of any P -job i at mot P 1 + Z. In particular, it follow that X P 1 + Z. Therefore, opt(j \X) P 1+(P X) +1 P 1+ ( P1 +(+1)Z P 1 ) Z +1 = P 1+Z +1. We get, ( ) P 1 + (1 t + t/) P = P 1 + + P1 ++1/ + ( + 1)Z ( ) = 1 + + P1 ++1/ + (+)(+1) ++1/ Z = +++1/ P 1 ++1/ + (+)(+1) ( ) ++1/ Z (+1)(+1) P 1 ++1/ + (+1)(+) ++1/ Z = +1 P 1 +1 + + (( ) ( ) ) ( +1 Z ) = 1 + +1 P1 + 1 + +1 1 Z = P1 + Z + P 1+Z +1 (opt(j) + opt(j \X)).

G. Dóa, L. Eptein / Information and Computation 06 (008) 60 619 611 Cae b. opt = P max 1 + P 1 = P 1+Y, where Y = P max P 1 0. We define P = P P max. Uing P 1+P +1 P 1+Y we get P P max = P Y + P 1 Y, and thu P Y. Clearly, X P max, and thu opt(j \X) P 1+P +1. Let. Then we get, 0 1 be a value for which P = Y P 1 + (1 t + t/) P = P 1 + + ( Pmax + P P 1 + + 1/ ) = ( = 1 + + + + 1/ ( + 1) + + 1/ ( P 1 + Y = + 1 P 1 + 1 + P 1 + Y + 1 ) P1 + + + + 1/ + + + + 1/ ( Y + P 1 + Y ) ( 1 + ) Y = + + + 1/ ( + + 1/ ) P ( + )(+ ) 1 + ( + + 1/ )Y ( ( ( + 1) + 1 + + 1 + + + 1/ (+ 1) Y = P 1 1 + 1 + + / ) ) Y + 1 ) ( P1 + Y = + P 1 + P ) (opt(j) + opt(j \X)), + 1 where the firt inequality follow from the fact that ( + )(+ ) ( + 1)(+ 1 + ) hold for any poible value of, and + + + 1/ ( + 1)( + 1) hold for any 1, which complete the proof. We have een that for any peed 1, Algorithm 1 i -competitive. Comparing thi ratio with Lemma 3,we conclude that Algorithm 1 ha an optimal competitive ratio. A can be een above, Algorithm 1 ue idle time. An intereting quetion i whether thi i done for convenience. The reult of Jiang et al. [13] implie that for = 1, an algorithm which doe not ue idle time ha competitive ratio of at leat 3. Subtituting = 1 into our bound we ee that uing idle time reduce the competitive ratio. Therefore, for = 1, an algorithm of optimal competitive ratio (among uch that do or do not ue idle time) mut ue idle time. We how that thi i true for all value of, thu motivating the uage of idle time in our algorithm. Claim 6. For any 1, a determinitic algorithm which doe not ue idle time ha competitive ratio which i trictly larger than () = (+1) (+1)+1. Proof. Conider the following equence and an algorithm A that doe not ue idle time. The firt job i a P -job, where p 1 =. The econd job i a P 1 -job where p = 3. The only way to avoid idle time i to aign the firt job completely to one of the two machine. If the firt job i aigned to the econd machine, then the only poible chedule i that both machine run job from time zero till time. If thi job i aigned to the firt machine, then we have that thi machine i running both job, and complete them at time +. For thi input, the >()for 1. In the firt cae, firt option i optimal and o in the econd cae, the competitive ratio i 1 + 1 if >, then the equence which conit of the firt job only give the competitive ratio. For > we have >()and we are done. Otherwie (for ), the equence continue with a P -job, p 3 = +. Since before the arrival of thi job, the machine are balanced, it ha to be aigned completely to one of the machine, to avoid idle time. If it i aigned to the econd machine, then we get A = +, wherea opt + (by running only the third job on the econd machine), which give the competitive ratio +1 +1 >()for all 1. Otherwie, the lat job i a P 1 -job, p 4 = 3 +. Thi job mut be aigned to the firt machine and thu we get = + + 1, and opt = +, which give the competitive ratio ++1. Thi value i + A = 3 + ++ 3 + trictly larger than () for all. 3. Two machine, where machine i fater Aume that peed of the firt machine i 1, and of the econd machine i 1. Note that without hierarchy level there exit a (+1) -competitive optimal algorithm for the problem [10,17]. We will ee that thi cae i ++1 impler than the previou one, ince we will get thi competitive ratio. We again tart with ome bound that are valid for any olution and in particular, for an optimal offline algorithm.

61 G. Dóa, L. Eptein / Information and Computation 06 (008) 60 619 { } Lemma 7. lb = max P 1, P 1+P +1, P max i a lower bound on the cot of any olution. Moreover, lb = P 1 if and only if P 1 P. Proof. The firt bound hold ince all job in P 1 mut be cheduled on the firt machine, which ha peed 1. The econd bound i valid due to the fact that the um of all proceing time i P 1 + P and + 1 i the um of machine peed. The third bound hold ince the job of ize P max mut be completed. To prove the econd part, we have P 1 P 1+P +1 if and only if P 1 P, thu it remain to how that if P 1 P, then we have P max P 1. Thi hold ince P max P. We ue the value lb for our online algorithm. It i again poible to how that the value lb i not only a lower bound on the makepan of an optimal olution, but i actually equal to thi value. Theorem 8. Given a et of job J, the value lb i equal to the makepan of an optimal chedule, and a chedule of thi cot can be contructed by a linear time algorithm. Proof. Let k be an index of a job of ize P max.if P max + P 1 lb, then we ue the following chedule. All P 1 -job are aigned on machine 1, from time zero until time P 1 and job k i aigned on machine, tarting from time lb P max until time lb. The unued lot on the two machine are non-overlapping, thu we ue them to aign the other job. There i enough room ince ( + 1)lb P 1 + P. Otherwie, let be defined a = lb P 1 P max ( 1)P max 0. We aign a part of job k of ize P max to the firt machine, during the time interval [P 1, P 1 + P max ], and the ret of the job to the econd machine during the time interval [P 1 + P max, lb], which due to the definition of can accommodate exactly the part of ize (1 )P max of job k. The ret of the P -job are cheduled within the remaining time lot, which are non-overlapping. There i enough room ince ( + 1)lb P 1 + P. Once again, we replace the notation lb with the notation opt ince we have hown that lb i exactly the cot of an optimal chedule. We continue with a lower bound on the competitive ratio. In thi ection we prove that the bet poible competitive ratio i () = = (+1) ++1 = 1 +. We tart ++1 with the lower bound. Lemma 9. Any randomized algorithm A ha competitive ratio of at leat (), where () = (+1) ++1 = 1 + ++1. Proof. Any intance of the problem on uniformly related machine (with no hierarchy) i an intance of our problem where all job are P -job. Therefore, any lower bound for that cae i valid for our problem. Therefore, ince a lower bound of () = (+1) ++1 = 1 + on the competitive ratio of any algorithm for the problem ++1 on uniformly related machine with no hierarchy i given in reference [10,17], thi implie the lower bound the more general problem with hierarchy. (+1) We introduce a new, -competitive algorithm. We ue notation imilar to thoe in the definition of ++1 Algorithm 1. We define C(J) = opt(j), and each job i cheduled fully within the time interval [0, C]. Weue the ame definition of left hole, right hole, uper hole, and dene part, a in the previou ection. In thi cae, a greedy approach that ue the econd machine a much a poible, and prefer the uper hole to the right hole, give an algorithm of bet poible competitive ratio. Algorithm. Let p j be the next job, and define C = opt(j) (where J ={1,,..., j}). Job j i cheduled within the interval [0, C] a follow. 1. p j P 1. Schedule a part of j which i a large a poible into the uper hole, if neceary, chedule the remainder of j into the left hole.. p j P. Schedule a maximum part of the job into the uper hole on the econd machine, if neceary continue and aign a maximum part of the remainder into the right hole, the remaining part (if exit) i aigned into the left hole.

G. Dóa, L. Eptein / Information and Computation 06 (008) 60 619 613 We how a imple example of the action of the algorithm. Conider a equence of three job of ize 7, 14 and 4, where the firt job i in P 1 and the other two are in P. Aume that =. We have = 9 7. The three value of C(J) are 9, 9 and 7. The firt job can only be aigned to the firt machine. The econd job can fit completely on the econd machine. It i aigned o that the uper hole (of ize ) i filled firt, and the remainder i aigned to the right hole. The third job occupie the entire uper hole and right hole, and a remainder of ize till remain, and i aigned to the left hole, to occupy the left hole completely a well (ee Fig. 4). Fig. 4. An example for Algorithm. Theorem 10. The algorithm i correct, i.e., it can alway aign all the job. Proof. Aume by contradiction that ome job cannot be aigned. Suppoe that J i a minimal counterexample in term of number of job, let n be the lat job and and denote it ize by X (we ue X to denote the job n a well). Clearly, X cannot be aigned and every job before X can be aigned. Note that X i not the only job in the counterexample. Thi i true ince by the definition of the formula that compute the value opt, in both cae (job 1 i a P 1 -job or a P -job), it can alway be aigned into the uper hole. Firt uppoe that X P 1. If the job before the lat job i a P 1 -job a well, then by replacing the two lat job with one with ize p n 1 + p n, the value of the opt remain the ame, therefore thi modified job alo doe not fit into the relevant hole (the uper hole and the left hole), and we get a counterexample with fewer job, which i a contradiction. Therefore, if X i a P 1 -job, then it follow that it predeceor i a P -job; we denote job n 1 and it ize by Y. If job Y doe not ue any part from the left hole, then omitting it we get a maller counterexample, which lead to a contradiction. Thu it ue a non-zero part of the left hole. Due to the definition of the algorithm, it follow that it totally ue the uper hole and the right hole, i.e., the total running time aigned to the econd machine, jut { after Y i aigned, i C(J \X) and there i no idle time on the econd machine. Since opt (J \X) = max P 1 X, P 1+P X +1, P max }, it hold that C(J \X) (+1) P 1 +P X ++1 +1. It follow that the total ize of job aigned to the firt machine (denoted by C 1 ) i at mot the total ize of all P 1 -job, plu the total ize of P -job that do not fit on the other machine. C 1 P 1 + P (+1) P 1 +P X ++1 = 1 ++1 (P 1 + P ) + (+1) (+1) ++1 max { P1 +P +1, X } max +1 = P 1 + P (+1) ++1 (P 1 + P X) ++1 X = +1 P 1 +P ++1 +1 + (+1) { } ++1 X P1 +P +1, P 1 opt. Since X can be aigned to any lot on the firt machine, without any rik of overlap, it follow that X can be aigned within the dedicated interval, which i a contradiction.

614 G. Dóa, L. Eptein / Information and Computation 06 (008) 60 619 Next, we conider the cae X P. Let U be the lat job before X which doe not only ue the uper hole (i.e., if it i a P 1 -job, then it ue ome non-empty part of the left hole, and if it i a P -job, then it ue the ome non-empty part of the right hole, and poibly a part of the left hole a well). If U doe not exit, then we add a dummy job of ize zero a a firt job in the equence. Thi mean that after job U i aigned, all further P 1 -job are aigned into the uper hole, onto the firt machine. We denote thee job and their total ize by Z 0. All further P -job after U and before X are aigned into the uper hole onto the econd machine. We denote thee job and their total ize by Y 0. Since we are intereted in the union of job of each type, and not in the pecific job, we may aume that Y and Z are ingle job (poibly of ize zero). The behavior of the algorithm on thee job would be the ame not matter how Y and Z are partitioned into job. Conider the moment jut after aigning U, and let J 0 be defined a J 0 = J \{X, Y, Z}. According to the definition of the algorithm, C(J 0 ) (+1) P 1 +P X Y Z ++1 +1. After aigning U the whole uper hole i ued. If U P 1, then U fill the complete uper hole on the firt machine, and if U P, then it complete thi uper hole on the econd machine. Let the left and right hole at thi moment (after aigning U) be denoted imply a L and R (i.e., if T i the job arriving right after U, then L = L(J 0 T) and R = R(J 0 T)). Then the total proceing time aigned to the firt machine i C(J 0 ) L, and thu the proceing time aigned to the econd machine at thi time i exactly P 1 + P X Y Z (C(J 0 ) L). The job which arrive between U i aigned and X arrive are aigned to the uper hole at each time. Specifically, the job with total ize Y are aigned totally to the econd machine, and the total proceing time aigned to the econd machine will become P 1 + P X Y Z (C(J 0 ) L) + Y = P 1 + P X Z C(J 0 ) + L. The left hole increae only when job are aigned into the uper hole on the econd machine, and doe not change if job are aigned to the firt machine. Therefore, the left hole jut before X arrive ha ize L + Y. Thi i the pace available for X on the firt machine. We need to how that the ize of the uper hole and right hole on the econd machine i at leat X L Y and the remainder of X actually fit into the right hole and the uper hole. It uffice to how that if the remained part of X i aigned to the econd machine, then the total load of the econd machine (not including idle time) i bounded from above by (+1) -time opt. We denote ++1 thi value by C and get: C P 1+P X Z C(J 0 )+L + X L Y/ = P 1+P Z C(J 0 ) Y/ P 1+P (+1) ( ++1) P 1+P X Y Z +1 Z Y = ++1 1 ( ++1) (P 1 + P ) + +1 ( ++1) X + ( +1 (+1) ++1 P 1 +P +1 + +1 ++1 { max P1 +P +1, P max } ) ++1 1 Y +Z { X (+1) ++1 max P1 +P +1, X opt = C, where the econd inequality follow from 1 and the bound on C(J 0 ), and the third inequality follow from +1 ++1 < 1. Since no idle time i enforced on the econd machine, we get that X can be completely aigned by the algorithm. A in the previou ection, we how that idle time i neceary in order to obtain an optimal competitive ratio. Claim 11. A determinitic algorithm which doe not ue idle time ha competitive ratio which i trictly larger than () = 1 + ++1. Proof. Conider an algorithm A which doe not ue idle time. The equence tart with the job p 1 = and p = 1, where job 1 i a P -job and job i a P 1 job. A in the previou ection, there are exactly two poible aignment given that idle time cannot be ued at any tep. Either both machine run the two job until time 1, or machine 1 i running both job until time + 1. In the econd cae opt = 1, which clearly give competitive ratio which i much higher than (). Otherwie, a third job, which i a P -job, of ize p 3 = + arrive. We now have opt = + 1. The machine are balanced, thu the bet that can be done now without introducing idle time, i to run it on the fater machine. We get A = +. Since + +1 >()for any 1, the claim i proved. }

G. Dóa, L. Eptein / Information and Computation 06 (008) 60 619 615 Note that the algorithm in thi ection a well a the algorithm of the previou ection are two algorithm of optimal competitive ratio if = 1. 4. Three identical peed machine In thi ection, we invetigate the cae of three hierarchical machine with identical peed. In thi cae we can give an optimal algorithm, which i a imple generalization of Algorithm. We again tart with lower bound on the cot of any olution, and in particular on the optimal makepan. In thi ection P max denote the larget ize of any job. Recall that P 1, P and P 3 are the ubet of job that can be aigned to machine in the et {1}, {1, } and {1,, 3}, repectively. We tate and prove the next lower bound for general m. Thu uppoe that there are m machine of identical peed. { Lemma 1. For a given input, we define lb = max P 1, P 1+P,..., P 1+P + +P m m, P max }. Then lb i a lower bound on the makepan for any olution for thi input. Proof. The firt m bound hold ince all machine have peed 1. Moreover, we can get imilar bound for ubet of the machine et. P 1 -job are run only on machine 1, the union of P 1 -job and P -job i run on the firt two machine, and imilarly, the union of P 1 -job, P -job,..., P i -job i run on the firt i machine. The lat bound hold ince the larget job mut be completed. We ue the value lb with m = 3 for our online algorithm. It i poible to how here a well, that the value lb i not only a lower bound on the makepan of an optimal olution, but i actually equal to thi value. We again tate and prove thi reult for any m. Theorem 13. Given a et of job J, the value lb i equal to the makepan of an optimal chedule, and a chedule of thi cot can be contructed by a linear time algorithm. Proof. We aign job to the interval [0, lb] of the machine a follow. On each machine, we aign job tarting from earlier time until later time. We tart with machine 1, then machine, then machine 3, and o on. We firt aign P 1 -job, then P -job,..., and finally P m -job. We have at mot m 1 job that were plit between machine. If a job i plit, then it i cheduled until time lb on one machine, and tarting time zero on the next machine. Since lb P max, there i no overlap caued. Since lb P 1, all P 1 -job are aigned to the firt machine. Since lb P 1+P, all P job are aigned to one of the firt two machine, and o on, finally, ince lb P 1+P + +P m m, there i enough pace for all job to be aigned. Similarly to before, we replace the notation lb with the notation opt ince we have hown that lb i exactly the cot of an optimal chedule. We continue with a lower bound on the competitive ratio. We will how that the bet competitive ratio for m = 3i 3 m. We tart with proving a lower bound m+1 for m machine. Lemma 14. Any randomized algorithm A, for preemptive cheduling on m hierarchical machine of equal peed, ha competitive ratio of at leat m+1 m. Proof. We again apply Yao method [18]. Our input conit of m et of job; the um of each et i 1. The job of the firt et are P m -job, the job of the econd et are P m 1 -job, and o on, and the job of the lat et are all P 1 -job. The ize of all job are m 1. The m input (one et, two et,..., and finally all m et) arrive with equal probabilitie. Conider a determinitic algorithm A. Let a i,j, i = 1,..., m, j = 1,..., m + 1 i be the total ize of job from the ith et aigned to the jth machine, repectively. (The job from the ith et are allowed to be aigned only to the firt m + 1 i machine). We ue A i and opt i to denote the makepan of A and an optimal algorithm for the equence of i et of job. We have opt 1 = m 1, opt = m,, opt i = m i, and finally opt m = m m = 1. Therefore, E(opt) = m 1 1++ +m m = m+1 m.we have A 1 a 1,m, A a 1,m 1 + a,m 1, A 3 a 1,m + a,m + a 3,m, and generally A i a 1,m+1 i + a,m+1 i +

616 G. Dóa, L. Eptein / Information and Computation 06 (008) 60 619 m i m +a i,m+1 i. Finally, A m a 1,1 + a,1 + +a m,1. Thu E(A) m 1 a j,m+1 i = m 1 i=1 j=1 i=1 1. Let r be the competitive ratio of A. We have r E(A) m E(opt) m+1. m+1 i j=1 a i,j = 1 m m 1 = Note that when m = 3, the value of the lower bound above i 3. Let opt j be the value of opt for the equence of the firt j job. In the next algorithm again a greedy approach which ue machine with higher indice firt, and allocate enough pace on thee machine, give the deired reult. Algorithm 3. 0. Let j be the next job to be aigned. Let i {1,, 3} be uch that j i a P i -job and let C j be defined a C j = 3 opt j. 1. Let k i be the maximum index for which there exit an available time interval for cheduling on machine k within the time-interval [ 0, C j ]. We ue uch available time-interval a long a the job require additional running time, a follow. Firt aign a maximum length in of interval where all machine are idle (either fill thee interval or aign the complete job). Next, ue a maximum length of interval where only one of the other two machine i buy. Finally, ue the interval in which both other machine are buy.. If the complete job i cheduled, then go to 0 (and conider the next job). Otherwie go to 1. Theorem 15. Algorithm 3 i 3/-competitive and thu it i optimal. Proof. We would like prove that all job can be cheduled. Suppoe by contradiction that the algorithm i not 3/-competitive, and let I be a counterexample. Without lo of generality, we can aume that all job in I are cheduled uccefully, except for the lat job which cannot be cheduled. We denote the lat job a well a it ize by X, and it index by n. Then opt = opt n and we define C = C n. We tart with proving three lemma regarding the tructure of the counterexample. Afterward, we examine the lat job X carefully and how that it cannot exit, which prove the theorem. Lemma 16. Without lo of generality we may aume that for the counterexample opt = P 1+P +P 3 3 hold. Proof. Otherwie we add tiny P 3 -job to the example, which arrive right before the lat job, and clearly the lat job cannot be cheduled in thi cae a well. We add a number of uch job o that the value of opt remain exactly the ame, but the value P 1+P +P 3 3 grow and reache thi value. We cale ize of job in the example o that opt = P 1+P +P 3 3 = 6. Then it follow that P 3 6. The final value of C = C n on the complete input i C = 9. We get that if job X i aigned to in a valid way (without overlap between it part), then the larget load exceed 9. Lemma 17. Conider a time during the execution of the algorithm, before the lat job ha arrived. Suppoe that a total proceing time of t of the P 3 -job i aigned to one of the firt two machine. Then there i at leat an amount t of proceing time of P 3 -job that i aigned to the third machine at thi point in time during the execution of the algorithm. Proof. We prove thi claim by induction. Clearly it i true before any job arrived. Aume it i true at ome time during the execution of the algorithm. The ituation may change only upon arrival of a P 3 job, aume thi i job j. We have either that machine M 3 i occupied during the complete interval [0, C j ] or that only thi machine received part of the new job. In the firt cae, the total um of the job i at mot 3opt j = C j, and thu the um of P 3 job doe not exceed twice the amount of P 3 job on M 3. Otherwie, we ue the induction hypothei. Since at leat half of the um of P 3 job wa aigned to M 3, and job j i aigned completely to P 3, the percentage of part of P 3 job on M 3 could only increae. Lemma 18. Conider a time during the execution of the algorithm, before the lat job ha arrived. Suppoe that a total proceing time of t of the P 3 -job and the P job i aigned to the firt machine. Then there i at leat an i=1