BULLETIN OF THE POLISH ACADEMY OF SCIENCES TECHNICAL SCIENCES, Vol. 67, No. 1, 2019 DOI: 10.24425/bpas.2019.127335

Better polynomial for scheduling unit-length jobs with bipartite incompatibility graphs on uniform machines

T. PIKIES* and M. KUBALE Department of Algorithms and System Modelling, Gdańsk University of Technology, ETI Faculty, Gabriela Narutowicza 11/12, 80-233 Gdańsk, Poland

Abstract. The goal of this paper is to explore and to provide tools for the investigation of the problems of unit-length scheduling of incompat- ible jobs on uniform machines. We present two new algorithms that are a significant improvement over the known algorithms. The first one is 2 which is 2-approximate for the problem Qm pj = 1, G = bisubquartic Cmax. The second one is Algorithm 3 which is 4-approximate for the problem Qm p = 1, G = bisubquartic ΣC , wherej m {2, 3, 4}. The theoryj behind the proposed algorithms is based on the properties j j 2 of 2-coloring with maximalj coloring width, andj on the properties of ideal machine, an abstract machine that we introduce in this paper.

Key words: approximation algorithm, , incompatible job, polynomial algorithm, scheduling, uniform machine, unit-time job.

1. Introduction partite subcubic (subquartic) graph is said to be bisubcubic (bi- subquartic). The symbol α(G) stands for the size of a maximum Suppose we have to process n bins of chemical substances independent set in G. We say that a graph is k-colorable if its and we have m parallel uniform machines, i.e. machines that vertices can be partitioned into k independent sets, called color have identical functionality but may have different processing classes, and by a k-coloring of G we mean such a partition of its speeds. On no machine can we process two substances that may vertices. The width of a coloring is the difference between the react with each other in order to guarantee machines safety or sizes of the largest and the smallest color class of the coloring. due to spacial reasons. The aim is such an assignment of the For other definitions the reader is referred to [10]. Conflicts bins to the machines that the processing time of all bins is as between jobs can be modeled by an incompatibility graph, i.e. short as possible or the mean flow time of a bin is as short as by a graph which has exactly one unique assigned to possible. We assume here that each of the bins has to be pro- each of the jobs and which has an edge between a pair of ver- cessed on exactly one machine without interruptions. tices if the corresponding jobs cannot be processed on the same The problem can be expressed as the following scheduling machine. We say that jobs in a given set are compatible if the problem. Let us assume that we have n identical jobs with unit vertices corresponding to them form an independent set in the execution times. We also have m parallel uniform machines. incompatibility graph. They are uniform in the sense that the execution of a job on Now let us introduce some definitions concerning sched- a machine takes time inversely proportional to the speed of uling theory. Let us denote the set of jobs by J = { j1, …, jn}. Let the machine to be completed. There may be incompatibilities us also denote the set of the machines by M = {M1, …, Mm}. By between some jobs, that is, jobs belonging to incompatible s(M ) we denote the speed of machine M. Without loss of gener- pairs cannot be scheduled on the same machine. We consider ality we assume that s(M ) … s(M ), i.e. that the machines 1 ¸ ¸ m two criteria of optimality: the length of schedule and the total are ordered according to their speeds. By stotal = ∑ M M s(M ) completion time. we denote the sum of the speeds of all machines. A 2schedule Let us recall definitions of used further in this is for each job an allocation of a time interval to a machine paper. For a graph G = (V, E) by n(G) = V we denote the [2]. A subschedule is a schedule for a restricted set of jobs number of its vertices (nodes) and by e(G) =j Ej the number of J J on a restricted set of machines M M . By n (M ) 0 µ 0 µ S its edges. We denote by ∆(G) the maximum degreej j of a vertex we denote the number of jobs scheduled on machine M in in G. By V0(G) we mean the set of all vertices of a graph G a schedule S. By CS (M ) we denote the latest completion time with 0. A graph G is said to be a cubic (quartic) graph of the jobs scheduled on machine M in a schedule S. We have if it is 3-regular (4-regular). If, however, G fulfills ∆(G) 3 C (M ) = n (M )/s(M ). Thus the schedule length is equivalent ∙ S S (∆(G) 4) then it is called subcubic (subquartic). A bipartite to maxC (M ). Symbol Σ (N ) stands for the total completion ∙ S S cubic (quartic) graph is said to be bicubic (biquartic), and a bi- time of jobs from a set N J in a schedule S, therefore the µ total completion time is denoted by ΣS (J). By a greedy as- signment of compatible jobs to machines we understand an *e-mail: [email protected], [email protected] assignment in which the jobs are scheduled one by one and Manuscript submitted 2018-01-04, revised 2018-04-16, initially accepted each job is assigned to the machine that guarantees the shortest for publication 2018-05-08, published in February 2019. completion time at the moment of scheduling this job. In the

Bull. Pol. Ac.: Tech. 67(1) 2019 31 T. Pikies and M. Kubale following algorithms all the assignments of jobs to machines 2. 2-coloring with maximal coloring width should be performed greedily, e.g. using an Algorithm given in [3]. We present a simple Algorithm that constructs a 2-coloring of For a set of the machines K M by an ideal machine M we a with maximal coloring width. µ id mean a machine with the speed equal to ∑M K s(M )Tytus, thatPikies, can Marek Kubale ignore incompatibilities between jobs. By C (2N) we denote the id Algorithm 1 Non-Equitable Coloring latestN completionJ scheduled time on of the the ideal jobs machine from setM Nid , hence J scheduledCid(N)= Algorithm 1 Non-Equitable Coloring ⊆ µ Input: A bipartite graph G. onN the/∑ idealM K smachine(M). By MΣidid, (henceN) we C denoteid(N ) = the N total/∑M completion K s(M ). Input: A bipartite graph G. | | ∈ j j 2 Bytime Σ of(N jobs) we from denote a set theN totalJ completionscheduled on time the idealof jobs machine from Output:Output: AA two-coloring two-coloring with with maximal coloring width id ⊆ a Msetid ,N hence JΣ idscheduled(N)=0.5 Non( theN + ideal1)/∑ machineM K s(M ).M , hence 1. Col1 = Col2 = /0 µ | | | | ∈ Tytusid Pikies, Marek Kubale1 2 Σid(ThereN) = 0.5 areN several( N papers+ 1)/∑ addressingM K s(M ) the. problem of schedul- 2. Let G1, …, ,...,GGc be beconnected connected components components of ofG G. . j j j j 2 1 c ingThere with are incompatible several papers job constraintsaddressing the on identicalproblemTytus of machines. sched Pikies,- Marek3. Kubalei = 1 c N J scheduled on the ideal machine Mid, hence Cid(N)= Algorithm3. for i = 1 1 Non-Equitabletoto c dodo Coloring ulingHowever,⊆ with incompatible to the best of job our constraints knowledge, on thereidentical are fewmachines. results 4. Split V(G ) into color classes Col (G ) and Col (G ), N /∑ s(M). By Σid(N) we denote the total completion A bipartiteV( i) graph G. (1 )i (2 ) i N JM scheduledK on the ideal machine Mid, hence Cid(N)= Input:Algorithm4. Split 1 Non-EquitableGi into color Coloringclasses Col1 Gi and Col2 Gi , However,|involving⊆| ∈ to uniform the best machines. of our knowledge, The problem there isare hard few even results for where Col1(Gi) Col2(Gi) . timeN / of jobss( fromM). a By setΣN (NJ) wescheduled denote theon the total ideal completion machine Output:whereA two-coloring |Col (G )|≥| with Col maximal(G )| . coloring width identical∑M K machines. Theid authors⊆ of [1] have proved that even if Input:5. ColA bipartite= Col1 graphColi G(G. ). 2 i involvingM| id| , hence∈ uniformΣid(N)= machines.0.5 N ( NThe+ 1problem)/∑ sis( Mhard). even for 1. =1 j =1 j ¸1 j i j time of jobs from a set N J scheduledM onK the ideal machine Output:5. Col Col1 A Col= two-coloring Col2 ∪/0 Col with(G ) maximal. coloring width identicalthere are machines. only three The identical authors|⊆| | machines| of [1] have and∈ proved the incompatibili- that even 6. Col21 = Col21 [Col21(Gii). M There, hence areΣ several(N)= papers0.5 N addressing( N + 1)/ the problems(M). of schedul- 2. Let G1,...,Gc be∪ connected components of G. tiesid betweenid jobs can be modeled by a∑ bipartiteM K graph then the 1.6.7. Col Col1 =2 Col= Col2 =2 /0 Col2(Gi). ifing there with are incompatible only three identical job| | constraints| |machines on ∈and identical the incompati machines.- 3. endi for= c [ There are several papers addressing the problem of schedul- 2. forLet G ,...,1 toG dobe connected components of G. bilitiesproblem betweenP3 p j jobs= 1, canG = bebipartite modeledC maxby aremains bipartite NP-hard. graph then 7.8. endreturn for1 (Colc1,Col2) However,ing with incompatible to| the best of job our constraints knowledge,| on there identical are few machines. results 4. Split V(Gi) into color classes Col1(Gi) and Col2(Gi), the problemThere is P a3 p review = 1, G of = known bipartite algorithmsC remains for unit-lengthNP-hard. 3.8. forreturni = 1(Colto c, doCol ) involvingHowever, uniformto thej best machines. of our knowledge, The problemmax there is are hard few even results for where Col11(Gi)2 Col2(Gi) . schedulingThere is witha reviewj incompatible of known jobs algorithms presentedj for in [4].unit-length The au- 4. Split V|(Gi) into|≥| color classes| Col1(Gi) and Col2(Gi), identicalinvolving machines. uniform machines. The authors The of [1] problem have proved is hard that even even for if Proof.5. ColThe1 = setCol of1 verticesCol1(G ofi). G can be split into V0(G) and schedulingthors of [4] with have incompatible also considered jobs presented a model ofin more[4]. The power- au- where Col1(∪Gi) Col2(Gi) . thereidentical are machines. only three The identical authors machines of [1] have and proved the incompatibili- that even if V6.(G) ColV0(2G=)|.Col Since2 Col no|≥|2( isolatedGi). vertex| belongs to Col2, we thorsful machinesof [4] have that also are considered called parallel a model batching of moremachines powerful (for 5. \Col 1Let= Col G be1 ∪ aCol bisubquartic1(Gi). graph. For the set Col re- ties between jobs can be modeled by a bipartite graph then the Lemmawill7. end consider 1. for the set∪V(G) V0(G) only. 2 theredetails are of only this three model identical see e.g. machines [2]). They and thepresented incompatibili- optimal 6. Col2 = Col2 Col2(\Gi). machinesproblem thatP3 pare= called1,G = parallelbipartite batchingC remains machines NP-hard. (for details turned8.Let byH beAlgorithm a graph∪ 1 with we athave least Col one2 edge. 2(n( TheG) following α(G)). in- ties between jobsj can be modeled bymax a bipartite graph then the 7. return (Col1,Col2) j j ∙ ¡ ofpolynomial this model| algorithms see e.g. [2]). for theThey problems presented| Q3 batchoptimal, p j polyno= 1,G =- end for There is a review of known algorithms| for unit-length equality is well known in graph theory (see e.g. [11]). problem P3 p j = 1,G = bipartite, = C, max=remains NP-hard. 8. return (Col1,Col2) mialbicubic algorithmsΣCj| and forQ 4thebatch problemsp j Q1| 3Gbatchbiquartic, pj = 1,Σ GC j=. Basedbicu- Proof. The set of vertices of G can be split into V0(G) and schedulingThere| is with a review incompatible| of known jobs algorithms presentedj in for [4].| unit-length The au- Proof. The set of vertices of G cane( beH) split into V (G) and biconΣ [7],C and they Q also4 batch presented, p = 1, optimal G = biquartic polynomialΣC algorithms. Based V(G) V (G). Sinceα no(H isolated) n(H vertex) belongs. to Col0, we will thorsschedulingj ofj [4] with havej incompatible also consideredj jobs presented a model of inj more [4].j The power- au- V(G)n V0 (G). Since no≤ isolated− vertex(H) belongs to 2Col , we for the problem Q3 batch, p j = 1,G = bipartite ΣCj when Proof. The0 setV of( vertices) V ( ) of G can∆ be split into V (G2) and onful [7], machines they also that presented are| called optimalparallel polynomial batching machines algorithms| (for consider\ the set G 0 G only.  0 thors( )= of [4]( have) also( ) considered a model of more power-, = will consider the set Vn(G) V0(G) only. fors Mthe1 problems M2 Q3s batchM3 and, pj for= 1, the G problem= bipartiteQ3 batchΣCj whenp j VLet(GLet us) H noticeV 0be(G a). thatgraph Since for with a no connected isolatedat\ least one component vertex edge. belongs TheGi wefollowing to haveCol2, wein- detailsful machines of this that model≥ arej see called e.g.parallel [2]). They batching presentedmachines|j optimal (for Let\H be a graph with at least one edge. The following in- s(1M,G) == sbisubquartic(M ) s(M )Σ andCj whenfor thes (problemM1)= 2Qs(3Mbatch2)=, 3ps (=M 1,3) . equalitywill consider is well the known set V( inG )graphV0(G theory) only. (see e.g. [11]). polynomialdetails1 of this2 algorithms¸ model3| see for e.g.the problems [2]). TheyQ3 batch presentedj , p j = optimal1j,G = equality is well known in graph\ 3 theory (see1 e.g. [11]). GAn = bisubquartic optimal algorithmC when for s the(M ) problem = 2s(M| Q) 3= 3p js(=M 1),. GAn= Let H be a graphα with(Gi) at leastn(G onei)+ edge., The following in- bicubic ΣCj and QΣ4 batchj , p j = 11,G = biquartic2 | ΣCj.3 Based ≤ 4 4 polynomialconnected| bicubic algorithmsj C| forwith the timeproblems complexityQ3 batchO(,|np2j)=was1,G pre-= e(H) optimalon [7], Algorithm they also for presentedmax the problem optimal Q3 polynomialpj =| 1, G = connected algorithms equality is well known in graph theory (see e.g. [11]). bicubic ΣCj and Q|4 batch, p j = 1,G =j biquartic2 ΣCj. Based10 because Gi is connectedα(H) andn(H subquartic.) Now.. we show how bicubicsentedC| in [6]. with Also time| in thatcomplexity paper there O(n has) was been presented| given a in7 - ≤ − ∆(H) foron [7], the problem theymax alsoQ presented3 batch, p j optimal= 1,G polynomial= bipartite algorithmsΣCj when the number of vertices in Col (G ) ise( relatedH)  to n(G ) α(G ). approximationj algorithm| for the NP-hard problem| Q3 p j = α(H) n2(H)i . i i [6].s(M Also1)= ins( Mthat2) papers(M there3) and has for been the problemgiven a ¹⁰⁄Q73-approximabatch, p j =- Let us notice that for a connected component G we have− for the problem Q3 batch, p = 1,G = bipartite ΣC |when For this reason, let n(Gi)=≤ 4l +r,− where∆(H)l N, ir 0,1,2,3 . tion1,G Algorithm= connected for≥ the 3-colorable NP-hardj cubicproblemCmax Q3whenp = 1, the| G machines =j con- Let us notice that for a connected component G we have 1,G = bisubquartic|ΣCj when s(M|1)=2s(jM2)=| 3s(M3). ∈ i ∈{ } shave(M1)= speedss(Ms2()M )s>(M| s3()Mand)= fors(M the). problem This algorithmj Q3 batch has, p timej = LetConsider us notice four that cases, for asa connected follows.3 component1 Gi we have nected 3-colorable≥1 cubic C2max when3 the machinesQ p have| = speeds,G = α(Gi) n(Gi)+ , An,G optimal= bisubquartic algorithm3 C for thes( problemM2 )= s(M3 )=j 1s(M ) 1complexity O(n ). ThereΣ jj when is a O(n 1) algorithm2 |2 2 for3 optimal3 . ≤ 43 41 s(connectedM1) > s(M bicubic2) = s(MC3|). Thiswith Algorithm time complexity has timeO( ncomplexity) was pre- If r = 0, we have α(Gi) 3l. From this we obtain n(Gi) An optimal algorithmmax for the problem Q3 p = 1,G = • α(Gi) ≤ n(Gi)+ ., − scheduling3 in the|Q24 p j = 1,G = bisubcubic Cmaxj problem10 becauseα(G )G lis. Thus connectedCol ( andG ) subquartic.2l 2(n( NowG ) weα(G show)). how Osented(n ). There in [6]. is a Also O(n in)| Algorithm that paper therefor optimal has been |scheduling| given2 a in- i i 2 ≤ i 4 4 i i connectedif the machines bicubic haveCmax speedswith times(M complexity) 12s(M O)=(n 12) wass(M pre-)=7 ≥ | |≤ ≤  − the Q4 pj = 1, G =| bisubcubic Cmax1 problem if2 the machines3 10= theIf numberr = 1, we of haveverticesα(G ini)Col32(lG+i1.) is From related this to wen(G havei) nα(G(Gi)i). approximationsentedj in [6]. Also algorithm in that for paper thej NP-hard there≥ has problem been givenQ3 ap j - because• Gi is connected and≤ subquartic. Now we show− how− 12s(M4) [5]. The authors have also discussed an extension| 7 of Forα this(G ) reason,l, and let alson(Gi we)= obtain4l +r,Col where(Gl ) N,2rl 20(,n1(,G2,3) . have1,G =speedsconnected s(M1 3-colorable) 12s(M2 cubic) = 12Csmax(M3when) = 12 thes(M machines4) [5]. becausethe numberi Gi is of connected vertices in Coland subquartic.(G ) is related2 iNow to nwe(G show) α (howGi ). approximation algorithm¸ for the1.5 NP-hard problem Q3 p j = ≥ 2 i | ∈|≤ ∈{≤i i}− this algorithm, that is a O(mn ) algorithm| for the problem Considerα(Gi)) four. cases, as follows. − α Thehave authors speeds haves(M1 )also> s (discussedM2)=s(M an3) .extension This algorithm of this has algo| time- theFor number this reason, of vertices let n(G ini)= Col4l2+(Gri,) whereis relatedl Nto, rn(Gi)0 ,1 ,2(,G3i).. 1,G = connected 3-colorable cubic Cmax when the machines ¡ rithm,Qm p thatj = is1, aG O=3mnbipartite1.5 Algorithm,∆(G) form2 theCmax problemand machines Qm p = with 1, ForIf thisr =reason,2, we let have n(G )α =( 4Gil) + r,3 wherel + 1. l ∈ From N, r this∈{ 0, 1, 2, 3 we have}. complexity| O(n( ). There) is a O≤(n| |) algorithm for optimalj ConsiderIf r = 0, four we cases, have α as(i G follows.i) 3l. From this we obtain{ n(Gi) } havespeeds speedss(M )s(M1m)(>m s(M1)2s)=(M s)(,Ms(3M). This)=... algorithm= s(M ) hasj. time •• ( ) ( ) + ≤ ≤ 2 ( 2) + − Gscheduling = bipartite1 in, the∆3(GQ) 4 pm C=max1m,G and= bisubcubic2machines2 Cwithm problemspeeds Considern Gi fourα Gcases,i las follows.1, so in this case Col2 Gi 2l 1 complexity O(≥n ).∙ There− j j is a O(n ) algorithmmax for optimal αIf(rG=i)−0, wel. Thus have≥ Colα(G2()Gi) 3l.2 Froml 2( thisn|(G wei) obtainα(|≤Gi))n.(G ) ≤ s(MIn) this m( paperm 1 we)s( analyzeM |), s(M the) problem= … = s of(M the). scheduling| of in- ● If2 (rn (=G 0,i≥) weα (haveGi))| .α(Gi) 3|≤l. From≤ this we− obtain n(Gi) if the1 machines havem speeds2s(M1) 12s(mM2)=12s(M3)= • If r = 1,− we have α(Gi)i ≤3l +1. From this we have n(Gii)− schedulingcompatible¸ unit-lengthin¡ the Q4 p jobsj = with1,G respect= bisubcubic≥ to two criteriaCmax problem of opti- • αFinally,(Gi) letl. Thus us assumeCol2(G that≤∙i) r =2l3.2 Then(n(Gi we) haveα(Gi))α(. G ) −¡ 12Ins( Mthis4) [5].paper The we authors analyze| have the alsoproblem discussed of the an |scheduling extension of of α (αG(G)i≥) l, l and. Thus also| Col we2( obtainGi|≤) 2Col≤l ( 2G(n)(Gi)− 2l α(2G(ni)()G. i) if the machines have speeds s(M1) 12s(M2)=12s(M3)= • ¡If r =i 1,¸ we have αj(G ) 3lj+∙1. From∙2 i this we¡ have n(Gi ) ≤ incompatiblemality. The firstunit-length criterion jobs is the with1. schedule5 respect length to two minimization. criteria of ● If3 lr+ =2. 1,≥ Likewe have in the α(G previousi) 3l + case 1.| From we have this|≤ nwe(G havei≤) α n((Gi) − this algorithm, that is a O(mn ) algorithm≥ for the problem • α(Gi)). i ≤ − i −≥ 12Thes(M second4) [5]. one The is authorsthe total have completion also discussed time minimization. an extension The of α+(Gi) l, and also we∙ obtain Col2(Gi) (2l ) 2(n(+Gi) ¡ optimality.Qm p = 1The,G =firstbipartite criterion,∆ (isG 1the).5 schedulem C and length machines minimiza with- l α(1,Gi and≥) similarlyl, and also we we conclude obtain| Col that2(GColi)|≤ 2 2Gil ≤ 2(2nl(Gi1) − this algorithm,j that is a O(mn ) algorithmmax for the problem ¡Ifα(Gr =)).2,¸ we have α(Gi) 3lj + 1.| Fromj ∙ this∙|≤ we have¡≤ remainder| of the paper is organized≤ as| follows. In the next sec- • 2(αn(iGi) α(Gi)). ≤ tion.speeds Thes second(M1) onem(m is the1) stotal(Mm completion),s(M2)= ...time= minimization.s(Mm). n( G(iG) i))α. (Gi) l + 1, so in this case Col2(Gi) 2l + 1 Qmtionp wej = describe1,G≥= bipartite a procedure− ,∆(G for) 2-coloringm Cmax and of machinesG with maxi- with ¡If r =−2,− we have≥ α(Gi) 3l + 1.| From this|≤ we have≤ TheIn remainder| this paper of we the analyze paper is the organized problem≤ | ofas thefollows. scheduling In the ofnext in- ●•So If2( forrn (=G 2, each) weαconnected have(G )) α. (Gi) component 3l≤ + 1. FromG , Col this( weG ) havecontains n(Gi) no speeds s(M1) m(m 1)s(Mm),s(M2)=...= s(Mm). n(G ) i α(G ) i l + 1,∙ so in this casei Col2 (Gi ) 2l + 1 ¡ sectionmum coloringwe describe≥ width. a procedure− In Section for 3 2-coloring we give a 2-approximationof G with max- α(i G ) − l i+ 1, so in this case Col 2(G )i 2l + 1 compatibleIn this paper unit-length we analyze jobs the with problem respect of to the two scheduling criteria of of opti- in- moreFinally,( ( than−i) let2(n us(Gi≥ assume))) α(G thati)) vertices.r = 3. ThenFrom| 2 wethesei have observations|≤α(Gi) ≤ algorithm for the problem Qm p j = 1,G = bisubquartic Cmax. • ¡2 n Gi ¸α Gi −. j j ∙ ≤∙ imummality. coloring The first width. criterion In Section is the schedule3 we give length a 2-approximation minimization. 2(n(G−i) α(Gi)). compatible unit-length jobs with| respect to two criteria of| opti- it∙3Finally, followsl + 2. Like that let¡ usCol in assume the2 previous2( thatn(G)r case=α3.( weG Then)) have. wen(G havei) α(Gi) AlgorithmThis algorithm for the isproblem better thanQm Algorithmp = 1, G = 4 bisubquartic in [5] in theC sense. ●• Finally, let us |assume|≤ that r = 3.− Then we have α(G−) 3l i+ 2.≥≤ Themality. second The one first is criterion the total is completion thej schedule time length minimization. minimization.max The l +l +1, and similarly we conclude that Col2n(G(Gi)) i 2l(+G 1) that it has a smaller approximationj ratio, it runs in O(nj) time 3 2. Like in the previous case we( have|) α( )i|≤∙α+ i ≤ Thisremainder Algorithm of the is paperbetter is than organized Algorithm as follows. 4 in [5] In in the the next sense sec- 3.Like2( 2-approximationn( Gini )the αprevious(Gi)). case algorithmwe have n Gi for theGi − problem l 1, and≥ Therather second than O one(n1 is.5) thetime total and completion requires no time assumptions minimization. as to The the l + 1, and− similarly we conclude that Col¡ 2(Gi)¸ 2l + 1 thattion it wehas describe a smaller a approximation procedure for 2-coloringratio, it runs of inG withO(n) maxi-time similarly we conclude that Col2(Gi) | 2l + 1 |≤ 2(n(Gi) ≤ remaindermachine speeds. of the1.5 paper In Section is organized 4 we give as follows. a 4-approximation In the next sec- al- So2( forQmn(G eachi)p j =α connected(G1,i))G. = componentbisubquarticj Gi,j ∙CColmax2(Gi) ∙contains no¡ rathermum than coloring O(n width.) time In and Section requires 3 we no give assumptions a 2-approximation as to the α(G|i))−. | tion we describe a procedure for 2-coloring of G with maxi- more¡ than 2(n(Gi) α(Gi)) vertices. From these observations machinegorithm speeds. for the In problem Section 4Qm wep givej = a1 ,4-approximationG = bisubquartic AlgoΣC-j, SoSoObservation for for each each connected connected 1. For a setcomponent K M andGi, aCol set2( NGi) containsJ and the no algorithmmum coloring for the width. problem In SectionQm|p j 3= we1,G give= bisubquartic a 2-approximationC| max. − ⊆ i 2 i⊆ where m 2,3,4 . | | itideal follows machine that MColid 2for K,2( Cnid(G(N) ) isα a(G lower)). bound on the length rithmThis for algorithm the problem is better Qm thanpj = 1, Algorithm G = bisubquartic 4 in [5] inΣC thej, where sense moremore than than 2 2((n(|GGii)) |≤ α(Gii)))) vertices.vertices.− From From these observations algorithm∈{ for the problem} j Qm p j = 1,G = bisubquarticj Cmax. ¡− m 2, 3, 4 . | | ititof follows follows any subschedule that that Col2 for 2 N2(n on(G K.) αα((G)))). thatThis{ it algorithm has a} smaller is better approximation than Algorithm ratio, 4 it in runs [5] in inO the(n) sensetime | 2|≤ − □ 2.2 2-coloring1.5 with maximal coloring width 3. 2-approximationj j ∙ algorithm¡ for the problem ratherthat it than has aO smaller(n ) time approximation and requires ratio, no assumptions it runs in O as(n) totime the Lemma 2. Let K M and let N J be a set of compatible 3.Qm 2-approximationp j = 1,⊆G = bisubquartic algorithm⊆ C formax the problem machineratherWe present than speeds.O a( simplen1.5) Intime Section algorithm and requires 4 we that give constructs no a assumptions 4-approximation a 2-coloring as to the al- of unit-time| jobs. Let Mid be the ideal machine| for K and Sopt be 32gorithm for the problem Qm p = 1,G = bisubquartic ΣC , Observationa subscheduleQm p = 1. for1For,G N a=on setbisubquartic K Kwith theMBull. minimaland Pol. aC set Ac.: length. N Tech.J Then 67(1)and 2019 the machinea bipartite speeds. graph with In Section maximal 4| we coloringj give a width. 4-approximation| al-j | j ⊆ | max ⊆ where m 2,3,4 . ideal machine Mid for K, Cid(N) is a lower bound on the length gorithm for the problem Qm p j = 1,G = bisubquartic ΣCj, Observation 1. Formax aC setSopt K(K) M andK a set1 N J and the Lemma∈{ 1. Let G} be a bisubquartic| graph. For the set| Col2 of any subschedule for N on K.⊆ 1 + | |− . ⊆ where m 2,3,4 . ideal machine Mid forC K,(N C)id(N)≤is a lowerN bound on the length returned∈{ by Algorithm} 1 we have Col2 2(n(G) α(G)). id 2. 2-coloring with maximal| coloring|≤ width− Lemmaof any subschedule 2. Let K forM Nand on let K. N J |be| a set of compatible ⊆ ⊆ unit-time jobs. Let M be the ideal machine for K and Sopt be We2.2 2-coloring present a simple with algorithm maximal that coloring constructs widtha 2-coloring of Lemma 2. Let K Mid and let N Bull.J Pol.be aAc.: set Tech. of compatible XX(Y) 2016 a subschedule for⊆ N on K with the⊆ minimal length. Then aWe bipartite present graph a simple with algorithm maximal coloring that constructs width. a 2-coloring of unit-time jobs. Let Mid be the ideal machine for K and Sopt be a bipartite graph with maximal coloring width. a subschedule formax N onCS Kopt with(K) the minimalK 1 length. Then Lemma 1. Let G be a bisubquartic graph. For the set Col2 1 + | |− . C (N) ≤ N returned by Algorithm 1 we have Col2 2(n(G) α(G)). maxCidSopt (K) K 1 Lemma 1. Let G be a bisubquartic| graph.|≤ For the− set Col2 1 + | ||−| . C (N) ≤ N returned by Algorithm 1 we have Col2 2(n(G) α(G)). id | | 2 | |≤ − Bull. Pol. Ac.: Tech. XX(Y) 2016 2 Bull. Pol. Ac.: Tech. XX(Y) 2016 Tytus Pikies, Marek Kubale

N J scheduled on the ideal machine M , hence C (N)= Algorithm 1 Non-Equitable Coloring ⊆ id id N /∑M K s(M). By Σid(N) we denote the total completion Input: A bipartite graph G. | | ∈ time of jobs from a set N J scheduled on the ideal machine Output: A two-coloring with maximal coloring width ⊆ Mid, hence Σid(N)=0.5 N ( N + 1)/∑M K s(M). 1. Col1 = Col2 = /0 Better polynomial algorithms for scheduling unit-length jobs | | | | ∈ There are several papers addressing the problem of schedul- 2. Let G1,...,Gc be connected components of G. Better polynomial algorithms for scheduling unit-length jobs ing with incompatible job constraints on identical machines. 3. for i = 1 to c do Proof. Without loss of generality we may assume that Sopt was Therefore we assume V0(G)=/0for the problem under con- However, to the best of our knowledge, there are few results 4. Split V(Gi) into color classes Col1(Gi) and Col2(Gi), Proof.createdWithout greedily, loss i.e. of generality by the application we mayassume of the algorithm that Sopt was given sideration.Therefore we assume V0(G)=/0for the problem under con- involving uniform machines. The problem is hard even for where Col1(Gi) Col2(Gi) . createdin [3]. greedily, The completion i.e. by the time application on Mid isof equal the to algorithm given sideration. | |≥| | in [3]. The completion time on M is equal to Corollary 1. Let S be a subschedule created by a greedy as- identical machines. The authors of [1] have proved that even if 5. Col1 = Col1 Col1(Gi). id Let S be a subschedule created by a greedy as- ∪ Cid(N)=maxCSopt (K) t, (1) Corollarysignment 1. of N J to K M . If a number k is such that there are only three identical machines and the incompatibili- 6. Col2 = Col2 Col2(Gi). − ⊆ ⊆ ∪ Cid(N)=maxCSopt (K) t, (1) signment of N J to K M . If a number k is such that ties between jobs can be modeled by a bipartite graph then the 7. end for for some t 0. Let Mi K be any− machine such that ∑M K s⊆(M) N⊆ K 1 ≥ ∈ k ∈ > | | and N | |− , (2) t M K s(M) N ∑ K s(M1) N problem P3 p j = 1,G = bipartite Cmax remains NP-hard. 8. return (Col1,Col2) forCS someopt (Mi)=max0.C LetSopt (Ki). Letben(M any) for machineM K suchmeans that the ∑M Kstotal J | |≥ M K | | ≥ ∈ ∈ k ∈ > | | and N k | s∈ |− |J,| (2) C (M )=maxC (K). Let n(M) for M K means the | | ∑M K stotal(M) −N There is a review of known algorithms for unit-length Smaximalopt i numberSopt of jobs that M can execute in time equal to stotal J | |≥k ∈ | || | ∈ or | | stotal − J scheduling with incompatible jobs presented in [4]. The au- maximalCid(N). number Then of jobs that M can execute in time equal to | | Proof. The set of vertices of G can be split into V0(G) and or ∑M K s(M) N thors of [4] have also considered a model of more power- Cid(N). Then K = 1 and k ∈ = | | (3) V(G) V0(G). Since no isolated vertex belongs to Col2, we n(Mj) nS (Mj)+1 s(Mj)t | | ∑M Kss(M) NJ ful machines that are called parallel batching machines (for \ ≤ opt − K = 1 and k ∈ total = | | | | (3) will consider the set V(G) V0(G) only. n(Mj) nS (Mj)+1 s(Mj)t | | s J \ ≤ opt − then total details of this model see e.g. [2]). They presented optimal Let H be a graph with at least one edge. The following in- for any machine Mj=i K. The above bound results from the | | for any machine M  ∈K. The above bound results from the then maxC (K) kC (J ), polynomial algorithms for the problems Q3 batch, p j = 1,G = equality is well known in graph theory (see e.g. [11]). following observation.j=i Each Mj=i K can complete at most S id |  ∈  ∈ maxC (K) ≤kC (J ), bicubic ΣCj and Q4 batch, p j = 1,G = biquartic ΣCj. Based followingnSopt (Mj observation.)+1 jobs in time Each equalMj=i to maxK canCSopt complete(K). Otherwise, at most it S id | | | e(H)  ∈ where Mid is the ideal machine≤ for M . on [7], they also presented optimal polynomial algorithms nSwouldopt (Mj)+ provide1 jobs a fasterin time completion equal to max of theCSopt last(K job). Otherwise, on Mi than itMi α(H) n(H) . where Mid is the ideal machine for M . for the problem Q3 batch, p = 1,G = bipartite ΣC when ≤ − ∆(H) woulddoes. provide But this a isfaster not possiblecompletion due of to the the last algorithm job on M fori than scheduleMi Proof. Let us assume that (2) occurs. Let Mid be the ideal | j | j   s(M )=s(M ) s(M ) and for the problem Q3 batch, p = Let us notice that for a connected component G we have does.construction. But this isM noti can possible complete duen to(M thei)= algorithmnS (Mi) fors schedule(Mi)t jobs Proof.machineLet for usK assume. By Lemma that (2) 2, occurs.we have Let Mid be the ideal 1 2 ≥ 3 | j i opt −  1,G = bisubquartic ΣC when s(M )=2s(M )=3s(M ). construction.in time equalM toi canCid complete(N). So wen(M havei)=nSopt (Mi) s(Mi)t jobs machine for K. By Lemma 2, we have | j 1 2 3 3 1 − maxCS(K) K 1 An optimal algorithm for the problem Q3 p = 1,G = α(Gi) n(Gi)+ , in time equal to Cid(N). So we have 1 + | |− . j ≤ 4 4 ( )= , maxCCS((KN)) ≤ K N1 | 2 n M N id + . connected bicubic Cmax with time complexity O(n ) was pre-  ∑ | | 1 | |−| | | M nK(M)= N , Cid (N) ≤ N sented in [6]. Also in that paper there has been given a 10 - because Gi is connected and subquartic. Now we show how ∑ ∈ | | Applying the equality | | 7 (M K)+ ( ) ( ) = , the number of vertices in Col2(Gi) is related to n(Gi) α(Gi). ∑ n M∈ nSopt Mi s Mi t N Applying the equality approximation algorithm for the NP-hard problem Q3 p j = − | | C (N) N s − M K Mni (M)+nS (Mi) s(Mi)t = N , id total | For this reason, let n(Gi)=4l +r, where l N, r 0,1,2,3 . ∑∈ \{ } opt = | | 1,G = connected 3-colorable cubic Cmax when the machines − | | C (N) N s ∈ ∈{ } M K Mi idC (J ) J total s(M) | ∈ \{ } id = | | ∑M K have speeds s(M ) > s(M )=s(M ). This algorithm has time Consider four cases, as follows. ∑ (nSopt (M)+1 s(M)t)+nSopt (Mi) s(Mi)t N . | | ∈ 1 2 3 − − ≥| | Cid(J ) J ∑M K s(M) 3 2 M∑K M(inSopt (M)+1 s(M)t)+nSopt (Mi) s(Mi)t N . and substituting the bound| on |N into∈ the above inequality, we complexity O(n ). There is a O(n ) algorithm for optimal If r = 0, we have α(Gi) 3l. From this we obtain n(Gi) ∈ \{ } − − ≥| | | | • ≤ − M K Mi andimmediately substituting obtain the bound the thesis on N ofinto Corollary the above 1. inequality, we scheduling in the Q4 p j = 1,G = bisubcubic Cmax problem α(Gi) l. Thus Col2(Gi) 2l 2(n(Gi) α(Gi)). ∈ \{ } | | | | ≥ | |≤ ≤ − immediatelyNow let us obtain assume thethat thesis (3) of occurs, Corollary then 1. we may simply com- if the machines have speeds s(M1) 12s(M2)=12s(M3)= If r = 1, we have α(Gi) 3l +1. From this we have n(Gi) Applying the equality ≥ • ≤ − pareNow the let maxus assumeCS(K) thatand (3)Cid occurs,(J ) and then the we thesis may followssimply com- imme- 12s(M4) [5]. The authors have also discussed an extension of α(Gi) l, and also we obtain Col2(Gi) 2l 2(n(Gi) Applying the equality 1.5 ≥ | |≤ ≤ − pare the maxCS(K) and Cid(J ) and the thesis follows imme- this algorithm, that is a O(mn ) algorithm for the problem nSopt (M)= N , diately. α(Gi)). ∑ | | M nKS (M)= N , diately.In the rest of the paper we use this corollary with k = 2. Qm p j = 1,G = bipartite,∆(G) m Cmax and machines with If r = 2, we have α(Gi) 3l + 1. From this we have ∑ ∈ opt | ≤ | • ≤ M K | | In the rest of the paper we use this corollary with k = 2. speeds s(M1) m(m 1)s(Mm),s(M2)=...= s(Mm). n(G ) α(G ) l + 1, so in this case Col (G ) 2l + 1 we obtain ∈ ≥ − i − i ≥ | 2 i |≤ ≤ In this paper we analyze the problem of the scheduling of in- 2(n(Gi) α(Gi)). we obtain Algorithm 2 A 2-approximation algorithm for the problem − ∑ (1 s(M)t) s(Mi)t 0, A 2-approximation algorithm for the problem compatible unit-length jobs with respect to two criteria of opti- Finally, let us assume that r = 3. Then we have α(Gi) − − ≥ AlgorithmQm p j = 1 2,G = bisubquartic Cmax M K M(i1 s(M)t) s(Mi)t 0, | | • ≤ ∑∈ \{ } Qm p j = 1,G = bisubquartic Cmax mality. The first criterion is the schedule length minimization. 3l + 2. Like in the previous case we have n(Gi) α(Gi) M K M − − ≥ Input: A bisubquartic graph G. − ≥ ∈ \{ i} K 1 t s(M), | | The second one is the total completion time minimization. The l + 1, and similarly we conclude that Col2(Gi) 2l + 1 | |− ≥ ∑ Input:Output:A bisubquarticA schedule graph G. | |≤ ≤ K 1 t M sK(M), remainder of the paper is organized as follows. In the next sec- 2(n(Gi) α(Gi)). | |− ≥ ∑ ∈ Output:1. (ColA, scheduleCol )=Non-Equitable Coloring(G). so M K 1 2 tion we describe a procedure for 2-coloring of G with maxi- Better− polynomial algorithms for scheduling unit-length jobs with bipartite incompatibility graphs∈ on uniform machines 1. (Col ,Col )=Non-Equitable Coloring(G). ( ) 2. case1 2 So for each connected component Gi, Col2 Gi contains no so K 1 2 mum coloring width. In Section 3 we give a 2-approximation 2. 3.case: s(M1) [ stotal,stotal) : more than 2(n(Gi) α(Gi)) vertices. From these observations t | |− . ∈2 5 algorithm for the problem Qm p = 1,G = bisubquartic C . − ≤ ∑K 1s(M) 3. : s(M ) [ s ,s ) : j max it follows that Col 2(n(G) α(G)). t | M|−K . 4. M11 Col5 total1, Mtotal2,...,Mm Col2. | | 2 Substituting the above≤ inequality∑ ∈s( Mto) (1) we get ∈← 1 2 ← This algorithm is better than Algorithm 4 in [5] in the sense 3. 2-approximation| |≤ Algorithm− for the problem Substituting the above inequalityM K to (1) we get 4. 5. :Ms1(M1)Col[1,sMtotal2,...,, stotalMm) : Col2. ∈ ← ∈1 4 2 5 ← that it has a smaller approximation ratio, it runs in O(n) time Qm p = 1, G = bisubquartic C 5. 6.: s(MM11) [Colstotal2, ,M2s,...,total)M:m Col1. 3. 2-approximationj algorithm formax the problem Substituting the above inequality to (1) we get ∈ 4 5 rather than O(n1.5) time and requires no assumptions as to the j j K 1 6. M ←Col 1, M ,...,1 M ←Col . maxCS (K) Cid(N)+ | |− .. 7. : s1(M1) [2m stotal2 , 4 stotalm ) : 1 Qm p j = 1,G = bisubquartic Cmax opt ≤ K 1s(M) ← ∈1 1 ← machine speeds. In Section 4 we give a 4-approximation al- Observation 1. For a set K M and a set N J and the ideal maxC (K) C (N)+ ∑| M|−K . 7. 8.: s(MLet1) k be[ thestotal smallest, stotal) integer: such that K = M1,...,M | µ | µ Sopt id ∈ ∈ m 4 { k} Qm p = ,G = bisubquartic C machine Mid for ForK, C aid set(N K) is a lowerand bound a set Non the lengthand the of ≤ ∑M K s(M) 8. Let k be the smallest integer9 such that K = M ,...,M gorithm for the problem j 1 Σ j, Observation 1. M J It follows immediately that ∈ and ∑M K s(M) 20 stotal. 1 k | | any subschedule for N on K.⊆ ⊆ It follows immediately that ∈ ≥9 { } where m 2,3,4 . ideal machine Mid for K, Cid(N) is a lower bound on the length It follows immediately that 9. andif n∑forto| i K|=and1MtoN.c Ifdo a number| |− k is such that, (2) Sopt i ≥ Sopt ∈ − ⊆ ⊆ s(M) N CS (Mi)=maxCSid(N(K)=).max LetCnS(optM()Kfor)−2tM, K means the(1) signments of N ⊆ J toJ K ⊆ M|. If|≥ a number∑M K k is such that opt However,opt to the best of our knowledge, there are few resultstotal 4. Split V(G ) intok color∈ classes| |Col (G ) and Col (G ), imalfor somenumbert of jobs0. that Let MM cani executeK be any in −time machine equal∈ to such Cid( thatN). Corollary∑M K 1.s( LetM⊆) S be| Na subschedule| ⊆ i createdstotalK by a1− greedyJ assign1 i - 2 i maximalfor some numbert ≥ 0. of Let jobsM thati ∈MK canbe execute any machine in time such equal that to k ∑M∈K > | | and N | |− | | , (2) Thenfor some t ≥ involving0. Let M uniformi ∈ K be machines. any machine The problem such that is hardment evenk ∑ofM forN∈K s( JM) to> K| whereN| Mand. IfCol Na 1number(Gi)∑M k|K ColKiss(|−M such2)(1Gi )thatN. , (2) CSopt (Mi)=maxCSopt (K). Let n(M) for M K means the or stotal J | |≥ ∑M K s(M) N CidSopt(N(M).i Then)=≥maxCSopt (K).∈ Let n(M) for M K means the k s∈totalµ > J|µ| and| |N|≥k|≥|s∈| |− |J| | , (2) C (M )=maxidenticalC (K machines.). Let nBetter( TheM) for authors polynomialM ∈ ofK [1]means algorithms have proved the for that scheduling even if unit-length5. | Col| jobs=∑Col s(ColMk )∑Ms(∈totalGK s()NM. ) − JN maximalSopt i number ofSopt jobs that M can execute in time equal to stotal |J | 1 M| K1|≥k 1 ∈totali − || || maximal number of jobs that M can execute in∈ time equal to K = 1| and| k ∈ ∪ =stotal| | |J | (3) maximal numbernthere(M of) arejobsn only that(M threeM)+canBetter identical1 executes polynomial(M machines) int time algorithms equal and the to incompatibili- foror scheduling unit-length6. Col jobs= Col Col (G ). − | | Cid(N). Then j Sopt j j or ∑ s(M|) | N 2 stotal2 2 iJK 1 Proof.id Without loss of≤ generality we may− assume that Sopt was or ThereforeM K we assume V0(∑GM)=K /0fors∪(M) the problem| N | under con- Cid(N). Then ties between jobs can be modeled by a bipartite graph k then2 the K >7.= endj1 andj forand k ∑ M∈NK = j| |j ¡ , (3)(2) forcreated any machine greedily,(M i.e.j=)i byK the. The application( above)+ bound of( the) results algorithm from given the thensideration. K = 1 and k ∑M∈K s(M) ∑= |Ns|(M ) N (3) Proof. Withoutnproblem loss(Mj) of generalityPnS3optp(M=j)+1 we,G1 may= bipartites( assumeMj)t C that Sremainsopt was NP-hard.Thereforestotal we| | assumeJ V0(G)=jstotalj/0for¸ theM problem J K under con- for any machinen MMj j= i≤ ∈ nKS.opt ThejM jabove1− bounds Mj tresultsmax from the |K|8.=return1 and k(Cols∈1total,Col2k) = |2J| || j j (3) followingin [3]. The observation. completionn(Mj6 ) ≤2 time EachnS | on(MMjj=)+i is1K− equalcans(M tojcomplete)t | at most | | maxj jCS(K) stotalkCid(J ),|J | created greedily, i.e.There by theisopt a application reviewid of of known the algorithm algorithms given forsideration. unit-length ≤ stotal ¡ J followingfor any machine observation.Mj=i≤ EachK. The Mj = above i ∈ K− boundcan complete results from at most the thenCorollary 1. Let S be a subschedule created| by| a greedyj j as- ninSopt [3].(M Thej)+ completion1 jobs inj= timei ∈ time equal on M to6 max2is equalCSopt ( toK). Otherwise, it nfor( anyM ) machine + 1 jobsschedulingM Cinj= time(iN∈)=K equal. withmax The incompatibleCto aboveid max(K boundC) t(,K jobs results). Otherwise, presented from the(1) it in [4].wherethensignment The M au-id ofis N the idealmaxto machineC K (K) for.kC IfM a number(.J ), k is such that followingSopt j observation.id Each Mj=Si opt K canSopt complete at most Corollary 1. LetProof.J Smax be aTheCS subschedule(K setM) ofkC verticesid(J created), of G bycan a greedy be split as- into V0(G) and wouldfollowing provide observation. a faster completion∈ Each Mj=i of∈ theK can last− jobcomplete on Mi than at mostMi ⊆ S⊆ ≤ id wouldnfollowing(M providej)+ observation.1 jobs athors faster in(time of completion)= Each [4] equal haveM toj= i alsoof max∈ (theKC considered) canlast(, completejobK). on Otherwise, aM modeli atthan most M it ofi moreor power- maxCS(K) ≤ kCid(J ), does.nSopt (M Butj )+ this1 jobs is notC inid possible timeN equalmax dueC to toSopt max theKC algorithmSoptt(K). Otherwise, for schedule(1) it Proof.signmentLet of uss N(MV assume)(JG) toNV thatK0(G) (2)M.≤ Since. occurs. If a number noLet isolatedKM k is such vertexbe the that belongs ideal to Col2, we foropt some t 0. Let Mi K be∈ any−opt machine such that where∑ MMid Kis the⊆ ideal\ machine⊆ for M . id1 does.wouldnSopt ( ButM providej)+ this1≥ is jobs aful not faster inmachines possible time completion equal due∈ that toto are of maxthe the called AlgorithmC lastSopt ( jobparallelK). on Otherwise,forM batchingschedulethan M it machinesk (forid∈ > | | and N | |− , (2) would provide a faster completion( of)= the last( job) on M( i than) Mi machinewhere Mid forisK the.will By ideal Lemma consider machine 2, the we for set haveMV(.G∑) Vs0(M(G) ) only.N construction.forCSopt some(Mi)=t maxMi0.canCSopt Let complete(KM).i LetnKMnbe(i M) anynforSopt machineMMi Ksmeans suchMi t jobs that the ∑M stotalK s(M) JN ∑M | K|≥s(M ) M KK N 1 construction.does.would But provide this M is adetails notfastercan possiblecomplete ofcompletion this due modeln(M to of) the = the see n algorithm last e.g.(M job [2]).) on− for sM(M They schedulei than)t jobs presentedMi Proof. optimalLet us assume that (2)2 occurs.k Lets\∈ M be|J the| ideal does. But this≥ isi not possible∈ due toi the algorithmSopt i∈ for schedulei Proof.k Let∈K us = assume 1 Let>and||H that|bek| and a (2) graphN occurs. with Let=attotal| leastj|−Midj , one be edge.the, ideal(2) The(3) following in- indoes.Cmaximal time( ButM equal)= numberthismax to isC notCid of(N possible jobs)(.K So). that we Let dueM haven tocan(M the) execute algorithmfor M in¡K time formeans schedule equal the to ∑M K s(M)id− | N | does.Sopt Buti this ispolynomial notSopt possible algorithms due to the for algorithm the problems for scheduleQ3 batch, pProof. j = 1,GLets=jtotal usj assumemaxJC thatS(K) (2)|s occurs.total|≥Kk Let∈1 JMid be| | the ideal inconstruction. time equal toM iCcanid(N complete). So wen have(Mi)=nSopt (M∈i) s(Mi)t jobs machineor for K.equality By Lemma is well 2, we known have in graphs theory J (see e.g. [11]). construction.C (N). ThenMi can complete n(Mi)=nSopt (Mi) s(Mi)t jobs| machine for K. By Lemma| | 2, we1 have+ | |−total.j j− | | construction.maximalid numberMbicubiccan of completejobsΣC thatjnand(MMn)=(QMcan4)=batchN execute,n , p(jM= in)1− time,Gs(=M equalbiquartic)t jobs to ΣmachineCj. Based for K. By LemmaC (N) 2,≤ we have( N) in time equal to iCid(N).∑ So we havei Sopt i i id ∑M K s M N inC time(N). equal Then to Cid(N)|. So we have|| | − | or K max= 1CandS(K k) ∈ K| |=1 | | e(H) (3) inid time equal toonCid [7],(N)M. they SoK we also have presented optimal polynomial algorithms maxCS K 1 + |K|−1. n(Mj) ∈nSopt (Mj)+1 s(Mj)t Applyingthen the equality| |maxCS(K)∑M s1totalαK+(sH(|MK)|−) 1n.J(NH) . ≤ n(M)= N −, K =C1idand(N) k ≤ ∈ N≤= || || − ∆(H) (3) forn the(M∑ problem)+nS(M)=(MQi3)Nbatch,s(M,i)ptj== N1,,G = bipartite ΣCj when Cid (N) ≤ 1 + | |−N . ∑n(Mj) M∑nKSopt((optM)=j)+| 1|, s(Mj)t | | Cmax (CNS)(K)≤ stotal kCid(|JN|) , J  for any machine Mj=i M K.n TheM above||N−| bound results| | from the |then C (idN ) N∙ s| | M K sM(Mi 1)=≤∑∈s(M2) s(|M3|−) and for the problem Q3 Applyingbatch, p j = the equalityLetid us notice that for atotal connected| | | | component Gi we have ∈ \{ }  M∈∈K ≥ |Applying the equalitymaxC=(K|) | kC (J ), forfollowing any machine observation.Mnj=(Mi )+∈ EachK.nS TheoptM(Mj above=i) Ks bound(Mcani)t complete= resultsN , from at most the Applyingthen the equality( ) S id ( ) ∑1,Gn=(Mbisubquartic)+nSopt (M i)ΣCsj(Mwheni)t = sN(M, 1)=2s(M2)=where3s( M3) .is theC idealid J machineJ≤ for∑ MMK. s M (nS∑opt (M)+ 1∈ s(M)t)+n∈−Sopt (Mi) s|(M|i)t N . id C (N) N s∈ 3 1 nS ∑(Mj)+M 1K jobsMi inn(M time)+ equalnSopt (M toi max)|− sC(MS i)t(K=)|.N Otherwise,|, it Cidmax (N)C (K|)N |kC s(totalJ ), followingopt M observation.∈K∑\{AnMi} optimal− Each algorithmMj=i K forcanopt completethe− problem≥| at most|Q3 p j where= 1,G M =is the idealid machineS= | | forα(idGtotali.) n(Gi)+ , M K Mi M∈K\{M }  ∈− | | and substitutingid theCid bound(N) = on|NN≤| intoMs thetotal≤ above4 inequality,4 we nwould∈ (\{M provide)+} 1 jobs a fasteri in time completion equal to ofmax theC last( jobK). on Otherwise,Mi than M iti | 2 Cid(J ) J ∑M K s(M) Sopt j (n∈Sopt\{connected(M})+1 bicubics(M)t)+CmaxnSoptwith(SMopti) times(M complexityi)t N . O(n ) was pre- Cid(J ) = J|| || ∑M K s(M )  ∑ (nSopt (M)+1 s(M)t)+nSopt (Mi) s(Mi)t N . Proof.where MLet isus the assume ideal that machine (2)| occurs. for| M∈ Let. Mid0 be the ideal ma- does.∑ But thisopt is not possible− due| to theopt algorithm− for schedule≥| | immediatelyProof. Let10id us obtainbecause assumeCid the(J thesisG that) is| (2)J connected of| occurs.Corollary∑M∈K s and( LetM 1.) subquartic.M be the Nowideal we show how wouldM K provideMi (nSoptsented a(M faster)+ in1 completion− [6].s(M Also)t)+ ofn inS theopt that( lastMi paper) job− s( onM thereiM)ti≥|than hasN|M been. i and given substituting a - the boundi on| N | into∈ the aboveid inequality, we M∈K∑\{Mi} − − ≥| | andchineNow substituting for let7 K us. By assume theLemma bound that 2, (3) onwe occurs, Nhaveinto then thewe above may inequality, simply com- we construction.M∈K\{Mi} Mi can complete n(Mi)=nS (Mi) s(Mi)t jobs machineLet for usK.the assume By number Lemma that of 2, (2) vertices| we| occurs. have in Col Let2(MGi) isbe related the ideal to n(Gi) α(Gi). Applyingdoes.∈ \{ But} the this equality isapproximation not possible due algorithm to the algorithm foropt the NP-hard for schedule problemimmediatelyandProof.Q substituting3 p j = obtain the thebound thesis on of|N| Corollaryinto the above 1. id inequality, we − pareimmediately the maxC obtainS(K) theand thesisCid(J of| )| Corollaryand the thesis 1. follows imme- − construction.in time equalM to Ccanid(N complete). So wen have(M )=n (M ) s(M )t jobs immediatelymachine| for K obtain.For By this Lemma the reason, thesis 2, of we let Corollary haven(Gi)=4 1.l +r, where l N, r 0,1,2,3 . Applying the equality1i,G = connected 3-colorablei Sopt cubici Cmaxi when the machinesNow let us assumemax thatCS (3)(K) occurs, thenK we1 may simply com-∈ ∈{ } Applying the equality nS (M)= N , − | diately.Now let us assume that (3) occurs,1 + then| |− we. may simply com- Applyingin time equal the equality tohaveCid( speedsN∑). Soopts we(M have) > s|(M| )=s(M ). This algorithmpareNow has the time let max usC assumeConsider(K) and thatC four (3)(J occurs, cases,) and as then the follows. thesis we may follows simply imme- com- M K n(M1)= N , 2 3 pareIn the maxrest ofCS the(Kmax) paperCandidC(CSN( weidK)()J use≤) thisand corollaryKtheN thesis1 with followsk = imme-2. Applying the equality ∈∑ 3 2  1 + | ||−| . complexityM KO((n ))=.| There| , is a O(n ) algorithmdiately. forpare optimal the maxCS(KIf)rand= 0,Cid we(J have) andα( theG ) thesis3l. follows From this imme- we obtain n(G ) ∑ ∈nSnopt(M(M)=)=NN, ,, diately. Cid (N) ≤ Ni i we obtain ∑∑ Sopt | | | | diately.Applying the equality•  | | ≤ − schedulingn(MMMK)+nKS innopt ( theM(M)=Q)4|Nps|j(,=M 1)t,G= =N bisubcubic, CmaxApplyingInproblem the rest the of equality theα( paperGi) wel. Thus use thisCol corollary2(Gi) with2l k2=(n2.(Gi) α(Gi)). ∑ ∑∈ ∈ Sopt i | | i In the rest ofA the 2-approximation paper we use this algorithm corollary for with thek problem= 2. M∈K −| ( | ) | ( )=| AlgorithmApplyingIn( the)= rest the 2 of equality theC paper(N≥) we useN this| corollarys |≤ with≤k = 2. − wewe obtain obtain M K ifM thei n( machinesM(∈1)+ns(M) have(tM) ) s speeds(Ms(iM)t )ts=0M, 1N , 12s M2 12s M3 Ifidr = 1, we have α(Gtotali) 3l +1. From this we have n(Gi) we obtain ∈∑\{ ∑} − Sopt −i i≥ ≥ Qm p j = 1,G =• bisubquartic= |Cmax| ≤ − we obtain M12Ks(Mi4) [5]. The authors− have also| | discussed an extension| of AC 2-approximationαidid(G((JiN) )) l, and|JN also∑ algorithmMs wetotalK s obtain(M) forCol the2( problemGi) 2l 2(n(Gi) M(nSK ∈(MMi\{)+} 1 s(M)t)+nS (Mi) s(Mi)t N . Algorithm 2 A 2-approximation algorithm for the problem ∑ ∈ opt\{ } (1 s(M)t) s(optMi)t 10.5, Input:AlgorithmA bisubquartic 2 graph≥= ||G.|| ∈ . | |≤ ≤ − this∑ algorithm,(1− s(M that)t) iss( aMOi)(tmn−0,) algorithm≥| | for theQmAlgorithm problemp = 1, G 2 =AbisubquarticC 2-approximationα(G(Ji))). JC algorithms(M) for the problem M K Mi ( (∑)+K −1( t) )+−s(M)(, ≥) ( ) . Qmandp substitutingj = 1,G = bisubquartic theid bound onCNmax∑intoM theK above inequality, we ∈∑\{ } nSMopt KM Mi 1(1−ssM(Mt)∑t)−nsS(optMiM)t i≥ 0,s Mi t N Output:| A schedule || | ∈ MQm∈K∑\{pM|ji}=|−−1−,G≥=MbipartiteK− ,∆(≥G−) m Cmax≥|and| machinesQm|p j with= 1,G = bisubquarticIf r = 2, we|C| max have| α(Gi) 3l + 1. From this we have M K Mi M∈K\{| Mi} ∈ ≤ | Input:immediately| A bisubquartic obtain the graph thesis|G of. Corollary 1. ∈ \{ } ∈ \{ K} 1 t s(M), Input:and1. ( substitutingColA1, bisubquarticCol2•)= theNon-Equitable bound graph onGN. into Coloring the above(G≤). inequality, we so speedsKs(M11) t m∑(ms(M1))s,(Mm),s(M2)=...= s(MInput:andm). substitutingAA bisubquartic schedule then(G boundi) graphα on(G G|i)N. | intol + 1,the so above in this inequality, case Col 2we(G i) 2l + 1 | |− ≥≥ ∑ − Output:immediately2.Now letA us schedule obtain assume the that− thesis (3) occurs, of≥ Corollary then we 1. may simply| com- |≤ ≤ In this|K|− paper1 ≥ wet M analyzeK s(M), the problem of the schedulingcase of in- j j Applying the equality| |− ≥ ∑∈ Output:immediately1. (Col ,ACol schedule obtain)=2 2(Non-Equitablen the(G ithesis) α( Gofi ))Corollary Coloring. 1.(G). KM∈K1 pare1.3.Now(Col the( let1 max,Col) usC assume2[S)=(K)Non-Equitableand, thatC− (3)id)(J occurs,) and Coloring then the thesiswe(G may). follows simply imme- com- so compatiblet unit-length| |−∈ jobs. with respect to two criteria: ofs opti-M11 2 5 stotal stotal : = ( ) sosoApplying the equality 2.1. Nowcase(Col 1let,Col ∈us2)= assumeFinally,Non-Equitable that let us(3) assumeoccurs, Coloring thatthen(Gr )we. 3. may Then simply we have α Gi so ≤n∑SoptM (KMs)=(M)N , parediately.4.2. case theM maxColC•S(K,)Mand,...,CidM(J ) andCol the. thesis follows imme- ≤ mality.∑ The firstK criterion is the schedule length minimization.1 2 1 2 m 2 K∈ 1 | | compare3.2. cases(M the←) max[ 12 s3ClS+(K,2.s2) and Like) C inid←(J the) previousand the thesis case wefollows have imn(-Gi) α(Gi) Mt Kn | (M|−)=1 N. , diately.3.5.In: thes(M rest1) of[ 5 thestotal paper,stotal we) ) use: this corollary with k = 2. − ≥ Substituting theThe above second∑t inequality∈ S oneopt|K is|− theto1 (1) total. we completion get time minimization.: s M The1 ∈ 452sltotal+ 1,5total andstotal similarly: we conclude that Col (G ) 2l + 1 ≤ ∑M K s(M)| | mediately.4.3. : sM(M1 ) ∈Col[ stotal, M,,...,stotal)Mm: Col . 2 □i we obtain Mt ≤K ∑M| K|−s(M).. 6.4.In theM1 restCol of5 the1, M paper2,..., weMm use thisCol corollary2. with k =| 2. |≤ ≤ remainder∈≤ of the∈ papers(M) is organized as follows. In the next sec-1 ←∈ 1 2 2 2 m ← 1 ∑M K K 1 5.4. In: s the(MM1 ←rest) Col [of1s 12the,(nM (paper,2G,...,21is) weMα)m( G:use←i)) Col.this2 .corollary with k = 2. Substituting the above inequality∈ to (1) we get Algorithm7.5. : s(M1←) 2 [A4 sstotal 2-approximation,,5 sstotal− )) :← algorithm for the problem Substitutingwe obtain max thetionC aboveSopt we(K inequality describe) Cid(N a to)+ procedure (1) we| |− get for 2-coloring. of G with: maxi-1 ∈ m41 total 524 total : (1 s(M)t) s(Mi)t 0, 6.5. : sM(M1) ∈Col[ stotal, M,,...,stotalM)m: Col . Substituting the above∑ inequality≤ to (1)∑M weK gets(M) Qm8.6. p jLetM=1 1k,beGCol= theSo4 2bisubquartic, smallestforM2,..., each5 integerM connectedmCmaxCol such1. component that K = MG,...,i, ColM2(Gi) contains no MmumK M coloring− width.− In SectionK∈ ≥1 3 we give a 2-approximationAlgorithm← 2∈ A1 2-approximation1 ← algorithm for the1 problemk i (1 s(M)t) s(MKi)t 10, 7.6. |: s(MM11←) Col[ 1 2s,totalM2,,...,1stotal9(Mn)(m|G:←) Col(1G. )) { } max∈C∑S\{opt (K} ) Cid(N)+ | |− . 7. : sand(=M1), [=morem stotal(M than), 4 stotal 2 s ) : i. α i vertices. From these observations It follows immediatelymaxalgorithmCSopt (K that) for− C theid(N problem)+− |KQm|−≥1p =. 1,G = bisubquarticQmInput:pCj A1←∑ bisubquartic. G∈M Km1 bisubquartic41 graph20 totalGC←.max Bull. Pol. Ac.: Tech.M K 67(1)Mi 2019≤ ∑M K s(Mj) 8.7. |: s(maxM1) ∈ ∈[ stotal,≥stotal)|: − = ,..., 33 max∈CS\{opt (K}K) ≤1Cidt(N)+s(∑MM|)∈,K|−s(|M) . 8. | Let k be theitm follows smallest4 that integerCol2 such2 that(n(GK) =αM(G1,...,)). Mk | |−≤ ≥ ∑ ∈ s(M) Output:9. ifAnA< bisubquartic∈ schedule10(m 2) graphthen9 G. { 1 k} This algorithm isM betterKK ∑1 M thanK Algorithm 4 in [5] inInput:8. the senseLet k be the(− smallest) 9 integer| such|≤ that K −= {M1,...,Mk} It followsmaxC immediately(K) KC thatid(N1 )+t ∈| |−s(M)∈, and ∑M K s(M) 20 stotal. It follows immediatelySopt that ∑∑M K s(M) K 1 Output:10.1. (ColFind1A,∑Col scheduleM∈ an2K)= optimalNon-Equitable≥ schedule209 total byColoring a brute-force(G).{ algorithm.} It follows immediatelythat it| has|− that a smaller≥ M K∈ approximation= 1 + | |− ratio,. it runs in O9.(n) andtime∑ ∈ s(M) ≥ stotal. so K 1 9. if n < M103.(Km 2-approximation2) then20 algorithm for the problem Cid(N) ≤ Cid1(.5N∈)K 1 N 11.1.2. (caseColelseif n,Col10∈)=m−Non-Equitable2 ≥then Coloring(G). maxCS (ratherK) thanCid(NO)+(n )|time|− and requiresK no1 assumptions10.9. as toif then1 < 102(m− 2) then so maxCSopt (K) Cid(N)+K∑M|K1K|−s(1M) K| | 1 10. Find an2 optimal schedule by a brute-force algorithm. opt C (N)+∑M|∈K|− = 1 + | |− . 12.2.3. : s(MMFind11),... an[Ms optimalktotal−Qm,Colstotalp schedulej1,=)M1k:+, 1G,..., by= abisubquarticM brute-forcem Col2. algorithm.Cmax maxCSopt (machineK) tid speeds.| |−∑ In∈ Sections(M. ) = 41 + we|K give|−1 a. 4-approximation10. case al-Find an5 optimal schedule by a brute-force algorithm. Cid(N) ≤ Cid(NM) K N 11. else ∈ 2 ← | ← | Cid(N) ≤ ≤ ∑CMidK(KNs)(∈1M) = 1 + | |−N . 13.3.4. : sendelse(MM1 ) if Col[ s1, M,2s,...,)Mm: Col2. C (N)gorithm≤ t for theC| ∈(|− problemN) . Qm p j =|N1,|G = bisubquartic12.11. elseΣCM1j, ,...Observation5Mtotal Coltotal, M 1. For,..., a setM K ColM and a set N J and the id Let G be anid incompatibility| graph and let 12.14. | M←1,...∈ 1Mk Col2 1, Mk+←1,...,Mm ⊆Col2. ⊆ ObservationSubstituting the 2.where abovem inequality≤ ∑2,M3,K4s to(.M (1)) we get | | 4.5. end: sM(M case1 11) Col[ideal1sktotal, ←M machine2,,...,stotal1 M) Mmk:+1forCol K,2. Cm ←(N) is2 a lower bound on the length ∈ 13.12. endM if1,...∈ 4Mk ← Col5 1, Mkid+1,...,Mmid← Col2. S be a subschedule for∈{ the unit-time} jobs corresponding to 13.6. endM ← if Col1 , ←M 2,...,M ← Col . ← Substituting the above inequality to (1) we get 13.5. : send(M11) if [of4 s2 anytotal, subschedule25 stotal)m: for N1 on K. Observation 2. Let G be an incompatibilityK 1 graph and let 14. end case←∈ 1 1 ← VObservation(G) V0(G) 2.onCM .( LetK) SC be k(N)+1 times longer. than a sub- 6.7. end: sM(M case1) Col[ s,totalM ,,...,stotalM) : Col . SObservation be a− subschedulemax 2.2.LetS 2-coloringopt forG be the an unit-timeid incompatibility with≥ maximal jobs| |− corresponding graph coloring and let to widthTheorem14. end case1 1. Algorithmm2 2 42 is m2-approximate1 for the problem scheduleS be a subschedule for V(G) V for(G the)≤on unit-timeM with∑ the jobsMK minimalK correspondings(1M) length and to ←∈ Lemma1 1 2. Let K← M and let N J be a set of compatible 0 7.8. : s(LetM1k) be[ thestotal smallest, stotal integer) : ⊆ such that K =⊆M1,...,Mk VS( beG) aV subschedule0(Gmax) onCMS−opt. for(K Let) the SC be unit-timeid( kN)+1 times jobs| ∈|− longer corresponding. than a sub- to Qm p j = 1,G =unit-timembisubquartic4 jobs.C Letmax M. be the ideal{ machine for} K and S be Vlet(G a) scheduleV0(G) SonWe beM present an. Letextension≤ S a be simple k of S1 algorithm createdtimes longers by(M that the) than constructs greedy a sub- as- a 2-coloring of ∈ 9 id opt It follows− immediately that ≥ ∑M K Theorem8.| Letand 1.k∑beAlgorithmM theK s( smallestM) 2 20is integerstotal|2-approximate. such that K for= theM1,..., problemMk scheduleV(G)−V for0(G V)(onG)MV.0 Let(G) Son beM k ≥with1 times the∈ minimal longer than length a sub- and Theorem 1. Algorithm∈ 2 is 2-approximate for the problem signmentschedule− for of the V(aG jobs bipartite) V corresponding0(G graph) on M with≥with to maximal V the(G minimal). Thencoloring length the width. length and TheoremLet 1.SAlgorithmbea subschedule a schedule≥2 9is produced for2-approximate N on K by with the for the algorithm.{ theminimal problem Letlength.} Then It follows immediately− that 0 QmProof.9. p j and=if n1,<∑G10=(bisubquarticms(M2)) thenstotalCmax. . letschedule a schedule for V S(Gbe)− anV0 extension(G) on M ofwithK S created1 the minimal by the lengthgreedy and as- Qm|p j = 1,GM=Kbisubquartic− 20 |Cmax. oflet S ais schedulemax at mostC S k( timesKbe)− an greaterC extensionid(N)+ than of the| S|− created minimal by schedule the greedy length as- SQm| pbej = a1, scheduleG =∈ bisubquartic with≥ the|C minimalmax. CS length.(K) If Ks(M 1)  Sopt Let G∑ beM K as( bisubquarticM) K graph.1 For the10.opt9. set Colif nFind< 10 an(m optimal2) then schedule by aopt brute-force algorithm.1 signmentlet a schedule of the SLemma jobsbe an corresponding extension 1. ofK∈ S to created1 V0(G=).1 by Then+ the| |−greedy the length. as- Proof.2 | Let2 S be a schedule produced| by the algorithm.1 + | |− Let.∈ forsignment G.max ofC the( jobsK) correspondingCid(N)+ | to|− V0(G). Then the length [Proof.11.stotal,sLettotalS) thenbe a− weschedule may estimate producedC C(NS by()M the1) using algorithm. CorollaryN Let signmentC ofidS( theoptN)returned jobs≤ corresponding by AlgorithmCid(∑NM) K tos1( VMwe)(G have). ThenColK N the2 1 length2(n(G) Proof.10.5α(G))elseLet. FindS be an optimala schedule schedule produced byid a by brute-force the≤ algorithm. algorithm. Let of S is at most k times greater than the∈ minimal0 = 1 + schedule| ||−| length. Sopt be a schedule with the minimal length. If s(|M|1)  | |≤ −11.212.opt M1,...Mk Col1, Mk+1,...,Mm Col2. 1 ∈ forof S G. is atC mostid(N k) times≤ greaterC thanid(N) the minimal scheduleN length [S2opts be,elses a schedule) then we with may the estimate minimalC ( length.M ) using If Corollarys(M1) ∈ for G. | | [5 stotal,stotal) then we← may estimate CS(M1←) using Corollary∈ Bull. Pol. Ac.: Tech. XX(Y) 2016 [12.513.2 ,endM1 if,...) Mk Col1, Mk+1,...,M(m ) Col2. 3 for G. 2 5 stotal stotal then we← may estimate CS M1← usingBull. Corollary Pol. Ac.: Tech. XX(Y) 2016 Observation 2. Let G be an incompatibility graph and let 13.14. endend case if Bull. Pol. Ac.: Tech. XX(Y) 2016 3 Bull.S be Pol. a Ac.:subschedule Tech.Let XX(Y) G for 2016 be the an unit-time incompatibility jobs corresponding graph and let to 14. 3 Bull.Observation Pol. Ac.: Tech. 2. XX(Y) 2016 end case 3 SV( beG) a subscheduleV0(G) on M for. Let the S be unit-time k 1 times jobs longer corresponding than a sub- to − ≥ Theorem 1. Algorithm 2 is 2-approximate for the problem Vschedule(G) V0 for(G V) (onG)MV.0 Let(G) Son beM k with1 times the minimal longer than length a sub- and − − ≥ TheoremQm p j = 1 1.,GAlgorithm= bisubquartic2 is 2C-approximatemax. for the problem schedulelet a schedule for V S(G be) anV0 extension(G) on M ofwith S created the minimal by the length greedy and as- | | − Qm p j = 1,G = bisubquartic Cmax. letsignment a schedule of the S jobsbe an corresponding extension of S to created V0(G). by Then the greedy the length as- Proof.| Let S be a schedule produced| by the algorithm. Let signmentof S is at mostof the k jobs times corresponding greater than the to minimal V0(G). Then schedule the length length Proof.Sopt beLet a scheduleS be a schedule with the produced minimal by length. the algorithm. If s(M1) Let 2 ∈ offor S G.is at most k times greater than the minimal schedule length S[ 5optstotalbe,s atotal schedule) then we with may the estimate minimalCS( length.M1) using If Corollarys(M1) 2 ∈ for G. [ 5 stotal,stotal) then we may estimate CS(M1) using Corollary Bull. Pol. Ac.: Tech. XX(Y) 2016 3 Bull. Pol. Ac.: Tech. XX(Y) 2016 3 Better polynomial algorithms for scheduling unit-length jobs

Proof. Without loss of generality we may assume that Sopt was Therefore we assume V0(G)=/0for the problem under con- created greedily, i.e. by the application of the algorithm given sideration. in [3]. The completion time on M is equal to id Corollary 1. Let S be a subschedule created by a greedy as- C (N)=maxC (K) t, (1) signment of N J to K M . If a number k is such that id Sopt − ⊆ ⊆ for some t 0. Let Mi K be any machine such that ∑M K s(M) N K 1 ≥ ∈ k ∈ > | | and N | |− , (2) C (M )=maxC (K). Let n(M) for M K means the ∑M K s(M) N Sopt i Sopt stotal J | |≥k ∈ | | ∈ | | stotal J maximal number of jobs that M can execute in time equal to − | | or Cid(N). Then ∑M K s(M) N K = 1 and k ∈ = | | (3) n(Mj) nS (Mj)+1 s(Mj)t | | s J ≤ opt − total | | for any machine Mj=i K. The above bound results from the then  ∈ following observation. Each Mj=i K can complete at most maxCS(K) kCid(J ),  ∈ ≤ nSopt (Mj)+1 jobs in time equal to maxCSopt (K). Otherwise, it where Mid is the ideal machine for M . would provide a faster completion of the last job on Mi than Mi does. But this is not possible due to the algorithm for schedule Proof. Let us assume that (2) occurs. Let Mid be the ideal construction. M can complete n(M )=n (M ) s(M )t jobs machine for K. By Lemma 2, we have i i Sopt i − i in time equal to Cid(N). So we have maxC (K) K 1 S 1 + | |− . n(M)= N , C (N) ≤ N ∑ id M K | | | | ∈ Applying the equality ∑ n(M)+nSopt (Mi) s(Mi)t = N , M K M − | | Cid (N) N stotal ∈ \{ i}  = | | (n (M)+1 s(M)t)+n (M ) s(M )t N . Cid(J ) J ∑M K s(M) ∑ Sopt − Sopt i − i ≥| | | | ∈ M K Mi and substituting the bound on N into the above inequality, we ∈ \{ } | | immediately obtain the thesis of Corollary 1. Now let us assume that (3) occurs, then we may simply com- Applying the equality pare the maxCS(K) and Cid(J ) and the thesis follows imme- diately. T. Pikies and M. Kubale ∑ nSopt (M)= N , M K | | In the rest of the paper we use this corollary with k = 2. ∈ we obtain Algorithm 2 A 2-approximation algorithm for the problem For the last case we may bound the ratio of maxCS(K) to Cid(J) ∑ (1 s(M)t) s(Mi)t 0, and that of maxC (M K) to C (J), where M is the ideal − − ≥ Qm p j = 1,G = bisubquartic Cmax S n id id M K Mi | | machine for M. By the way k is established, we have ¹⁴⁄20 s > ∈ \{ } Input: A bisubquartic graph G. total K 1 t s(M), > ∑ s(M ) ⁹⁄20 s and ¹¹⁄20 s ∑ s(M ) > ∑ Output: A schedule M K total total M M K | |− ≥ M K 2 ¸ ¸ 2 n > ⁶⁄20 stotal. These inequalities are obtained using the condition ∈ 1. (Col1,Col2)=Non-Equitable Coloring(G). so that ¹⁄4 s > max s(M ). The value ⁹⁄20 s that is present 2. case total total K 1 2 in the inequality determining k is a conveniently chosen t | |− . 3. : s(M1) [ 5 stotal,stotal) : ∈ constant that asserts that 2(∑ M K s(M )) > ⁴⁄5 stotal and that ≤ ∑M K s(M) 4. M1 Col1, M2,...,Mm Col2. ∈ 2 ← 1 2 ← 2(∑M M K s(M)) > ¹⁄2 stotal. By Corollary 1, if n 10(k 1), Substituting the above inequality to (1) we get 5. : s(M1) [ 4 stotal, 5 stotal) : 2 n ¸ ¡ ∈ then the ratio of maxCS(K) to Cid(J) is at most 2. Similarly, if 6. M1 Col2, M2,...,Mm Col1. K 1 ← 1 1 ← n 10(m k 1), then the ratio of maxCS(M K) to Cid(J) maxC (K) C (N)+ | |− . 7. : s(M1) [ stotal, stotal) : ¸ ¡ ¡ Sopt id ∈ m 4 ( ) n ≤ ∑M K s(M) 8. is at most 2. If n 10 m 2 , then all the ratios are less than ∈ Let k be the smallest integer such that K = M1,...,Mk ¸ ¡ 9 { } or equal to 2. □ It follows immediately that and ∑M K s(M) 20 stotal. ∈ ≥ 9. The approximation coefficient 2 is the best possible value K 1 if n < 10(m 2) then Cid(N)+ | |− − in the sense that for jobs with the conflict graph in the shape maxCSopt (K) ∑M K s(M) K 1 10. Find an optimal schedule by a brute-force algorithm. ∈ = 1 + | |− . of three double-stars S , presented in Fig. 1a, the schedule C (N) ≤ C (N) N 11. else 3,3 id id | | constructed by the Algorithm has the length exactly twice the 12. M1,...Mk Col1, Mk+1,...,Mm Col2. ← ← optimal (cf. Fig. 1b, 1c). 13. end if Observation 2. Let G be an incompatibility graph and let 14. end case S be a subschedule for the unit-time jobs corresponding to (a) V(G) V0(G) on M . Let S be k 1 times longer than a sub- − ≥ TheoremTheorem 1. 1. AlgorithmAlgorithm 2 isis 2-approximate2-approximate for the problem problem schedule for V(G) V0(G) on M with the minimal length and − QmQm p j == 1,1 ,GG = bisubquartic Cmax. let a schedule S be an extension of S created by the greedy as- j| j j| max signment of the jobs corresponding to V0(G). Then the length Proof. Let S be a schedule produced by the algorithm.Tytus Pikies, Let Marek Kubale of S is at most k times greater than the minimal schedule length Proof.S be Let a S schedule be a schedule with produced the minimal by the length. algorithm. IfTytuss (LetM Pikies, )Sopt Marek Kubale  opt 1 ∈ for G. be[ 2 sa schedule,s )withthen the we minimal may estimate length. IfC s((MM1)) using [²⁄Tytus5Tytuss Corollarytotal, Pikies, Pikies,stotal) Marek Marek Kubale Kubale 1.5 total By Lemmatotal 1, maxCS( M2,...,MSm )1 22maxCSopt (M ) then1. Bywe Lemmamay estimate 1, max CSC(MS(1){M using2,..., CorollaryMm }) ≤ 2max1. ByTytus CLemmaS Pikies,(M 1,) Marek Kubale since at most twice the minimal{ number} of≤ jobs is scheduledopt 1.max1.since By ByCS at( Lemma{ Lemma mostM2, …, twice 1, 1,Mm max max} the) CC minimal 2maxSS(( MM2C2,...,,...,S number(MMMm)m since)) of jobs 2maxat2max most isC scheduledC StwiceSoptopt((MM the)) Bull. Pol. Ac.: Tech. XX(Y) 2016 on M2,...,Mm. ∙ {{ opt }} ≤≤ 3 sinceminimal1.sinceon M By at at,..., Lemmamost mostnumberM twice twice. 1 1,of maxthejobs the2 minimal CminimalisS (scheduledM2,..., number numberM onm M of) of2 jobs, …, jobs2max isM ism scheduled scheduledC. S (M ) If2s(M1) m [ stotal, stotal) then we may estimateoptCS(M1) ononMMIf ,...,s,...,(M M)M ∈ ..[1¼4 s , 2²⁄5 5 s { ) then we }may≤ estimate C (M ) sinceIf 22s at(M most11) mm twice[ 4 stotaltotal the, 5 s minimaltotaltotal) then1 number we may of jobs estimate is scheduledCSS(M11) using Corollary∈2 11 1, because22 2 n Col2 . If the number of usingonIfIfMs2s (,...,(CorollaryMM11))Mm[[. s stotal1,total because,, sstotaltotal) )½1thenthenn ≥| we we Col may may2|. If estimate estimate the numberCCSS((MM 11of)) using Corollary44 1, because55 2 n Col2 . If the number2 of jobs scheduled∈∈ 1 on M22,...,M11m in≥|¸Soptj is| greaterj than 5 n, then usingjobsusingIf scheduleds Corollary( CorollaryM1) [ ons 1, 1,total M because because2,, …, stotalM)mn thennin SoptCol weCol is2 2maygreater.. If If estimate the the than number number ²⁄2C5 nS,( Mthen of of1) jobsmax scheduledC ( M ,...,4 onMM2,...,5) M2maxm22 inCSopt (isM greater), because than we5 n, sched- then maxC (S M ∈, …, 2 M m) 2max1 C≥|≥|S(optM )|,| because we 2schedule2 jobsusingjobs scheduled scheduledS Corollary{ { 2 on on 1,MMm because},...,},...,≤MM inninSSSopt Colisis2 greater greater. If the than than numbernn,, then then of maxCS(MM,...,2,...,MMm22)∙ 2maxmm2 CSoptopt(M ), because we55 sched- ule on 2 m at most twice≥| the number| of jobs2 assigned maxonmax MCC2, …, (({MMM,...,,...,m at MmostM }) )twice≤4 2max2max the numberCC ((MM of)) ,jobs, because because assigned we we sched-to sched- them jobsuleto themon scheduledSSM2 in,...,22S M on,m sincemMmat2 most,...,n M twicemαin(GS theS)optoptopt numberisCol greater[5]. of thanjobs If the assigned5 n number, then {{ opt }}α 4≤≤5 1 uleinmaxule S on onoptC,M M(sinceM,...,,...,,..., ⁴⁄MM5 nmmM atat most most)(G)2max ≥ twice twice ColC the the1 ≥|[5]. number( number If), the| because of of number jobs jobs we assigned assigned of sched- jobs toof them jobsS inscheduled22 S2opt , since¸ onm M5 n,...,¸αjM(G)Sinoptj SColM is1 less[5]. than If the or number equal to scheduled{ on M , …, }M44≤2 in≥ S ism less≥| optthan |or equal to n, then touletoof2 them themjobs on M scheduled in in2,...,SSoptopt,M,2 since sincem onatM mostmnn,..., twiceααoptM((GG))in theSCol numberCol3is11 lessn[5].[5]. of than If If jobs the the or assigned²⁄ number equal number5 to n, then maxCS (M552) CS m(Mn 1)opt . Let us bound the max25 C (M ) Copt (M4 )≥≥ ³⁄opt2 ≥|≥|. Let32 uss|ntotal| bound the ratio of (b) oftoofn jobs themjobs, thenS scheduledopt scheduled in maxSoptCS, since on on(SMoptMM)22,...,n,...,1≥CSαMM(m(mGMstotalin)in1)SSoptopt≥Colisis1 less less[5].. Let than than If us the or or bound equal equal number the to to 5 C¸opt( M ,...,5 ¸Mopt ) 2 sCtotal ( ) 2max2ratioC of({M max, …, S M 2}) ≥to ≥maxm C to≥|( max≥M33) ninnS|opt thisM case.in thisLet case.M 5ofratio5nn, jobs, then then ofS scheduled max max2 CCSSopt(opt{(M on(MMm,...,M))2,...,CMCSSoptoptM}()(mMMtoSin1opt1)) maxSopt22Csiss less.(.M Let Let than) us usin or bound bound this equal case. the the toid0 Let Mid be theS ideal2 machine≥≥ m for ≥M≥2,...,totalStotaloptMm . By Lemma 2, be2 the ideal machine{ for {M2}, …, Mm}3. Byn Lemma 2, we have ratioratioLet5 n, thenM of of max max maxbe theCCCSSS( ideal(optMM(M22,...,,..., machine) MMCmSmopt) for)(toMto1 max{M) max,...,C2CsSSoptoptM((.MM Let}.)) Byin usin Lemma thisbound this case. case. the 2, we haveid {{ ≥ }} { ≥2 total m} LetratioLetweM haveM ofidid be maxbe the theCS ideal ideal( M2 machine,..., machineMm for for) toMM max22,...,,...,CSoptMMm(mM.. By) Byin Lemma Lemma this case. 2, 2,  max{ CS( M2,...,} M{m{ ) m}} 2 weLetwe have haveM be the ideal machine for M ,...,+M . By. Lemma 2, id maxCS( {M2,...,Mm }) 2 1 mm −2 . C{id (Col1) {} ≤1 + Col−} 1. we have maxmaxCCSSC(( MM(2Col2,...,,...,)MMmm )) ≤ mmCol| 22 | We also have {id{ 1 }} 11++ | −−1|.. maxCCSC(ididM((ColCol2,...,11)) Mm ) ≤≤ ColmCol112 We also have C{ (Col ) } 1Col+|| − ||. C id(Col )1 10≤ Col1 WeWe also also have have id ( 1 ) | |. 1 Cid Col1 10 Col1| | (c) maxCSopt (M ) ≤ 9| n |.. We also have CCidid ((ColCol11)) 1010 ColCol11 maxC Sopt (M ) ≤ 9 || n ||.. By combining bothmaxmaxC inequalitiesCC(Col((M1M) )) ≤≤ we1099 obtain,Colnn 1 By combining both inequalitiesidSSoptopt we obtain,| |. By combining both inequalities( ) we obtain, ByBy combining combiningmaxC bothS both( maxM inequalities inequalities2,...,CSoptMMm ) we we≤ obtain,10 obtain,9 Coln 1 m 2 maxCS( {M2,...,Mm }) 10 (Col| 1 | +m −2 ). By combiningmax both{ CSopt inequalities(M ) } we≤ obtain,9(| n | + −n ). maxmaxCCSS(( MM22,...,,...,MMmm )) 1010 ColCol11 mm 22 max{{CSopt (M ) }} ≤ 9 ((|| n ||++ −−n ))... Withoutmax lossmaxmaxCS of(CCM generalitySS2,...,((MM)M) m we) ≤ may≤ 1099 assumeColnn 1 thatmnnn 2m. By this Without loss of{ generalityoptopt we} may4 assume(| that| + n −≥m).. By this assumptionmax andC by the(M fact) that≤5 n9 α(nG) Col≥n 1 we obtain WithoutWithoutassumption loss loss and of of generality generality bySopt the fact we we that may may4 n assume assume≥³α(G) that that≥|Colnn mm|we.´. By By obtain this this 5 ≥≥1 Without loss of generalitymaxCS( weM2 may,...,44 ≥assumeMm(())) that≥| n | m. By this assumptionWithoutassumption loss and and of bygenerality by the the fact fact{ wethat that may55nn assumeαα}GG that2.ColColn 1¸1 mwewe. By obtain obtain this assumption and bymax theC factS( Mthat2,..., ⁴⁄45 n≥M ≥m α)(G)≥| ≥| Col≥|1| we obtain assumption and by themax fact{ C thatSopt (Mn ¸) α}(G)≤2¸. Colj 1 jwe obtain Fig. 1. The worst-case example for Algorithm 2: a) a graph 3S3,3 maxmaxCmaxCSS(( CMM22,...,,...,(M5 MM≥)mm )) ≤ ≥| | {{ Sopt }} 22.. and machines with speeds s(M1) = 9, s(M2) = s(M3) = s(M4) = 1; For the last case we( may,..., bound) the ratio of maxCS(K) maxmaxmaxCS CCMSSoptopt2 ((MM)M) m ≤≤ b) Gantt chart for the suboptimal schedule; c) Gantt chart for an For the( last) case we{ may bound( } the) ratio2.. of( max) CS(K) to Cid J and thatmax ofC maxS (CMS M) K≤ to Cid J , where optimal schedule toForForC ( the theJ ) last lastand case case that we we of may maymaxoptC bound bound(M the the\K) ratio ratioto C of of(J max max),CC whereSS((KK)) Mididis the ideal machine forSM .\ By the wayid k is estab- totoMidCForCididis((J theJ the)) last idealandand case that that14 machine we of of max maymax forCC boundSSM((MM. By theKK)) theto ratio9to CC wayidid of((JJk max))is,11, whereC where estab-S(K) lished, we have 20 stotal > ∑M K s(M\\) 20 stotal and 20 stotal 14 ∈ 9 11 Fig. 1. The worst-case example for Algorithm 2: (a) a graph 3S MtoMlished,ididCisidis( theJwe the) have ideal idealand thatmachine machinestotal6 of> max∑ for forM CKMSM(sM(.M.) By ByK≥) the thetostotal way wayCidand(Jkk is)is,s estab-total where estab-≥ 3,3 ∑M M K s(M)141420> stotal. These inequalities\ 9209 are obtained111120 us- Fig. 1. The worst-case example for AlgorithmBull. Pol. 2:Ac.: (a) Tech. a graph 67(1) 3 S 2019 lished,34lished, we we have have ss620 >> ∈ ss((MM)) ≥ ss andand ss ≥ and machines with speeds s(M1)=9,s(M2)=s(M3)=s(M4)=3,31; M∑id ∈is the\ s(M ideal) >2020 machinetotaltotalstotal1 .∑∑ TheseM forM KKM inequalities. By2020 thetotaltotal way are obtainedk2020istotaltotal estab-9 us- ingM M theK condition1420 that s ∈∈> maxs≥≥(M9 ). The value11 s≥≥ Fig.Fig.and(b) 1. machines1. Gantt The The chart worst-case worst-case with for speeds the example example suboptimals(M1)= for for Algorithm9 schedule;Algorithm,s(M2)= (c)2:s 2:(M (a) Gantt(a)3)= a a graph graphs chart(M4)= 3 3forSS33,1;3, an3 ∈ \ 66 1>4 total ( ) 920 total ∑lished,∑MM MM weKKss(( haveMM))>>202020stotalsstotaltotal..∑ These TheseM K s inequalities inequalitiesM 20 stotal are areand obtained obtained20 stotal us- us- ingthat∈∈ the is\\ present condition in thethat inequality4 stotal >∈ max determinings(≥M ). Thek isa value conveniently20 stotal≥ andFig.and(b)optimal machinesGantt machines 1. The schedule. chart worst-case with with for speeds speedsthe suboptimalexampless((MM11)=)= for schedule;99 Algorithm,,ss((MM22)=)= (c)ss 2:((MM Gantt (a)33)=)= a charts graphs((MM44)=)= for 3S31; an1;,3 s(M) > 6 s 11 . These inequalities are obtained99 us- ing∑ingthatM the the isM present condition conditionK in the that that20 inequalitytotal44sstotaltotal>> determiningmaxmaxss((MM)).. Thek Theis a value value conveniently4 2020sstotaltotal (b)and(b)optimal Gantt Gantt machines schedule. chart chart with for for the speedsthe suboptimal suboptimals(M )= schedule; schedule;9,s(M )= (c) (c)s( GanttM Gantt)= chart charts(M for)= for an an1; chosen∈ \ constant that asserts that 2(∑M K s(M)) > 5 stotal and 1 2 3 4 thatthat is is present present in in the the inequality inequality1 > determining determining( ∈) kkisis a a conveniently conveniently4 9 optimaloptimal schedule. schedule. ingchosen the conditionconstant that that asserts4 stotal1 thatmax 2(∑sMMK s.(M The)) value> 5 stotal20 stotaland (b) Gantt chart for the suboptimal schedule; (c) Gantt chart for an that 2(∑M M K s(M)) > 2 stotal. By Corollary∈ 1, if44n 10(k chosenthatchosen is present constant constant∈ in\ that thethat inequality asserts asserts1 that that determining 2 2((∑∑MM KKss((MkMis)))) a>> convenientlysstotaltotal≥ andand− optimal schedule. that) 2(∑M M K s(M)) > 2 stotal( ). By Corollary( ) 1, if n55 10(k Proof. We prove the lemma for a 2-element set K = Mi,Mj . 1 , then the∈ ratio\ of max11CS K to Cid∈∈J is at most4 2. Simi- thatchosenthat 2 2(( constantss( that(MM)))) asserts>> ss that.. By By 2( Corollary Corollarys(M 1,)) 1, if> ifnn ≥s 1010((kandk − Proof. We prove the lemma for a 2-element set K = {Mi,Mj }. 1larly,), then∑∑ ifMM then MM ratio10KK(m of maxk C122)S,total(total thenK) to theC∑id ratioM(JK) ofis max at mostC 5(M 2.total Simi-K) to Let S be any subschedule for N on K and Ni,Nj be the sets of ∈∈ \\ 1 ∈ S ≥≥ −− WeWe prove prove the the lemma lemma for for a a 2-element 2-element set setKK== {MM,,MM }.. 1that1larly,)),, then then 2( if∑n the the≥ ratio10 ratio(ms of( ofM− maxk)) max−>1CC)S,Ss( then(totalKK))to.to the ByCCid ratioid Corollary((JJ of))isis max at at 1, most mostC if (n 2. 2.10 Simi-\ Simi-K()k to Proof.Proof.Let S be any subschedule for N on K and Ni,Nj be thei setsi jj of Cid(J )MisM atK most 2. If 2n 10(m 2), then allS theM ratios are the jobs assigned to the corresponding machines in S{{. We show}} ≥∈ \ − − ≥ \ − LetLetSSbebeWe any any prove subschedule subschedule the lemma for for forNN on aon 2-elementKKandandNNii, set,NNjjKbebe= the theM sets sets,M of of. larly,C1larly,)id,( thenJ if if)nn theis at1010 ratio most((mm ofk 2.k max If11)Cn),,S then then(≥K10) the(to themC ratio ratio−id2()J, of then of) maxis max at allCC most theSS((MM ratios 2.K Simi-K)) aretoto Proof.thethat jobsΣ assigned(N) Σ to(N the). We corresponding first transform machines the inequality in S. Wei showj less than≥≥ or equal−− to−− 2. ≥ − \\ id ≤ S { } CClarly,idid((JJ if))nisis at at10 most most(m 2. 2.k If If1nn), then1010(( themm ratio22)),, then then of max all allC the the(M ratios ratiosK are) areto theLetthethat jobs jobsSΣidbe( assigned assignedN any) subscheduleΣS to( toN the) the. We corresponding corresponding first for N transformon K machinesand machines theNi inequality,Nj in inbeSS.. the We We sets show show of lessThe than approximation or equal to 2. coefficient 2 is the best possibleS value ≤ ≥ − − ≥≥ −− \ thatthethat jobsΣΣ ((N assignedN)) ΣΣSS((N toN)) the.. We We corresponding first first transform transform machines the the2 inequality inequality in S. We show lessClessidThe( thanJ than) approximation oris or at equal equal most to to 2. 2. 2. If coefficientn 10(m 2 is2) the, then best all possible the ratios value are idid (s(M ) N s(M ) N ) 0 in the sense that for jobs≥ with the− conflict graph in the shape ≤≤ i j j i 2 lessTheThe than approximation approximation or equal to 2. coefficient coefficient 2 2 is is the the best best possible possible value value that Σid(N) ΣS(sN(M).i We) N| j first|−s transform(Mj) N| i )| the≥0 inequality inof the three sense double-stars that for jobsS , with, presented the conflict in Fig. graph 1(a), in the the schedule shape ≤ 3 3 ((ss((MM))|NN |−ss((MM ))|NN |))22 ≥00 ininof theThe thethree sense sense approximation double-stars that that for for jobs jobsS3 coefficient,3, with with presented the the 2 conflict conflict is in the Fig. bestgraph graph 1(a), possible in the in the the schedule shape shape value ii jj jj ii constructed by the algorithm has the length exactly twice the to the following form|| |−|− || || 2≥≥ ofinof three thethree sense double-stars double-stars that forS jobsS33,3,3,, presentedwith presented the conflict in in Fig. Fig. graph 1(a), 1(a), the the in the schedule schedule shape to the following form(s(Mi) Nj s(Mj) Ni ) 0 constructedoptimal (cf. by Fig. the 1(b), algorithm 1(c)). has the length exactly twice the | |− | | ≥ toto the the following following form form constructedofconstructedoptimal three (cf.double-stars by byFig. the the 1(b), algorithm algorithmS3 1(c)).,3, presented has has the the in length length Fig. 1(a),exactly exactly the twice twice schedule the the 2s(M )s(M ) N N s(M )2 N 2 + s(M )2 N 2 i j i j i2 j2 j2 i2 optimalconstructedoptimal (cf. (cf. Fig. byFig. the 1(b), 1(b), algorithm 1(c)). 1(c)). has the length exactly twice the to the2 followings(Mi)s(Mj form) N| i ||Nj |≤s(Mi) N| j | + s(Mj) N| i | ≤ 4. 4-approximation algorithm for the problem s(M|)2||N |≤( N + 12)+2| s(|22M )2 N (22N| |+22 ≤1). optimal4. 4-approximation (cf. Fig. 1(b), 1(c)). algorithm for the problem 22ss((MMii))s≤s((MMjj))NiN2ii|NNjj| | sjs(|(MMii)) NNjj ++j2ss((M|Mjij|))| NNii|i Qm p j = 1,G = bisubquartic ΣCj, where m s(Mi|)| ||N||j (|≤|≤Nj + 1)+2|| s(|M|2 j) Ni ( N2||i +||21≤≤). 4.4. 4-approximation 4-approximation algorithm algorithm for for the the problem problem 2s(Mi≤)s(Mj) 2N2|i N| j| |s(Mi) Nj +22s|(M|j)| N| i Qm |p j = 1,G = bisubquartic Σ| Cj, where m ∈ ss((MMii))| NN||jj ((|≤NNjj2++11)+)+|2ss((MM| jj)) NNii ((NNi|i ++|11)≤).. 2,|3,4 | ∈ By adding≤≤s(Mi)s(2|M| j)(|| ||Ni || + Nj + Ni2|+| |N| ||j )||to both sides 4.Qm 4-approximationQm{2,3pp,j4j ==} 11,,GG == bisubquarticbisubquartic algorithmΣ forΣCCjj,, the where where problemmm s(Mi) Nj (| N2|j + 1| )+2| s(M| j)| N|i ( N| i + 1). || || ∈∈ Byand adding by a simple≤s(Mi)s( transformationM|j)(|N|i |+ N wej + obtainNi +| N|j |) to| both sides WeQm{ begin,, ,p, j this}= section1,G = withbisubquartic the following.ΣCj, where m | |22 | |22 | | | | We begin22 33 4 this4 section with the following. ByByand adding adding by a simpless((MMii))ss transformation((MMjj)()(NNii ++ NN wejj + obtain+ NNii ++ NNjj ))toto both both sides sides {{ | }} | ∈ || ||2 || ||2 || || || || Lemma2,3, 3.4 Let K M and N J . Σid(N) is a lower bound andByandadding by by a a simple simples(Mi) transformation transformations(Mj)( Ni + N we wej obtain obtain+ Ni + Nj ) to both sides WeWe begin begin this this section section with with the the following. following. s(Mi)s(Mj)( Ni + Nj )( Ni + Nj + 1) Lemma{ 3. Let} K ⊆M and N ⊆J . Σid(N) is a lower bound | | | | | | | | Weon begin the total this completion section⊆ with time the following.⊆of any subschedule for N on K, and by a simples(Mi)s transformation(Mj)( N| i |+ N| j we)(| obtainN| i |+ N| j |+ 1) ≤ LemmaLemmaon the total 3. 3.LetLet completion K K MM andand time N N of anyJJ.. subscheduleΣΣidid((NN))isis a a lower lower for N bound bound on K, (s(Mi)+s(Mj))(s(M| j)|Ni |( N|i +| 1)+| |s(M|i) Nj ≤( Nj + 1)). where Mid is the⊆⊆ ideal machine⊆⊆ for K. ss((MMii))ss((MMjj)()(NNii ++ NNjj )()(NNii ++ NNjj ++11)) (s(Mi)+s(Mj))(s(Mj) N| i (| N| i |+ 1)+s(Mi) N| j (| N| j |+ 1)). onLemmaonwhere the the Mtotal totalid 3.isLet completion completion the K idealM machineand time time N of of for any anyJ K.. subschedule subscheduleΣid(N) is a forlower for N N onbound on K, K, || ||| |||| ||| || || || || | |≤≤| | ⊆ ⊆ ((ss((MMii)+)+ss((MMij)j))())(s(Mss((MjM)(jj)N)NiNi+i ((NNiij +)(+11N)+)+i +ss((MNMiji))+NN1jj)((NNjj ++11)))).. whereonwhere the M M totalidid isis completionthe the ideal ideal machine machine time of for for any K. K. subschedule for N on K, | | | | | | | | ≤ || || || || Bull. Pol. Ac.:|| Tech.|| || XX(Y)|| 2016 4 (s(Mi)+s(Mj))(s(Mj) Ni ( Ni + 1)+s(Mi) Nj ( Nj + 1)). where4 Mid is the ideal machine for K. | | | | Bull. Pol. Ac.:| Tech.| | XX(Y)| 2016 44 Bull.Bull. Pol. Pol. Ac.: Ac.: Tech. Tech. XX(Y) XX(Y) 2016 2016 4 Bull. Pol. Ac.: Tech. XX(Y) 2016 Tytus Pikies,Tytus Marek Pikies, Kubale Marek Kubale Tytus Pikies,Tytus Pikies, Marek Marek Kubale Kubale Tytus Pikies, Marek Kubale Tytus Pikies, Marek Kubale 1. By Lemma1. By 1, Lemma maxC 1,( M max,...,C M( M ),...,2maxM )C 2max(M )C (M ) S { 2 S {m}2 ≤ m} ≤Sopt Sopt 1. By1. Lemma By Lemma 1, max 1,C maxS( MC2S,...,( M2M,...,m )Mm 2max) 2maxCSopt (CMSopt) (M ) 1. By Lemma 1, maxC ( M ,...,M since) 2max at most1.sinceC By twice at( LemmaM most the) minimaltwice 1, max the{ numberC minimalS({M2,..., of number} jobsM≤m is}) ofscheduled≤ jobs2max isC scheduledSopt (M ) S { 2 m} ≤sincesince at mostSopt at mosttwice twice the minimal the minimal number{ number of jobs} of≤ is jobs scheduled is scheduled since at most twice the minimal numberon ofM jobs2,..., issinceonM scheduledmM. at2,..., mostMm twice. the minimal number of jobs is scheduled ons(MM2on,...,) M[2Ms1,...,(smM. M), m2 .s[ 1 s ) , 2 s ) C (M ) C (M ) on M ,...,Mm. If 1on If24 total1 m5 . total4 totalthen5 total we maythen estimate we may estimateS 1 S 1 2 ∈ 1 ∈ 1 2 2 1 2 If s(MIf1)s(M[14)stotal[ 4,s5totalstotal1, 5)stotalthen) we1then may we estimate may estimateCS(MC1)S(M1) If s(M1) [ stotal, stotal) then we mayusing estimate CorollaryusingC∈S Corollary( 1,M1 1 because)∈ 4 total 1,2 becausen5 totalCol2 n. IfCol the2 number. If the of numberS 1 of 4 5 ∈ ≥|1 1 | ≥| | ∈ 1 usingusing Corollary Corollary 1, because 1, because2 n 2Coln 2 .Col If2 the. If2 number the number of2 of Better polynomial algorithms for scheduling unit-length jobs using Corollary 1, because n Col2jobs. If scheduled thejobs number scheduled on M of2,..., onMmMin2,...,Sopt≥|Mis2m greaterin≥|S|opt thanis2| greater5 n, then than 5 n, then 2 ≥| | 2 2 ≥| max| jobsC ( scheduledjobsMmax,...,2 scheduledC M( onM ),...,M2 on,...,2maxMM2M,...,C)m inM2max(Smoptin),isCS becauseopt greater(is greater) we, than because sched-5 thann, then we5 n, sched- then jobs scheduled on M2,...,Mm in Sopt is greaterS thanjobs2 scheduledn,S thenm 2 on m2 Sopt Mm in Soptopt isM greater than 5 , then max{CmaxS( M5CS,...,( {M}M,...,m≤)Mm2max}) ≤2maxCS (CMS ),( becauseM ), because we sched- we sched- Dividing both the sides by 2s(Mi)s(Mj)(s(Mi)+s(Mj)) we get and by Lemma 3, the total completion time of Col1 on M1 is ule on M2max,...,uleC onM2S(mMMat2,...,2,..., mostMMm twicemat) most the2max numbertwiceopt CS theopt of(M number jobs), because assigned of jobs we assigned sched- Better polynomial algorithms for scheduling unit-length jobs maxCS( M2,...,Mm ) 2maxCSopt (M ), because we{ sched-{ } ≤ } ≤ opt at most 4 times greater than the the total completion time of { } ≤ ule onuleMS 2 on,...,M2M,...,mS4atnM mostm at(G mosttwice4)n twice theCol( numberG the) numberCol of jobs of assigned jobs assigned ( Ni + Nj )( Ni + Nj + 1) ule on M ,...,Mm at most twice the numberto them ofjobs inuletoopt them onassigned, since2 in opt5 ,m sinceαat most5 twiceα 1 the[5]. number If the1 [5]. number of jobs If the assigned number 2 ≥4 4 ≥|≥ | ≥| | Σid(N)= | | | | | | | | Col1 jobs in any other schedule. Hence 4 of jobsto them scheduledtoof themin jobsSoptscheduled inon, sinceSMopt,...,, since5 n onMM5αinn(,...,GS)αM(isGCol) lessin1S thanCol[5].is1 or If less[5]. equal the than If numberthe to or number equal to Dividing both the sides2( bys(M 2s)+(Mis)(sM(M))j)(s(Mi)+s(Mj)) we get and by Lemma 3, the total completion time of Col1 on M1 is to them in Sopt , since n α(G) Col1 [5]. Ifto the them number in opt2 , since≥m5 2 ≥optα≥|m ≥|| opt 1| [5]. If the number i j | | 5 2 of jobsof2 scheduled jobs scheduled on M on,...,MM,...,m≥inM3Smoptnin≥|isS lessopt 3is than| lessn or than equal or equal to to ≥ ≥| n|, then maxofn jobs,C thenS scheduled( maxM )CSC2 onS(MM(M)2,...,1)CSMm(Min1.)S Letopt is us less bound. Letthan the us or bound equal the to at most 4 timesΣS(Col greater1) 4 than(ΣS the(N theM )+ totalΣS completion(Nr)). time of of jobs scheduled on M2,...,Mm in Sopt is5 less2 than25 or equalopt to opt opt 2 opt2 stotal3 n 32 sntotal (s(NMi j+) NNi j( )(NiN+i 1+)+Nsj (+Mi1))Nj ( Nj + 1) opt 1 opt n, then2 n, max thenC maxS (CM≥S ) (MCS) ≥(CM≥S1) (M1) ≥.3 Letn us. Let bound us bound the the Σid(N)= | | | | | || || | | | | | | | Col jobs in any other≤ schedule. Hence 2 3 n 5 5 n, then maxopt CSopt (M )opt CSopt (M21s)total 2 stotal . Let us bound the 1 n, then maxCS (M ) CS (M1) ratio. ofLet max us5ratio boundCS( ofM max the2,...,CSoptM( ≥mM2),...,to≥ maxMoptmC≥)Soptto( maxM≥ 2)CsintotalSopt this(M case.) in this case. ≤ 2(s(Mi)+2ss((M j)))s(M ) | | 5 opt opt 2 stotal { { } ≥ } ≥ i j Thus we obtain ≥ ≥ Let ratioM be ofratioLet the maxM of idealC maxSbe( machineM theC2S,...,( idealM2M for,..., machinem )MMtom,..., max) fortoMC maxSMopt.,...,( ByCMSopt) LemmaM(inM this.) Byin 2, case. thisLemma case. 2, ratio of maxCS( M2,...,Mm ) to maxCS (Mid) in thisid case. { S { 2 } 2m} m 2 Sopt m ( ) ( + )+ ( ) ( + ) ΣS(Col1) 4(ΣSopt (NM1 )+ΣSopt (Nr)). opt Let MLetbeM thebe ideal the machineideal{ machine{ for M} for,...,{M}M,...,.M By Lemma}. By Lemma 2, 2, sΣSM(Nj ).Ni Ni 1 s Mi Nj Nj 1 ≤ { } we have Letidwe M haveid be the ideal machine for2 M2,...,m Mm . By Lemma 2, | | | | | | | | ΣS(J )=ΣS(Col1)+ΣS(Col2) Let Mid be the ideal machine for M2,...,Mm . By Lemmaid 2, { { 2 } m} ≤  { we} havewe have { } If the number≤ of machines is2 greaters(Mi)s than(Mj) 2, the thesis follows Thus we obtain we have wemax haveCS( Mmax2,...,CSM( mM2),...,Mmm) 2 m 2 ΣS(Col1)+4ΣS(Col2) { { } 1 + } − 1. + − . ≤ maxCmaxS( MC2S,...,( M2M,...,m )Mm ) m 2m 2 from inductionΣ onS(NK).. Σ (J )=Σ (Col )+Σ (Col ) maxCS( M ,...,Mm ) m 2 Cidmax(Col{ 1S)C{id (2Col≤}1) m1}Col+ ≤11−+ .Col− 21 . ≤ | | S 4SΣS (1NM )+S 4ΣS2 (Nr)+4ΣS(Col2) { 2 } 1 + − . C (ColC{ )( Col ) ≤ }| ≤Col1| + Col| − |. ≤ opt 1 opt id Cid1 (Col1) ≤ 1 Col1 If the number of machines is greater than 2, the thesis follows Cid (Col1) ≤ WeCol also1 haveWe also have id 1 | || 1| ΣS(Col1)+4ΣS(Col2)  | | Algorithm 3 A 4-approximation algorithm for the problem ≤ 4ΣSopt (NM1 )+4ΣSopt (Nr)+4ΣSopt (N Col2 ) | We also| We have also have from induction on K . ≤ | | We also haveC (Col )C (Col10 )Col 10 Col 4ΣS (NM )+4ΣS (Nr)+4ΣS(Col2) We also have id 1 id 1 1 1 Qm p j = 1,G = bisubquartic| | ΣCj, where m 2,3,4 = opt ( 1). opt C (ColC )(Col )|10 Col|10. Col| |. ≤ 4ΣSopt J id Cid1 (Col1) 101 Col1 | | ∈{ } C (Col ) 10 Col maxCSopt (maxMid)C≤Sopt9(1Mn)|≤ 9||. n1|. 4Σ (N )+4Σ (N )+4Σ (N ) id 1 1 | |. AlgorithmInput: A bisubquartic 3 A 4-approximation graph G. algorithm for the problem Sopt M1 Sopt r Sopt Col2 | |. maxCmaxSopt (CMSopt) (≤M9) ≤ n9 n In both cases≤ we have ΣS(J ) 4ΣSopt (J ), hence| Algo-| ( ) maxCSopt (M ) ≤ 9 n A schedule maxCSopt M ≤ 9 Byn combiningBy combining both inequalities both inequalities we obtain, we obtain, QmOutput:p j = 1,G = bisubquartic ΣCj, where m 2,3,4 = 4ΣS (J ). ≤ By combiningBy combining both inequalities both inequalities we obtain, we obtain, | | ∈{ } rithm 3 is 4-approximate.opt Similar observations may be used By combining both inequalities we obtain, Input:1. (ColA1, bisubquarticCol2)=Non-Equitable graph G. Coloring(G). By combining both inequalities we obtain, maxCS( Mmax2,...,CSM( mM2),...,10Mm Col) 1 10 mCol21 m 2 to establish that the algorithm( is) 4-approximate( ) for the prob- { { } (|} | + (| − )|.+ − ). 2. M1 Col1, M2,...,Mm Col2. In both cases we have ΣS J 4ΣSopt J , hence Algo- maxCmaxS( MC2S,...,( M2M,...,m )Mm 10) Col101 Colm1 2m 2 Output: A schedule lems Q2 p = 1,G = bisubquartic≤ ΣC and Q3 p = 1,G = maxCS( M2,...,Mm ) 10 Col1 m 2maxCSopt{ (maxMS {)CS2opt (≤}M9)m} n(≤| 9(||+nn1|−+ ).−n ). ← ← rithm 3 is 4-approximate.j Similar observationsj mayj be used { } (| | + − ). maxCmax({CM ) (M )≤ }9 ≤ 9n (| n |n+ −n ). 1. (Col1,Col2)=Non-Equitable Coloring(G). | | | maxSopt CSopt (M ) ≤ 9 n n tobisubquartic establish thatΣC thej. algorithm is 4-approximate for the prob- maxCSopt (M ) ≤ 9 Withoutn lossnWithout of generality loss of generality weopt may assume we may that assumen m that. Byn thism. By this | Theorem2. M1 Col 2. Algorithm1, M2,...,3Mmis 4-approximateCol2. for the problem The approximation coefficient 4 is the best possible value in WithoutWithout loss of loss generality of generality we4 may we assume may4 assume that≥n thatmn. By≥m this. By this ← ← lems Q2 p j = 1,G = bisubquartic ΣCj and Q3 p j = 1,G = Without loss of generality we may assumeassumption that n Withoutassumptionm and. By by lossthis the and of fact generality by that the5 factn weα that( mayG)5 n assumeColα(1G)we that≥ obtainColn ≥1mwe. By obtain this | | | ≥4 4 ≥|≥ | ≥| ≥ | Qm p j = 1,G = bisubquartic ΣCj, where m 2,3,4 . the sense that for any ε > 0 we may find such integers l and 4 assumption≥assumption and by and the by fact the that fact5 thatn α5 n(G)α(GCol) 1 Colwe1 obtainwe obtain | | ∈{ } bisubquartic ΣCj. assumption and by the fact that n α(G) Colassumptionwe obtain and by the fact that≥ 5 n ≥ α≥|(G) ≥||Col1| we obtain Better polynomial algorithms for scheduling unit-length jobs with bipartite incompatibility graphs on uniform machines | 5 ≥ ≥| 1| maxCS( Mmax2,...,CSM( mM2),...,≥Mm ) ≥| | TheoremProof. Let 2. usAlgorithm begin our3 analysisis 4-approximate with the case for of the a problem k thatThe forapproximation a graph G consisting coefficient of 4l iscopies the best of possible 3S3,3, the value graph in max{CmaxS( MC2S,...,( {M2}M,...,m )2M. m }) 2. maxCmax(CmaxMS()MC2,...,(≤MM)m ) ≤ presented in Fig. 1(a), and for machines with speeds s(M1)= maxCS( M2,...,Mm ) Sopt{ { Sopt } 2}. 2. Qmwithp 4j machines.= 1,G = bisubquartic Let S be a scheduleΣCj, where obtained m by2,3 Algorithm,4 . 3 the sense that for any ε > 0 we may find such integers l and { } 2. maxCmaxSopt (CMSopt) (M )≤ ≤ | | ∈{ } ks(M ) and s(M )=s(M )=s(M ) the algorithm constructs maxC (M ) ≤ maxCSopt (M ) ≤ and let Sopt be any schedule with the minimal total completion k that4 for a graph2 G consisting3 of l4 copies of 3S3,3, the graph Sopt For the lastFor case the welast may case bound we may the bound ratio of the max ratioCS of(K) maxCS(K) Proof.● If ColLet us begin N our N analysis N , with then the by caseLemma of a1, problem C (K)C (K) 4. 4-approximation Algorithm for the problem 2 M2 M3 M4 a schedule S with ΣS(J ) that is at least 4 ε times( greater)= to C For( to) theForandC last the( that case) last ofand wecase max that mayC we of( boundmay maxKC bound) the(to C ratio theK( ) ratioofto), maxC where of( maxS ),C whereS(K) time.j We mayj ¸ j divide[ J into[ setsj NM1 , NM2 , NM3 and NM4 , presented in Fig. 1(a), and for machines with− speeds s M1 For the last case we may bound the ratioid J of maxForidC theSJ(K last) case weS M may boundS M id theJ ratio ofid J max S with 4Col machines. 2 N Let S Nbe a schedule N , hence obtained by Algorithm 3 C ( C) ( ) C (\ C (K) \KC) ( C) ( ) Qm pj = 1, G = bisubquartic ΣCj, 2 M2 M3 M4 ksthan(M the) minimals(M )= one.s( LetM l)=(s10(M )4ε)/(6ε) and let k 180l. M tois theidtoMJ idealCidis(andJ themachine) thatand ideal of that for machine max ofM . maxS M ByforCS theM(M. wayto ByK)kid thetoisJC way estab-id,(J wherek),is where estab- andwhere letj NSMji ∙isbe the anyj set schedule[ of the[ jobs with assignedj the minimal to Mi totalin Sopt completion. 4 and 2 3 ≥ −4 the algorithm constructs≥ to Cid(J ) and that of maxCS(M K) idto Cid(Jid),id where S\ \ id j j opt Then we have M isM theis ideal14 the ideal machine14 machine for M for.M By9 . the\ By way the9 11k wayis estab-k is11 estab- where m {2, 3, 4} a schedule S with ΣS(J ) that is at least 4 ε times greater \ lished,id weMlished, haveid is the westotal have ideal> ∑ machinestotals(>M∑) for Mss(total.M) Byand thestotals waytotalandk iss estab-total time. We may divide J into sets NM , NM , NM and NM , 10 Mid is the ideal machine for M . By the way k is estab-20 14 1420M K M 20K 9 92020 11 1120 2 If Col2ΣS(ColNM22) s6∈ > s(≥M∈) s(M)s ≥ 9 ands ands ≥11 s Fig. 1.≥ TheFig. worst-case 1. The worst-caseexample for example Algorithm for 2:Algorithm (a) a graph 2: (a) 3S3 a,3 graph 3S3,3 • | |≥| ∪ ∪opt | 2 3 4 | |≤ than the minimal one. Let l (10 ε4.ε)/(6ε) and let k 180l. 14 9 lished,11 we20 havetotal20 stotal∑M>K∑M K s(M20) total20 stotal20andtotal20 stotal where NM is the set of the jobs assigned[ to[Mi in Sopt . lished, we have stotal > ∑M K s(M) ∑MstotalM Kands∑(MM)sM>totalK20ss(totalM).>20 These20 stotal∈ inequalities. TheseM∈K ≥ inequalities are≥ obtained20 are us- obtained20≥and us-Fig.≥ machines 1.WeFig.and The begin with 1. machines worst-case The speeds this worst-case withsections example(M speeds)= examplewith9 for,ss( (theM Algorithm)= for)=following. Algorithm9s(,Ms(M 2:)=)= (a)s( 2: aMs( graphM (a))=)= a1; graph 3sS(3M,3 )= 3S3,31; 2 NM2 i NM3 NM4 , hence 6l≥+ 4 ≤− ≥ 20 20 ∈ \ 20∈ \ 6 6 ∈ ≥ ≥ Fig. 1. The worst-case1 example12 for Algorithm3 2 2:4 (a)3 a graph4 3S3,3 | ∪ ∪ | Then we have 6 ∈ ≥ ∑M M∑MK sM(MK) s>≥(M201)s>totalFig.20.s 1.total These The1 . These worst-case inequalities inequalities example are obtained are for9 Algorithmobtained us-9 us- 2: (a) a graph 3S3,3 s(M) > s . These inequalitiesing the are∈ condition∑ obtaineding\M∈M the\K conditionthat us-s(M)s>total20 that>stotalmaxs.total Theses(M>)max. inequalities Thes(M value). The arestotal valueobtained(b)s us-total Ganttand machines chartand(b) machines Gantt for with the chart suboptimalspeeds with for speeds thes(M suboptimal1 schedule;)=s(M91,)=s(M (c)29 schedule;)=,s Gantt(Ms2(M)=3 chart)= (c)s(M Gantts3 for(M)=4 an)=s chart(M1;4)= for1; an If InCol this caseN Col1N NNM , ,so then we byhave Lemma 1, Col 10 ∑M M K 20 total ∈ \ 4 and1 machines14 with speeds s(M )=20 99,s(M 9)=20 s(M )=ands( machinesM )=1; with speeds s M1 9 s M2 s M3 s M4 1; 2 ΣS(MCol2 2)M<3 4ΣSMopt1 4(NM2 NM3 NM4 ). 2 (4) The optimal assignment is to assign the jobs corresponding to ∈ \ ing theing condition the condition that thatstotal1>stotalmax>s(maxM )s.(M The). value The1 valuestotal29 stotal(b)3 Gantt(b) Gantt chart4 for chart the for suboptimal the suboptimal schedule; schedule; (c) Gantt (c) Gantt chart for chart an for an • | |≥| j ∪ j ∙ ∪j j | ∪ ∪ | |≤ ε. 1 > ( that) is presentingthat the inis9 present the condition inequality in4 the that inequality determining4 stotal > max determiningk iss( aM conveniently). Thek is a value20 conveniently20optimalstotal schedule.Lemma(b)optimal Gantt schedule.3. chart Let forK the M suboptimal and N schedule; J. Σid(N (c)) Ganttis a lower chart bound for an 2 NM NM NM , hence an independent set of vertices6l + 4 with≤ cardinality α(G)=18l to ing the condition that 4 stotal maxs M . The value 20 stotal (b) Gantt4 chart for the suboptimal schedule;20 (c) Gantt chart for an µ µ In this2 case3 Col 4 N , so we have chosenthat constant isthatchosen present is present thatconstant in the asserts in inequality the that that inequality asserts 2 determining( that determinings( 2M())k>is a4ssk conveniently(Mis)) aand conveniently> 4 s andoptimalonoptimal schedule. the total schedule. completion time of any subschedule for N on K, | ∪ ∪ (1Col| ) M Σ1 N 4Σ N . k that is present inoptimal the inequality schedule.∑M K determining∑M K5 totalis a conveniently5 total |ΣS |≤|1 | Sopt ( M1) Sopt ( M1) the fastest machine and to assign the remaining jobs, with car- that is present in the inequality determining is a conveniently ∈ ∈ 4 4 ΣS(Col ) <∙4ΣS (NM ∙NM NM ). (4) The optimal assignment is to assign the jobs corresponding to chosenchosen4 constant constant that asserts1 that asserts that1 2 that(∑M 2K(∑s(MMK))s(>M))stotal> 4andstotal and 2 opt 2 3 4 that 2( chosenthat 2(s( constantM)) > thatss(M)) asserts. By> Corollarys that. 2By(∑ 1,CorollaryM ifKns(M105)) 1,(>k if 5nstotal10and(k where Mid is the ideal machine for K. ΣS(Col1) ΣSopt (NM1 ) ∪ 4ΣSopt∪(NM1 ). dinality equal to 6l, to the other machines in a balanced way. chosen constant that asserts that 2(∑M K s(M))∑M> M5 stotalK ∑andM M K2 total1 12 total ∈ ∈ 5 an independent set of vertices with cardinality α(G)=18l to ∈ that 2(that∈ \ 2( s∈(M\))s>(M))s > 1.s By Corollary. By Corollary∈ 1, if≥n 1, if10−n(k≥10(k − In this case Col ≤N , so we have≤ 1 1), then thethat1∑)M ratio, 2thenM(∑ ofMK the maxM ratioKCsS(M( ofK2))) maxtotalto> C2CidsStotal(KJ).)to ByisC Corollaryatid( mostJ ) is 2. 1,at Simi- ifmostn 2.10Proof. Simi-(k WeProof. prove theWe lemma prove the for lemma a 2-element for a 2-element set K = M seti,MKj=. Mi,Mj . Therefore 1 M1 Let us denote this schedule as S . Then that 2(∑M M K s(M)) > stotal. By Corollary 1, if n ∈10∑\(Mk∈M \K 2 total ≥ ≥− − { } { } Therefore | |≤| | the fastest machine and to assignopt the remaining jobs, with car- 2 1), then1), the then ratio the∈ of ratio\ max ofC maxS(K)CtoS(KC) to(JC) (isJ at) mostis at 2.most Simi-≥ 2. Simi-Proof.− Proof.We proveWe prove the lemma the lemma for a 2-element for a 2-element set K set= KM=i,MMj i.,Mj . ∈ \ larly, if n1larly,),10≥ then(m if then −k ratio101()m, of then maxk theWe1C)S ratio, prove( thenK)id ofto the the maxCid ratio lemma(JCS() ofMis formax atK a mostC) 2-elementSto(M 2.Let Simi-K) setStobeK anyProof.Proof.=LetM subscheduleS ,beWeWeM any prove prove. subschedule forthe the Nlemma lemmaon K for for forandN a a Non2-element i,NKj andbe theN set i, setsN{ Kj be= of { theM}ii, sets, MMjj}} of.. 1), then the ratio of maxCS(K) to Cid(J ) is at most 2. Simi- Proof. i j { } ΣS(Col1) ΣSopt (NM1 ) 4ΣSopt (NM1 ). dinality equal to 6l, to the other machines in a balanced way. larly,larly, if≥n if10n−(m≥10−k(m 1−)k, then−1), the then ratio the of ratio max ofC max(\MC (KM) to\K) Letto S Letbe{ anyS be subschedule any} subschedule for N foron NK onandKNandi,NjNbei,N thej be sets the of sets of ΣS(J )=ΣS(Col≤ 1)+ΣS(Col≤2) 18l(18l + 1) 2l(2l + 1) C (J ) islarly,C at( mostJ if n) is 2.10 at If( mostnmLet 10kS 2.be( Ifm1) anyn, then2) subschedule10, then the(m ratio all2) the, of then for ratios maxS N allConS arethe(KM ratiosandtheKN) jobsareto,N assignedbeLetLetthe the S jobs be sets to any assigned ofthe subschedule corresponding to the corresponding for machines N on K and in machinesS N. Weii,, NNj showj inbeS thethe. We setssets show ofof Σ (J )= + 3 larly, if n 10(m k 1), then the ratio ofid maxCS(Mid≥ K)≥to− −− − \S \ ithej jobsthe assigned jobs assigned to the to corresponding the corresponding machines machines in S. We in S show. We show Therefore Let us denoteSopt this schedule as Sopt . Then ≥ − − Cid(JCid) (isJ\ at) mostis≥ at 2.most If≥−n 2.− If10n−(m≥102(m), then−2), all then the all ratios the ratios are\that areΣid(Nthethat) jobsΣSid( assigned(NN)). WeΣ firstS to(N the) transform. We corresponding first transform the inequality machines the inequality in S. We show 4Σ (N )+4Σ (N N N ) 2ks(M4) 2s(M4) C ( ) is at most 2. If n 10(m 2),less then than all theC orlessid equal ratios(J than) tois are or 2.at equal mostthe to 2.jobs 2. If assignedn 10(m to the2) corresponding, then all the ratios machines are intheS. jobs We show assigned to the corresponding machines in S. We show Sopt M1 Sopt M2 M3 M4 id J ≥ ≥ − − that Σthatid(≤NΣ)id(NΣS)(N≤)Σ.S We(N) first. We transform first transform the inequality the inequality ≤ ∪ ∪ 2 2 2 ≥ − less thanless or than equal or equal to 2. to 2. thatthat Σid(N) ΣS(N)).. WeWe firstfirst transformtransform thethe inequality inequality ΣS(J )=ΣS(Col1)+ΣS(Col2) 18180l(l18+(l +61l) + 3l2)lk(2l +6l1)+ 4l less than or equal to 2. The approximationlessThe than approximation or equal coefficientthat toΣ 2.id( coefficientN 2) is theΣS( bestN 2). is We possible the first best transform value possible the value inequality id≤ ≤ S = 4ΣS (J ). ( )= + 3 The approximationThe approximation coefficient coefficient≤ 2 is the 2 is best the possible best possible value value ∙≤ 2 2 opt ΣSopt J . in the senseinThe thatthe approximationsense for jobs that with for jobsthe coefficient conflict with the graph2 conflict is the in best the graph shape possible in the value shape (s(Mi) Nj (s(Ms(Mi) jN) jNi )s(Mj0) Ni ) 0 ≤ 2ks(ksM4(M) 4) 2s≤(M4s)(M4) The approximation coefficient 2 is the best possible value | |− | ||−| ≥2 | |2 ≥ 4ΣSopt (NM1 )+4ΣSopt (NM2 NM3 NM4 ) in thein sense the sense that for that jobs for with jobs the with conflict the conflict graph graph in the in shape the2 shape (s(Mi)(sN(Mj i) Ns(jMj)sN(Mi )j) Ni 0)2 0 InequalityInequality (4) (4)≤ comes comes from from the the following following observation.∪ observation.∪ Let Let us us 2 2 2 in the sense that for jobs with the conflictofthree graph double-starsin inof the the three sense shape double-starsS that3,3, presented for jobsS3,3, with presentedin Fig. the(s( 1(a), conflictMi in) N Fig. thej graph schedule 1(a),s(M inj the) N thei schedule) shape0 | |−i | j|−| | j |≥i| ≥ 180l +(6l + 3l)k 6l + 4l | |− | | ≥ =Col4ΣS =(JN). N N Algorithm 3 constructs a schedule with 12l jobs assigned to of threeof threedouble-stars double-starsS3,3, presentedS3,3, presented in Fig. in 1(a),| Fig.|− the 1(a), schedule the| schedule| to≥ the followingto the followingform form assumeassume that that Col2 opt 2 2 NM2 NM3 NM4 .. The The total total comple com- - . of three double-stars S , presented in Fig.constructed 1(a), theofconstructed threeby schedule the double-stars algorithm by the algorithm hasS3,3 the, presented length has the exactly in length Fig. twice 1(a), exactly the schedule twice the | |2 | M2∪ M3∪ M4| ≤ ks(M ) ≤ s(M ) 3,3 constructedconstructed by the by algorithm the algorithm has the has length the length exactly exactly twice twice the theto theto following the following form form pletion time inj a greedyj ∙ assignmentj [ [ is not greaterj than in the M1 and 12l jobs assigned to M2,M4 3,M4. So we have4 constructed by the algorithm has the lengthoptimal exactly (cf.constructedoptimal Fig.twice 1(b), (cf. the by 1(c)).Fig. theto 1(b), the algorithm following 1(c)). has form the length exactly twice the toto the the following form Inequalitytion time (4) in comesa greedy from assignment the following is not observation. greater than Let in usthe 2 2 2 22 2 2 2 assignment in which we schedule exactly 2 N jobs on M , Algorithm 3 constructs a schedule with 12l jobs2 assigned to optimaloptimal (cf. Fig. (cf. 1(b), Fig. 1(c)).1(b), 1(c)). 2s(M )s(M2s)(MN )sN(M ) sN(MN) N s(+Ms)(MN) N+ s(M ) N assumeassignment that Col in 2which= 2 NweM scheduleNM NexactlyM . TheM 22 N total jobs com- 2on 12l(12l + 1) 4l(4l + 1) 24l + 6l optimal (cf. Fig. 1(b), 1(c)). i j ii j j i i j j2 i22 j j2 i2 2j 2 i2 2 3 4 | | M2 ( )= + . ( ) (| ))||( |≤) | || ( |≤| ) |( )2+| (2| |+)|( ≤)2 | 2| ≤ 2 NM jobs on| M3| and| 2 NM∪ jobs∪ on M|4. Forj eachj of the M andΣS 12Jl jobs assigned to M ,3M ,M . So we have 2 2 22s M2i2s(M2ij)sN(Mi jN) jN2i NsjMi s(NMji2) Nsj M+j s2(MNij) Ni pletionM 3, 2 timeN in jobs a greedy on M assignment and4 2 N is jobs not greateron M . thanFor each in the of 1 2ks(M ) 2 32s(M4 ) ≥ s(M ) 4. 4-approximation4. 4-approximation algorithm2s(Mi) algorithms(M forj) Ni theNj for problems(M thei) N problemj + s(Mj) Ni s(M ) i N| s((||MNj |)|≤+i||N1)+j(|≤Ns(M|+)1i|)+N| s(j(|MN )+|1N).|j( N≤| i+| 1≤). | 2 | M3 3| | M4 4 4 4 4 | || |≤ | | | | ≤ i j2 |ji 2 || j |≤j j |i2 | ij 2 i | i | ≤ machines,j inj this assignment thej totalj completion time of the 2 4. 4-approximation4. 4-approximation algorithm algorithm for the for problemthe problem ≤ s(M| i≤)s|(NM| ji)(|2NN| jj +(| N|1)+j |+s1(M)+| j)s|(MN| ij)(|2NN|i i+(| 1N| )i.|+ 1). assignmentthe machines, in which in this we assignment schedule exactly the total 2 N Mcompletion2 jobs on M time2, 12l(12l + 1) 4l(4l + 1) 24l + 6l 4. 4-approximation algorithm forQm thep j problem=Qm1,Gp j==bisubquartic1,G = bisubquartics(MΣC)2j,N where( NΣC+j,1m)+ wheres(M )m2 N ( N + 1). s(Mi) Nj ( Nj + 1)+s(Mj) Ni ( Ni + 1). jobs assigned to a machine is less than four| times| the total Hence we( get)= + . Qm| pQm=|p ,=G =,Gbisubquartic= bisubquartic| i Cj | Cj ∈m jm ∈i i ≤ ≤ | | || || | | | | | | | | | | 2 NofM thejobs jobs on assignedM3 and to 2 aN machineM jobs is on lessM4 .than For four each times of the the ΣS J 3 Qmj p1j = 1,G = bisubquartic≤ Σ| |j,|Σ whereC| j, where m| | | | 2 2 2 2 3 4 2ks(M4) 2s(M4) ≥ s(M4) Qm p j = 1,G = bisubquartic ΣCj2,, where3,4 2m,3,j4 Σ j, where By addingBys(M addingi)s(Mjs)((MNii)s(+MjN)(j Ni+ +N2 i N+j N+j2 )Ntoi + bothNj sides) to both sides completion| | time of the jobs| assigned| to this machine in S . 2 | | | | ∈ ∈ By adding s(M )s(M2 )( N2 2 + 2N + N + N ) to both machines,total completion in this assignment time of the the jobs total assigned completion to this time machine of theopt 10 24l + 6l ΣS(J ) | | { 2,3},{42,3,∈4 } By addingBy addings(Mi)s(M|ij))(is|(NMij|)(+j N|| Ni 2|j i+| +N|| jN2|i|+j+|N|Ni j|+) toiN| bothj )| toj sides both sides 4 ε 4 = . 2,3,4 We begin thisWe beginsection2,3,4 this with sectionBy the adding following. withs( theM ) following.s(M )( N 2 + N 2 + Nand+ byN a) simpletoByand both adding by transformation sides a simples(Mi)s transformation(|M|j)( we|N|ji obtain| |+j |N| wejj| |+ obtainj ||Ni|j|+|jNj|)jtoj both sides Thus the inequality follows. Hence we get 2 { { } } i j i j i j sides and by a simple transformation| | | | we| |obtain| | jobsin S assignedopt. Thus to the a machineinequality is follows. less than four times the total − ≤ − 6l + 4 6l + 4l ≤ ΣSopt (J ) { } We beginWe begin this section this section with the with following. the following.| | | | | | and| | byand a simple by a simple transformation transformation we obtain we obtain Assume Col < N N N . Let us divide the set We begin this sectionand by with a simple the following. transformation we obtain ●completion Assume timeCol2 of < the MN2 jobs M assignedN3 MN4 to. this Letmachine us divide in theSopt set. 2 We begin this section with the following. Let K MLetand K N MJand. Σ N (NJ) is. aΣ lower(N) is bound a lower bound • | | 2 | M∪2 M∪3 M| 4 10 24l + 6l ΣS(J ) Lemma 3.Lemma 3. id id s(M )s(M s)((MN)s+(MN)()(NN++NN)( +N1)+ N + 1) N N N into 2 subsets.[ [ Let N be any of its sub- Observation4 ε 3. Algorithms4 =1 and 3 run in O(n) time for. bisub- LemmaLemma 3. Let⊆ 3. KLetM K and⊆M⊆ NandJ N .⊆ΣJid(.NΣ)idis(N a) loweris a lower bound bound i j ii j j i i j j i j ThusMN2 the M N inequality3 j M N4j follows.intoj 2 subsets. LetColj N2 be any of its 2 on the totalLemmaon completion the total 3. Let completion KtimeM of anyand time subschedule N ofJ any. Σ subschedule for(N) Nis on a lower K, for N bound on K, | | | || || | | | | || | ≤| | ≤ M∪2 M∪3 M4 | | Col2 − ≤ − 6l + 4 6l + 4l ≤ Σ (J ) Lemma 3. Let K M and N J . Σid(N) is a lower bound⊆ ⊆ ⊆ ⊆ id s(Mi)s(Mij))(s(NMij)(+ NNi j +)( NNij )(+ NNi j ++N1)j + 1) sets with[ cardinality[ Col . Let N =(N j jN N ) quartic graphs. Algorithm 2 has the overallSopt complexity of on theon total the completiontotal completion⊆ time of times any(M ofi)⊆ subschedules any(Mj)( subscheduleNi + forNj N)( for onNi N K,+ onN(sj( K,M+i)+1) s(Ms(Mj))(i)+s(Ms(jM)i jN))(|i (s|j(NMi||j+)i|1N|)+i (|| Nsj(|iM+i|)|1Ni)+||j (s|(NMjj|≤i)+N1j))≤(. Nj + 1)). AssumesubsetsCol with2 cardinality< NM N 2ColM N. LetMr .N Let =M us2N divide M 3N the M 4N set ⊆ ⊆ where Midonwhereis the the totalM idealid is completion machine the ideal for machine time K. of forany K. subschedule for N on K, | | | | | | | | ≤ |2 | 3 2 4 r ( ∪M2 ∪M3 M\4) 10(m 2) on the total completion time of any subschedule for N on K, | | | | | | | | (s(M≤i)+(s(Ms(iM)+j))(s(Ms(Mj|))(j)|sN(|Mi (|j)NN|i i+(| 1N| )+i |+s1(|M)+i)|sN(|Mj (i|)NN| jj +(| N|1))j |.+ 1)). • N . Then| we| have| Col∪ j =∪jN | + N and[ [ O(nm − ) for bisubquartic graphs. wherewhere Mid is M theid is ideal the idealmachine machine for K. for K. (s(Mi)+s(Mj))(s(Mj) Ni ( Ni +Better1)+s( polynomialMi) Nj ( Nj algorithms+ 1)). forN schedulingMColN2 NM . Then unit-lengthNM weinto have 2 subsets.jobs Col1 Let=M 1N +r beN any and of its sub- Observation 3. Algorithms 1 and 3 run in O(n) time for bisub- where M is the ideal(s(Mi machine)+s(Mj))( fors K.(Mj) Ni ( Ni + 1)+s(Mi) Nj ( Nj + 1)). | | | | | | | | | | || || | | | 2 |Col2 3 4 | | 1 | | MCol1 |2 | r where Mid is the ideal machine for K. id | | | | | | | | ∪j j ∪ | | | | | | | |Dividing| | both the sides by 2s(M )s(M )(s(M ) + s(M )) we get setsn Σ with( cardinalityJ )=Σ Col(N 2j )+. LetΣj Nrj(N=()+jNMΣj Nj(NM N)M. ) quarticIn fact, graphs. the algorithms Algorithm are2 devotedhas the to overall sparse graphscomplexity so it of is 4 4 Bull. Pol.i Ac.:Bull. Tech.j Pol. XX(Y) Ac.:i Tech. 2016 XX(Y)j 2016 Sopt Sopt| M1| Sopt r 2S∪opt 3Col∪2 4 \ 10(m 2) Dividing both the sides by 2s(Mi)s(Mj)(s(Mi)+s(Mj)) we get and by Lemma 3, the total completion time of Col| 1 on| M1 is O(nm − ) for bisubquartic graphs. 4 4 Bull. Pol.Bull. Ac.: Pol. Tech. Ac.: XX(Y) Tech. XX(Y) 2016 2016 N Col2 .Σ ThenS (J we) = have ΣS Col(NM1 )= + ΣNMS 1 (+Nr) N+r ΣandS (N Col ). reasonable to implement them using a data structure suitable 4 4 Bull. Pol. Ac.: Tech. XX(Y) 2016 Bull. Pol. Ac.: Tech. XX(Y) 2016 Letat| mostM|id be 4opt timesthe ideal greater machineopt| than1| forthe| M theopt|. total By| the completion| inequalityopt j 2j time of ( Ni + Nj )( Ni + Nj + 1) forIn such fact, graphs. the algorithms are devoted to sparse graphs so it is ΣSopt (J )=ΣSopt (NM1 )+ColΣS(optCol(Nr+)+1) ΣSopt (N Col2 ). Σid(N)= | | | | | | | | ColLet 1Mjobs be inthe any ideal other machine schedule.| 1 |for| HenceM1| . By the inequality| | Algorithm 1 consists of 2 phases, both of the complexity 2(s(Mi)+s(Mj)) | | id ΣS(Col1) 2s(M1) reasonable to implement them using a data structure suitable Let Mid be the ideal machine= for M . By the4 inequality. Col1 ( Col1 +1) O(n). Algorithm 3 consists of two parts. The first is the ap- s(Mj) Ni ( Ni + 1)+s(Mi) Nj ( Nj + 1) ΣSΣ(Colid(Col1) 1)4(Σ|Sopt (|N|M1 )+| ΣS≤opt (Nr)). for such graphs. ≤ Col2∑1M( ColM s1(M+1)) plication of Algorithm 1. The second is the assignment of the | | | | | | | | | | ∈| | Algorithm 1 consists of 2 phases, both of the complexity ( ) ( ) ΣS(Col1) 2s(M1) ≤ 2s Mi s Mj Thus we obtain = 4. Col ( Col +1) . O(n). Algorithm 3 consists of two parts. The first is the ap- Σ (N). Σid(Col1) | 1| | 1| ≤ S Bull. Pol. Ac.:( Tech.)= XX(Y)(Col 2016)+ 2∑(ColM M s)(M) 5 ≤ ΣS J ΣS 1 ΣS ∈ 2 plication of Algorithm 1. The second is the assignment of the If the number of machines is greaterBetter than polynomial 2, the thesis algorithms follows for scheduling unit-lengthΣS(Col jobs1)+4ΣS(Col2) Iffrom the number induction of onmachinesK . is greater than 2, the thesis follows Bull.and Pol. Ac.:by Lemma Tech.≤ XX(Y) 3, the 2016 total completion time of Col1 on M1 5 | | 4ΣSopt (NM1 )+4ΣSopt (Nr)+4ΣS(Col2) fromDividing induction both the onsides K . by 2s(Mi)s(Mj)(s(Mi)+s(Mj)) we get□ andis byat most Lemma 4≤ times 3, the greater total completion than the the time total of completionCol1 on M 1timeis j j of Col jobs in any other schedule. Hence Algorithm 3 A 4-approximation algorithm for the problem at most 41 times4 greaterΣSopt (N thanM1 )+ the4Σ theSopt total(Nr)+ completion4ΣSopt (N Col time2 ) of ( N + N )( N + N + 1) j j ≤ | | (N)= | i| | j| | i| | j| Qm Σpidj = 1,G = bisubquartic ΣCj, where m 2,3,4 Col1 jobs in= any4Σ otherS (J schedule.). Hence | 2(s(Mi)+|s(Mj)) ∈{ } | | opt Algorithm 3 A 4-approximation Algorithm for the problem ΣS(Col1) 4(ΣS (NM ) + ΣS (Nr)). Input: A bisubquartic graph G. ∙ opt 1 opt Qm p = 1, G =s( Mbisubquartic) N ( N +Σ1C)+, wheres(M ) Nm ( {N2, 3, 4+ 1)} In both casesΣS(Col we1 have) 4(ΣΣSS(optJ(N) M1 )+4ΣSΣSopt(J(N)r,)) hence. Algo- Output:j j A schedulej | i| | i| j j i | j2| | j| ≤ ≤ opt rithmThus 3 iswe 4-approximate. obtain Similar observations may be used Input:1. (Col A bisubquartic,Col≤ )=Non-Equitable graph 2Gs(.Mi) Colorings(Mj) (G). Thus we obtain 1 2 to establish that the algorithm is 4-approximate for the prob- Output:2. M1 A ColscheduleΣ1,S(MN2),...,. Mm Col2. ← ≤ ← lemsΣQS(2Jp j)== 1Σ,SG(Col= 1bisubquartic)+ΣS(Col2)ΣCj and Q3 p j = 1,G = 1. ( ) = ( ) | | | If theCol number1, Col of2 machines Non-Equitable is greater Coloring than 2, theG thesis. follows bisubquartic ΣCΣj.(Col )+4Σ (Col ) |≤ S 1 S 2 fromTheorem2. M induction1 ← Col 2. Algorithm1 on, MK2, …, . 3Mism ← 4-approximateCol2. for the problem The approximation coefficient 4 is the best possible value in | | 4ΣSopt (NM1 )+4ΣSopt (Nr)+4ΣS(Col2) Qm p j = 1,G = bisubquartic ΣCj, where m 2,3,4 . the sense that≤ for any ε > 0 we may find such integers l and | | ∈{ } Algorithm 3 A 4-approximation algorithm for the problem 4ΣSopt (NM1 )+4ΣSopt (Nr)+4ΣSopt (N Col2 ) TheoremProof. Let 2. usAlgorithm begin our 3 analysisis 4-approximate with the casefor the of aproblem problem k that for a graph≤ G consisting of l copies of 3S3,3,| the| graph Qm p j = 1,G = bisubquartic ΣCj, where m 2,3,4 Qm p = 1, G = bisubquartic ΣC , where m {2, 3, 4}. presented in= Fig.4Σ 1(a),Sopt (J and). for machines with speeds s(M1)= with| j 4 machines. Let S be a schedule| j obtained∈{2 by Algorithm} 3 Input:j A bisubquartic graph Gj . ks(M4) and s(M2)=s(M3)=s(M4) the algorithm constructs and let Sopt be any schedule with the minimal total completion In both cases we have Σ (J ) 4Σ (J ), hence Algo- a schedule S with ( S) that is at leastSopt 4 times greater Proof.Output:time. Let WeA us mayschedule begin divide our analysisJ into with sets theN case, N of ,a Nproblemand withN , In both cases we haveΣS ΣJS (J) 4Σ≤ S (J), henceε Algorithm 3 M1 M2 M3 M4 rithm 3 is 4-approximate. Similar∙ observationsopt − may be used 4 1.machines.(Col1,Col Let2)= S beNon-Equitable a schedule obtained Coloring by(G Algorithm). 3 and isthan 4-approximate. the minimal one. Similar Let l observations(10 4ε)/( 6mayε) and be letusedk to180 esl-. where NMi is the set of the jobs assigned to Mi in Sopt . to establish that the algorithm≥ is 4-approximate− for the≥ prob- let2. SM1 be anyCol schedule1, M2,..., withMm the Colminimal2. total completion time. tablishThen we that have the Algorithm is 4-approximate for the problems opt lems Q2 p j = 1,G = bisubquartic ΣCj and Q3 p j = 1,G = If Col←2 NM2 NM3 N←M4 , then by Lemma 1, Col2 10 We• may| divide|≥| J into∪ sets∪ NM , |NM , NM and NM , where| N|≤M Q2 pj =| 1, G = bisubquartic ΣCj |andε. Q3 pj =| 1, G = bisub- 2 NM NM NM , hence 1 2 3 4 i bisubquarticj ΣCj. 6l +j 4 ≤ j is the| set2 of∪ the3 jobs∪ assigned4 | to M in S . quartic ΣC |. □ Theorem 2. Algorithm 3 is 4-approximatei opt for the problem The approximationj j coefficient 4 is the best possible value in ΣS(Col2) < 4ΣS (NM NM NM ). (4) The optimal assignment is to assign the jobs corresponding to Qm p j = 1,G = bisubquartic ΣoptCj, where2 m3 2,43,4 . the sense that for any ε > 0 we may find such integers l and | | ∪ ∈{∪ } an independent set of vertices with cardinality α(G)=18l to In this case Col N , so we have Let us begin1 our analysisM1 with the case of a problem k that for a graph G consisting of l copies of 3S3,3, the graph Bull.Proof. Pol. Ac.: Tech.| 67(1)|≤| 2019 | the fastest machine and to assign the remaining jobs, with car-35 with 4 machines.Σ (Col Let S) beΣ a schedule(N ) obtained4Σ ( byN Algorithm). 3 presented in Fig. 1(a), and for machines with speeds s(M1)= S 1 ≤ Sopt M1 ≤ Sopt M1 dinality equal to 6l, to the other machines in a balanced way. and let S be any schedule with the minimal total completion ks(M4) and s(M2)=s(M3)=s(M4) the algorithm constructs Thereforeopt Let us denote this schedule as Sopt . Then a schedule S with ΣS(J ) that is at least 4 ε times greater time. We may divide J into sets NM1 , NM2 , NM3 and NM4 , − ( )= ( )+ ( ) than the minimal one. Let18ll(18l(10+ 1) 4ε)/2(l6(ε2)l +and1) let k 180l. where NMΣS isJ the setΣS ofCol the1 jobsΣ assignedS Col2 to Mi in Sopt . i ΣSopt (J )= ≥ − + 3 ≥ Then we have 2ks(M4) 2s(M4) 4ΣSopt (NM1 )+4ΣSopt (NM2 NM3 NM4 ) If Col2 NM≤2 NM3 NM4 , then by Lemma∪ 1,∪ Col2 10 • | |≥| ∪ ∪ | | |≤ 180l2 +(6l2ε+. 3l)k 6l2 + 4l 2 NM2 NM3 =NM44ΣS,opt hence(J ). 6l + 4 ≤ . | ∪ ∪ | ≤ ks(M4) ≤ s(M4) InequalityΣ (4)S(Col comes2) < from4ΣSopt the(N followingM2 NM3 observation.NM4 ). Let(4) us The optimal assignment is to assign the jobs corresponding to ∪ ∪ Algorithm 3 constructs a schedule with 12l jobs assigned to assume that Col2 = 2 NM2 NM3 NM4 . The total com- an independent set of vertices with cardinality α(G)=18l to In this case Col| 1 | NM1| , so∪ we have∪ | pletion time| in a|≤| greedy assignment| is not greater than in the theM1 fastestand 12 machinel jobs assigned and to assign to M2, theM3, remainingM4. So we jobs, have with car- ΣS(Col1) ΣSopt (NM1 ) 4ΣSopt (NNM1 ). M dinality equal to 6l, to the other machines in a balanced2 way. assignment in which≤ we schedule≤ exactly 2 M2 jobs on 2, 12l(12l + 1) 4l(4l + 1) 24l + 6l | | Σ (J )= + 3 . Therefore2 NM jobs on M3 and 2 NM jobs on M4. For each of the Let us denoteS this schedule as Sopt . Then | 3 | | 4 | 2ks(M4) 2s(M4) ≥ s(M4) machines, in this assignment the total completion time of the ΣS(J )=ΣS(Col1)+ΣS(Col2) Hence we get 18l(18l + 1) 2l(2l + 1) jobs assigned to a machine is less than four times the total ΣSopt (J )= + 3 2ks(M4) 2s(M4) completion time4Σ ofSopt the(NM jobs1 )+ assigned4ΣSopt (N toM2 thisN machineM3 NM4 in) Sopt . 2 ≤ ∪ ∪ 102 242l + 6l Σ2S(J ) Thus the inequality follows. 4 ε 4 180l +(=6l 2+ 3l)k 6l + 4l . = 4ΣSopt (J ). − ≤ − 6l + 4 6l + 4l ≤ ΣS (J.) ks(M ) s(optM ) Assume Col2 < NM2 NM3 NM4 . Let us divide the set ≤ 4 ≤ 4 •Inequality| (4) comes| | from∪ the following∪ | observation. Let us Observation 3. Algorithms 1 and 3 run in O(n) time for bisub- NM2 NM3 NM4 into 2 subsets. Let N Col2 be any of its sub- Algorithm 3 constructs a schedule with 12l jobs assigned to assume∪ that∪Col2 = 2 NM2 NM3 N|M4 .| The total com- sets with cardinality| | Col| 2 .∪ Let N∪r =(N| M NM NM ) quartic graphs. Algorithm 2 has the overall complexity of pletion time in a greedy| assignment| is not greater2 ∪ than3 ∪ in the4 \ M1 and10 12(ml jobs2) assigned to M2,M3,M4. So we have N . Then we have Col = NM + Nr and O(nm − ) for bisubquartic graphs. Col2 1 1 2 assignment| | in which we| schedule| | exactly| | 2 N|M2 jobs on M2, 12l(12l + 1) 4l(4l + 1) 24l + 6l | | InΣ fact,(J the)= algorithms are+ devoted3 to sparse graphs. so it is 2 NM ΣSjobsopt (J on)=M3ΣandSopt ( 2NMN1M)+jobsΣSopt on(NrM)+4.Σ ForSopt ( eachN Col2 of). the S | 3 | | 4 | | | 2ks(M4) 2s(M4) ≥ s(M4) machines, in this assignment the total completion time of the reasonable to implement them using a data structure suitable Let Mid be the ideal machine for M . By the inequality jobs assigned to a machine is less than four times the total Hencefor such we graphs. get Col1 ( Col1 +1) | | | | Algorithm 1 consists of 2 phases,2 both of the complexity completion timeΣ ofS(Col the1 jobs) assigned2s(M1 to) this machine in Sopt . 10 24l + 6l ΣS(J ) = 4. O(n) 4 ε 4 = . Thus the inequalityΣ (Col follows.) Col1 ( Col1 +1) ≤ . Algorithm 3 consists of2 two parts. The first is the ap- id 1 | | | | − ≤ − 6l + 4 6l + 4l ≤ ΣSopt (J ) 2∑M M s(M) plication of Algorithm 1. The second is the assignment of the Assume Col2 < NM2 NM3 NM∈ 4 . Let us divide the set • | | | ∪ ∪ | Observation 3. Algorithms 1 and 3 run in O(n) time for bisub- NM2 NM3 NM4 into 2 subsets. Let N Col be any of its sub- ∪ ∪ | 2| Bull.sets Pol. with Ac.: cardinality Tech. XX(Y)Col 20162 . Let Nr =(NM NM NM ) quartic graphs. Algorithm 2 has the overall complexity of5 | | 2 ∪ 3 ∪ 4 \ 10(m 2) O(nm − ) for bisubquartic graphs. N Col . Then we have Col1 = NM1 + Nr and | 2| | | | | | | In fact, the algorithms are devoted to sparse graphs so it is ΣSopt (J )=ΣSopt (NM1 )+ΣSopt (Nr)+ΣSopt (N Col2 ). | | reasonable to implement them using a data structure suitable Let M be the ideal machine for M . By the inequality id for such graphs. Col1 ( Col1 +1) Σ (Col ) | 2|s|(M )| Algorithm 1 consists of 2 phases, both of the complexity S 1 = 1 4. Col ( Col +1) O(n). Algorithm 3 consists of two parts. The first is the ap- Σid(Col1) | 1| | 1| ≤ 2∑M M s(M) ∈ plication of Algorithm 1. The second is the assignment of the

Bull. Pol. Ac.: Tech. XX(Y) 2016 5 Better polynomial algorithms for scheduling unit-length jobs

Dividing both the sides by 2s(Mi)sBetter(Mj)(s polynomial(Mi)+s(M algorithmsj)) we get for schedulingand by Lemma unit-length 3, the total jobs completion time of Col1 on M1 is Better polynomial algorithms for schedulingat most 4 times unit-length greater jobs than the the total completion time of ( Ni + Nj )( Ni + Nj + 1) Dividing both the sides by 2s(Mi)s(Mj)(s(Mi)+s(Mj)) we get and by Lemma 3, the total completion time of Col1 on M1 is Σid(N)= | | | | | | Better| | polynomial algorithms for schedulingCol1 jobs unit-length in any other jobs schedule. Hence 2(s(Mi)+s(Mj)) |at most| 4 times greater than the the total completion time of Dividing both the( N sidesi + N byj 2)(s(NMi i)+s(MNjj)(+s(1M) i)+s(Mj)) we get and by Lemma 3, the total completion time of Col1 on M1 is ( )= ΣS(Col1) 4(ΣS (NM )+ΣS (Nr)). DividingΣid N both thes(|M sides|j) N| byi (| 2Nsi|(M+|1)s)+(|Ms(|)(Msi()MN)+j ( Ns(jM+))1)we get atandCol most1 byjobs Lemma 4 times in any 3, greater otherthe total than schedule. completionopt the the1 Hence total timeopt completion of Col on timeM ofis ( Ni +2|(sN(|Mj|)(i)+|Nisi(+MjN))j + 1|) i | | | j | | ≤ 1 1 Σid(N)=≤ | | | | |2s|(Mi|)s(|Mj) ThusatCol most1 wejobs 4 obtain times in( anyCol greater other) 4 than schedule.( the(N the Hence)+ total completion(N )). time of s((NMi j)+2N(sNi((Mj N)(i)+i N+is1(+M)+Nj))sj(M+i1))Nj ( Nj + 1) | | ΣS 1 ΣSopt M1 ΣSopt r Σ (N)= | | | | | | || | | | | | | | Col ≤ id ΣS(N). 1 jobs in( any other) schedule.( ( Hence)+ ( )). ≤ s(Mj)2N(si((MNi)+i 2+ss(1(MM)+i)js))s((MMji)) Nj ( Nj + 1) Thus| ΣS| we(J obtain)=ΣS ColΣS(Col1 1)+4 ΣΣSSopt(ColNM21) ΣSopt Nr | | | | | | | | ≤ If the number of machines is greater than 2, the thesis follows ΣS(Col1) 4(ΣS (NM )+ΣS (Nr)). ≤ Σs(SM(Nj).Ni ( Ni 2+s(1M)+i)ss((MMji)) Nj ( Nj + 1) Thus we obtainΣS(Col1)+4ΣoptS(Col12) opt ≤ | | | | | | | | ΣS(J )=≤ ΣS(Col≤1)+ΣS(Col2) from induction≤ on K . 2s(M )s(M ) ΣS(|N)|. i j Thus we obtain4ΣSopt (NM )+4ΣSopt (Nr)+4ΣS(Col2) If the number of machines is greater than 2, the thesis follows ΣS(J )=≤ ΣS(Col1)+1 4ΣΣS(SCol(Col2)2) ≤ ≤ from inductionΣ onS(NK). 4ΣS (NM )+4ΣS (Nr)+4ΣS (N ) AlgorithmIf the number 3≤A of machines4-approximation| | is greater algorithm than 2, the for thesis the problem follows ΣS(J )=4ΣΣS(SColopt (N1)+M1 )+4ΣΣS(S4Col(ΣColSopt2)2()Nr)+4ΣSopt(Col2Col) 2 ≤ opt 1 opt | | QmfromIf thep inductionj number= 1,G = of onbisubquartic machinesK . is greaterΣCj, where thanm 2, the2 thesis,3,4 follows = 4ΣΣSS(Colopt (JN1)+M).)+4ΣS4(ΣColS 2()Nr)+4ΣS(Col( 2) ) Algorithm| 3 A 4-approximation| | | algorithm∈{ for the} problem ≤ 4ΣSopt NM1 4ΣSopt Nr 4ΣSopt N Col2 from inductionA bisubquartic on K . graph G. ≤ | | Input: 4ΣS (NM )+4ΣS (Nr)+4ΣS(Col2) Qm p j = 1,G = bisubquartic| | ΣCj, where m 2,3,4 In both cases= we4Σ haveSopt (NΣMS)1.()+J4)ΣSopt4(ΣNSropt)+(J4Σ)S, hence(N Col Algo-) Output:Algorithm| A schedule3 A 4-approximation| algorithm∈{ for the} problem ≤ ΣSopt J 1 ≤opt opt 2 rithm 3 is 4-approximate.≤ Similar observations may|T. be Pikies| used and M. Kubale Input:Qm p j =A1 bisubquartic,G =Abisubquartic 4-approximation graph GΣ.Cj, algorithm where m for2, the3,4 problem 4ΣSopt (NM1 )+4ΣSopt (Nr)+4ΣSopt (N Col ) Algorithm1. (Col1,Col 3 2)=Non-Equitable Coloring(G). = 4ΣSopt (J )(. ) ( ) 2 | | ∈{ } toIn establish both cases that≤ we the have algorithmΣS J is 4-approximate4ΣSopt J , for hence the| Algo- prob-| Output:Qm p j = A1,G schedule= bisubquartic ΣCj, where m 2,3,4 ≤ Input:2. M1 A bisubquarticCol1, M2,..., graphMm G.Col2. rithm 3 is 4-approximate.= 4ΣSopt (J ) Similar. observations may be used | ← ←| ∈{ } lemsIn bothQ2 casesp j = 1 we,G have= bisubquarticΣS(J ) Σ4CΣSjoptand(JQ),3 hencep j = 1 Algo-,G = Output:Input:1. (ColA1,A bisubquarticCol schedule2)=Non-Equitable graph G. Coloring(G). | ≤| | bisubquartictorithmIn establishThe both 3 approximation is cases 4-approximate. thatΣC we the. have algorithm coefficientΣ Similar(J is) 4-approximate 4 observations 4isΣ the( bestJ ) ,possible formay hence the be Algo- prob-value used same as in the previous cases. However, the greedy assignment 2.1. M(Col1 ,Col1)=, M2Non-Equitable,...,Mm Col Coloring2. (G). j S Sopt Output:←1A schedule2 ← inlems theQ sense2 p j =|that1, Gfor= anybisubquartic ε > 0 we≤ ΣmayCj and findQ such3 p j =integers1,G = l can be done in time O(nlog m). Hence the total time complexity Theorem 2. Algorithm 3 is 4-approximate for the problem torithmThe establish 3 approximation is| 4-approximate. that the algorithm coefficient Similar is 4 4-approximate is| observations the best possible| formay the value be prob- used in 2.1. M(Col1 1,Col21)=, M2Non-Equitable,...,Mm Col Coloring2. (G). bisubquartic ΣC . 10(m 2) 10(m 2) Qm p j =←1,G = bisubquartic←ΣCj, where m 2,3,4 . andthelemsto establish sensek Qthat2 p that forj that= fora1 ,jgraph theG any= algorithmε bisubquarticG> consisting0 we is may 4-approximateΣ Cof findj land copies suchQ3 integers forofp j 3= theS3,31,l prob-G,and the= is O(n + nlog m + (n + m)m ¡ ) = O(nm ¡ ), which is 2. |M Col , M ,...,M | Col . ∈{ } | | | | Theorem1 2. Algorithm1 2 3 ism 4-approximate2 for the problem graphbisubquarticThe presented approximationΣC .in Fig. coefficient 1a, and 4 for is the machines best possible with valuespeeds in O(n) for a fixed number of machines. Proof. Let← us begin our analysis← with the case of a problem klemsthatQ for2 p aj graph= 1,j GG=consistingbisubquartic of l copiesΣCj and ofQ 3S33,p3,j the= 1 graph,G = QmTheoremp j = 1 2.,GAlgorithm= bisubquartic3 is 4Σ-approximateCj, where m for2, the3,4 problem. sthe(M sense) = ks| that(M| ) for and any s(Mε >) =0 s we(M may) =| s( findM )such the Algorithm integers| l conand- with| 4 machines. Let S be a schedule| obtained∈{ by Algorithm} 3 presentedbisubquarticThe1 approximation in Fig.4ΣCj. 1(a), coefficient and2 for machines3 4 is the bestwith4 possible speeds s value(M1)= in k that for a graph| G consisting of l copies of 3S3,3, theε graph Proof.QmTheoremp j =Let1 2.,G usAlgorithm= beginbisubquartic our3 analysisis 4Σ-approximateCj, with where the m case for2 of, the3, a4 problem. structsksthe(TheM sense4) approximationaand schedule thats(M for2)= anyS withs coefficient(εM>3 )=Σ0S we(Js(M) may4 4that is) the find isbest algorithmat such least possible integers 4 constructs value timesl and in and| let Sopt be any schedule with| the minimal∈{ total completion} presented in Fig. 1(a), and for machines with speeds¡s(M )= withQm p 4j machines.= 1,G = bisubquartic Let S be a scheduleΣCj, where obtained m by2, Algorithm3,4 . 3 greaterakthe schedulethat sense for than athatS graphthewith for minimal anyGΣ consisting(Jε >) one.that0 we Let ofis may atl lcopies least find (10 4 such of 4 3εSε integers)3times/,3(,6ε the) greaterand graphl1and let 3. Final remarks time.Proof. WeLet may us begin divide ourJ analysisinto sets withNM the, NM case, N ofM aand problemNM , S ¸ ¡ | | 1 ∈{2 3 } 4 ks(M4) and s(M2)=s(M3)=s(M4) the algorithm− constructs and let Sopt be any schedule with the minimal total completion kthanpresentedk that 180 the forl minimal. Then ain graph Fig. we one. 1(a),G haveconsisting Let andl for(10 machines of l4copiesε)/( with6ε of) and 3speedsS3 let,3, theks(M graph1801)=l. wherewithProof. 4N machines.LetM is us the begin set Let of ourS thebe analysisa jobs schedule assigned with obtained the to M casei in by ofS Algorithmopt a. problem 3 ¸ time. Wei may divide into sets N , N , N and N , aks schedule(M ) andSs(withM )=ΣS(sJ(M))=≥thats( isM− at) leastthe algorithm 4 ε times constructs≥( greater)= Our analysis is based on 2-coloring of a bipartite graph with andwith let 4 machines.Sopt be any Let scheduleSJbe a schedulewith the minimal obtainedM1 M2 total byM Algorithm completion3 M4 3 Thenpresented4 we have in Fig.2 1(a), and3 for machines4 with− speeds s M1 If Col2 NM2 NM3 NM4 , then by Lemma 1, Col2 than the minimal one. Let l 10(10 4ε)/(6ε) and let k 180l. maximal width. A natural extension of this approach is to con- where NMi is the set of the jobs assigned to Mi in Sopt . aks schedule(M4) andSs(withM2)=ΣS(sJ(M3))=thats( isM at4) leastthe algorithm 4 ε times constructs greater •time.and let| WeSopt|≥| maybe any divide∪ scheduleJ∪into with| sets theN minimalM1 , NM2 total, NM completion3 and| N|≤M4 , ≥ −ε.. − ≥ 2 NM2 NM3 NM4 , hence Thenthan the we minimal have one.( Let6)ll +(410≤ 4ε)/(6ε) and let k 180l. sider 2-colorings with smaller widths. Such colorings seems to where| NM∪ is the∪ set of| the jobs assigned to Mi in Sopt . a schedule S with ΣS J that is at least 4 ε times greater time.If Col We2i mayN divideM2 NMJ3 intoNM4 sets, thenNM by1 , N LemmaM2 , NM 1,3 andColN2 M4 , 10≥ − − ≥ • | |≥| ∪ ∪ | | |≤ TheThenthan optimal the we minimal have assignment one. Let isl to assign(10 ε4. theε)/ jobs(6ε) correspondingand let k 180 tol. be better, e.g. when the machines can be split into two sets with where N isΣ theS(Col set2 of) < the4Σ jobsSopt ( assignedNM2 NM to3 MNinM4 )S. . (4) 2IfNColM2 Mi NM3 N NM4 N, henceN , then∪ by Lemma∪ i opt 1, Col 6l10≥+ 4 ≤− ≥ • | | ∪2|≥|∪M2 ∪| M3 ∪ M4 | | 2|≤ TheanThen independent optimal we have assignment set of vertices is to withassignε cardinality. the jobs αcorresponding(G)=18l to closer sums of speeds. In this case Col1 NM , so we have 2IfNColM2 2 NMΣ3NS(MColN2 M42N),M< hence3 4Σ1 NS M4(N,M thenN byM LemmaNM ). 1, Col2 (4) toThe an optimal independent assignment set of isvertices6l to10+ assign4 ≤ with the cardinality jobs corresponding α(G) = 18 tol It is also interesting to know if Algorithm 2 can be refined • | | ∪|≥|| ∪ ∪|≤|| ∪| opt | 2 ∪ 3 ∪ 4 | |≤ the fastest machine and to assign theε. remaining jobs, with car- 2 NM2 NMΣ3 (ColNM4), henceΣ (N ) 4Σ (N ). toan the independent fastest machine set of verticesand6 lto+ assign4 with≤ cardinality the remainingα(G )=jobs,18 withl to to obtain polynomial time complexity in both the number of In this caseΣSColS(Col12)

36 Bull. Pol. Ac.: Tech. 67(1) 2019