Tight upper bounds for semi-online scheduling on two uniform machines with known optimum

We consider a semi-online version of the problem of scheduling a sequence of jobs of different lengths on two uniform machines with given speeds 1 and s. Jobs are revealed one by one (the assignment of a job has to be done before the next job is revealed), and the objective is to minimize the makespan. In the considered variant the optimal offline makespan is known in advance. The most studied question for this online-type problem is to determine the optimal competitive ratio, that is, the worst-case ratio of the solution given by an algorithm in comparison to the optimal offline solution. In this paper, we make a further step towards completing the answer to this question by determining the optimal competitive ratio for s between \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\frac{5 + \sqrt{241}}{12} \approx 1.7103$$\end{document}5+24112≈1.7103 and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sqrt{3} \approx 1.7321$$\end{document}3≈1.7321, one of the intervals that were still open. Namely, we present and analyze a compound algorithm achieving the previously known lower bounds.

solution. In this paper, we make a further step towards completing the answer to this question by determining the optimal competitive ratio for s between 5+

Introduction
Combinatorial optimization problems come with various paradigms on how an instance is revealed to a solving algorithm. The very common offline paradigm assumes that the entire instance is known in advance. On the opposite end, one can deal with the pure online scheme, where the instance is revealed part by part, unpredictable to the algorithm, and no further knowledge on these parts is assumed. In between these two extremes, and also highly relevant for many practical applications, are semi-online paradigms, where at least some characteristics of the instance in general are assumed to be known, for example, the total instance size or distributions of some internal values.
As a continuation of our work (Dósa et al. 2015a), we consider a semi-online variant of a scheduling problem for two uniform machines, that is defined as follows. Suppose that two machines M1 and M2 are processing a sequence of incoming jobs of varying lengths. Machine M1 has a speed of 1, so that a job of length is processed within units of time, whereas machine M2 has a speed of s ≥ 1, so that a job of length can be processed within s units of time. The load of a machine is the total size of jobs assigned to that machine (without dividing by the speed of the machine). This definition is non-standard, but in this way some of our calculations become simpler. The jobs must be assigned to the machines in an online fashion, so that the next job becomes visible only when the previous job has already been assigned. The goal is to find a schedule that minimizes the total makespan, that is, the point in time when the last job on either machine is finished. We assume that the optimal value of the makespan for the corresponding offline problem (where all jobs are known in advance), denoted by OPT is available to the scheduler, and can be taken into account during its assignment decisions.
We are interested in constructing an algorithm A that solves this semi-online problem, and achieves a small makespan. Of course, for a given instance I of the problem, the (offline) OPT = OPT(I ) value is a lower bound for the semi-online problem. Thus, we consider the competitive ratio M A (I ) OPT(I ) ≥ 1, where M A (I ) is the makespan value achieved by algorithm A when applied to instance I , as a performance measure.
The competitive ratio r A of an algorithm A is then defined as the worst case of this ratio, that is, the supremum over all possible problem instances: : I is an instance .
One can try to bound the value of r from below by estimating the infimum of r A over all algorithms A, that is, r * := inf{r A : A an algorithm}.
We call r * the optimal competitive ratio. An algorithm A is said to be r -competitive, if for any instance I its performance is bounded by r from above: M A (I ) OPT(I ) ≤ r . An optimal algorithm in this sense is r * -competitive.

Survey of the literature
The problem of scheduling a set of jobs on m (possibly not identical) machines with the objective to minimize the makespan (maximum completion time), with the jobs being revealed one-by-one, is a classic online algorithmic problem. Starting with results of Graham (1969), much work has been done in this field (see for example Albers 1999;Berman et al. 2000;Ebenlendr and Sgall 2007;Faigle et al. 1989;Fleischer and Wahl 2000;Gormley et al. 2000), although even if we restrict only to the case of identical machines, the optimal ratio is still not known in general.
From both the theoretical and practical point of view, it may be important to investigate semi-online models, in which some additional information or relaxation is available. In this work we consider the scheme in which only the optimal offline value is known in advance (OPT version); however it is worth mentioning a strong relation with another semi-online version of the described scheduling problem, in which only the sum of jobs is known (SUM version) (Angelelli et al. 2004(Angelelli et al. , 2007(Angelelli et al. , 2008Dósa et al. 2011;Kellerer et al. 1997;Lee and Lim 2013;Ng et al. 2009). Namely, for a given number m of uniform (possibly non-identical) machines the optimal competitive ratio for the OPT version is at most the competitive ratio of the SUM version [see Dósa et al. (2011); for equal speeds this was first implicitly stated by Cheng et al. (2005)].
For a more detailed overview of the literature on online and various semi-online variants, we refer to the survey of Tan and Zhang (2013). Azar and Regev (2001) introduced the OPT version on (two or more) identical machines under the name of bin stretching, and this case was studied further by Cheng et al. (2005) and by Lee and Lim (2013). However, knowing the relation between the OPT and SUM versions, the first upper bound for two equal-speed machines follows from the work of Kellerer et al. (1997) on the SUM version.
We must mention some recent papers in the case of identical machines by Gabay et al. (2015) and Böhm et al. (2016a, b). The main reason is the similarity of attitudes by which we and those authors approach the problems: they also use separate algorithms for certain good situations. In particular, Böhm et al. (2016b) makes this method very explicit. During the execution of some (online) algorithm, we sometimes meet some "good situations". This means that the schedule can surely be finished without any bigger problem or surprise, i.e. keeping the targeted worst-case ratio. And the more difficult cases are handled by some other algorithm which is exactly trained to deal with the difficult situations. We do this idea by handling the good situations by algorithm FinalCases, and the remaining not so friendly cases by another algorithm, called InitialCases. The separation of the final and other cases seems to be very natural for this type of problem.
In this work we are interested in the OPT version on two uniform machines with non-identical speeds, therefore we summarize previous results for this case. Recall that speeds of machines are 1 and s. Known bounds on the optimal competitive ratio r * are expressed in terms of s.
Finally, the recent manuscript (Dósa et al. 2015a) whose results complement this work of the present authors provided the following lower bounds: Here we collected only a brief summary of known bounds; for further details about previous results we refer to Dósa et al. (2015a).

Our contribution
After the work of Dósa et al. (2015a) In the narrow interval the upper bound is very close to the lower bound (the biggest gap is still smaller than 0.000209), so in this paper we focus on the wide interval, for which we present an optimal compound algorithm which has a competitive ratio that equals the previously known lower bounds.
We apply the method of "safe sets". This idea probably first applied in Epstein (2003). The concept is used also later by Ng et al. (2009) and Angelelli et al. (2010) (called "green set" in the latter), and also used by Dósa et al. (2011). Once those sets are properly defined (cf. Fig. 2), we try to assign the next job in the sequence to a machine where its completion time will be in some safe set. In case of the quoted papers, the safe sets are defined in such a way that the next property holds in any case: after some initial phase when the loads of both machines are low, a job will surely arrive that can be assigned into a safe set. In other words, the boundaries of the safe  (2003), Ng et al. (2009), andDósa et al. (2015a) sets are optimized in the way that the best possible competitive ratio would be reached while the above property holds. Now, we make a crucial modification extending the power of the method. We realize that, keeping the above property, the algorithm cannot be optimal in the considered interval of speeds, therefore we do not insist on this property for defining the boundaries of the safe sets. We are less restrictive as we allow the possibility that during the scheduling process, some relatively big job may arrive, which cannot be assigned within a safe set. But it turns out that this unpleasant case can be handled by another kind of algorithm. So, for any incoming job first we try our algorithm "Final Cases" which uses the safe sets, to assign the actual job into a safe set if possible. If this is not possible, we apply our second algorithm "Initial Cases" to assign the job.
We further show that our algorithm matches the best known algorithm of Ng et al. (2009) Fig. 1. Whenever the dotted line (that represents an upper bound) is on an unbroken line (that represents a lower bound), the optimal competitive ratio is known.

Fig. 2 Safe sets
We note that the values q 6 and q 7 were already defined in the paper (Dósa et al. 2015a). Then the wide interval is [q 6 , √ 3]. For the remainder of this article we consider values of s from the wide interval only. We define We remark that the value r 2 (s) is the same as in our preceding paper (Dósa et al. 2015a). The speeds to the left from the narrow interval (which are not considered in this paper) were called smaller regular speeds. The speeds to the right of the narrow interval were called bigger regular speeds, now we call these speeds simply as regular. The value r 5 (s) is Epstein's lower bound from Epstein (2003) on the right side of the wide interval. Note also that the graph of r 2 (s) can be seen on the figure between q 6 and q 7 , where the dotted line touches the unbroken line. Similarly, the graph of r 5 (s) appears between q 7 and √ 3, where the dotted line touches the unbroken line. Let OPT and SUM mean, respectively, the known optimum value, and the total size of the jobs. Note that SUM ≤ (s + 1) · O PT , and the size of any job is at most s · O PT . We denote the prescribed competitive ratio (that we do not want to violate) by r .
The optimum value is assumed to be known, and for sake of simplicity we will assume that OPT is equal to 1. (This can be assumed without loss of generality by normalization, i.e., dividing all of the job lengths by the optimal makespan.) Then we define five safe sets These sets define time intervals, and they are called "safe" because if the load of the machine is in this interval, this enables a "smart" algorithm (as the one we introduce later) to finish the schedule by not violating the desired competitive ratio. In other words, from the point of view of an algorithm (which wishes to keep the competitive ratio low), we want to assign the actual job in a way that the increased load of some machine will be inside a safe set.

Properties
In this section we summarize some technical properties and estimations of the definitions and notions from the previous section, which are needed within the computations in the subsequent sections.

Lemma 2 The following inequalities hold in the entire considered domain of the function r , i.e., for all s
Proof The rightmost part in Lemma 2.1, i.e. 2s+1 s+1 < 2, holds trivially. All other claims in 2.1 and 2.2 but the ones which regard r 5 (s) are already proven in Dósa et al. (2015a), thus we give only this unproved part here. Moreover, we give the proof for 2.3, whose claims were not considered before.
1. The leftmost lower bound holds as 3s+2 2s+2 < 4 3 is equivalent to 4(2s+2)−3(3s+2) = 2 − s > 0, and hence to s < 2. Further, it is easy to see that r (s) = 3. Regarding the leftmost inequality, 7s+5 5s+4 − s+3 s+2 = 2(s−1)(s+1) (s+2)(5s+4) > 0 trivially holds. The next inequality holds since s+1 145 10 ≈ 1.7042 (and this value is smaller than q 6 ). Regarding r (s) ≥ s+1 2 , for large speeds the inequality holds trivially (with equality) and for regular speeds we have already seen the validity of the inequality in Lemma 1. Thus we are done with the lower bound; let us see the upper bound. For regular s we have In the next lemma we state some properties of the safe sets. Note that an alternative option to define the safe sets would be to require these properties below.
Proof Proofs of the equalities in Lemmas 3.1-3.4 were given in Dósa et al. (2015a). Since these proofs use nothing else than the definition of the safe sets, we do not repeat them. For proving 3.5 and 3.6 we use again the definitions of the boundaries.

5.
B The next lemma proves that the safe sets are well defined in the sense that they are disjoint sets, and follow each other in the described order on the machines.

Lemma 4
The following inequalities hold: Proof We note that in the paper Dósa et al. (2015a) we already introduced the first four safe sets (in the same way), with the same properties. In this paper we need the fifth safe set as well, moreover the claims of the lemma hold also for large values of s, thus we need to give the proof of the lemma again. In the calculations we generally use Lemma 2, unless stated otherwise.
Proof We generally use Lemma 2 for the lower or upper bounds on r (s).
9s+7 . This is trivially true for any s ≤ q 7 , and true for s > q 7 by Lemma 1.

Algorithm FinalCases
First the loads are zero. The actual loads of the machines will be denoted as L m (m = 1 or m = 2) just before assigning the next job. Thus, for example, if L 1 denotes the actual load of the first machine, then after assigning a job to this machine, the new load will again be denoted by L 1 .
Here we define a subalgorithm, which works (and will be applied) only if the next job can be assigned to a machine whose increased load will be within some safe set. We call the algorithm FinalCases. We will say, for the sake of simplicity, that some step is executed if the condition of this step is satisfied and the actual job is assigned at this step. Otherwise we say that the step is only examined. In other words, entering some step, it is examined whether the condition of the step is fulfilled or not. If yes, the step is executed. If not, the step is not executed. Moreover, for the sake of simplicity, if some step is not executed, we do not write "else if" in the description of the algorithm; if it turns out that the condition of some step is not satisfied, then the algorithm simply proceeds with examining the next step.
Theorem 6 Suppose that some of Steps 1 to 5 of Algorithm FinalCases is executed. Then all subsequent jobs are also scheduled by this algorithm, and the competitive ratio is not violated. Proof 1. Suppose that Step 1 is executed. Then the load L 2 of the fast machine M2 will be not more than T 1 = rs, thus we do not violate the competitive ratio r by the fast machine. On the other hand, the final load of the fast machine is at least B 1 = s +1−r , because we assigned job x i to M2. Applying SUM ≤ s +1, the final load L 1 of the slow machine M1 cannot be more than r , since L 1 = SUM − L 2 ≤ (s + 1) − (s + 1 − r ) = r , which means that the competitive ratio is not violated by the slow machine either.

Now suppose that
Step 2 is executed. The proof is almost the same as for Step 1.
The load of M1 does not exceed T 2 , so the competitive ratio is not violated by the slow machine. Moreover the final load of the slow machine is L 1 ≥ B 2 = s + 1 − sr, thus L 2 ≤ SUM − L 1 ≤ (s + 1) − B 2 = sr = T 1 , and we are done.

Suppose that
Step 3 is executed. After assigning x i to M2, B 3 ≤ L 2 ≤ T 3 holds.
Then we possibly assign several jobs to M1. We claim that the increased load of M1 cannot remain below B 2 . Indeed, assume that it stays below B 2 . Then B 2 < 1 from Lemma 5.2, and also T 3 s = r − 1 < 1 from the rightmost estimation in Lemma 2.1. Hence the makespan would be strictly less than OPT = 1; a contradiction. Thus there must arrive a job that ends the loop, i.e. some job x j with L 1 + x j ≥ B 2 . At this point the algorithm goes back to Step 1. We claim that with this job x j the condition of Step 1 or Step 2 is satisfied, so the algorithm will assign all remaining jobs as explained above, and does not violate the competitive ratio. Suppose that the condition of Step 2 is not satisfied, i.e., L 1 +x j / ∈ S 2 . Together with the previously satisfied condition L 1 + x j ≥ B 2 , we deduce that L 1 + x j > T 2 , from which it follows that x j > D 2 . We show that in this case the condition of Step 1 is already fulfilled. Indeed, for the lower bound we have L 2 + x j > B 3 + D 2 = B 3 + D 1 = B 1 (where from left to right we applied the condition

Algorithm 1: FinalCases
Data: current loads L 1 , L 2 for machines M1, M2; index i of current job x i 1 if L 2 + x i ∈ S 1 then L 2 := L 2 + x i // assign job x i to M2 L 1 := L 1 + N j=i+1 x j // assign all subsequent jobs to M1 stop // no more jobs, terminate 2 if L 1 + x i ∈ S 2 then L 1 := L 1 + x i // assign job x i to M1 L 2 := L 2 + N j=i+1 x j // assign all subsequent jobs to M2 stop // no more jobs, terminate Step 1 return // back to the main program, if used as subroutine of Step 3, the definitions of D 1 and D 2 , and Lemma 3.3), while for the upper bound we have L 2 + x j ≤ T 3 + x j = s(r − 1) + x j = sr − s + x j = T 1 − s + x j ≤ T 1 (where from left to right we applied the condition of Step 3, the definitions of T 3 and T 1 , and the inequality x j ≤ s due to the fact that longer jobs would exceed OPT = 1 even on the fast machine). So we are entering Step 1 or Step 2.

Suppose that
Step 4 is executed. After assigning x i to M1, B 4 ≤ L 1 ≤ T 4 holds.
Then we possibly assign several jobs to M2. We claim that the increased load of M2 cannot remain below B 3 . Indeed, assume that it stays below B 3 . Then L 1 ≤ T 4 = r − 1 < 1 from Lemma 2.1, moreover B 3 s < B 1 s < 1, where we use Lemmas 4.2 and 5.2. Hence the makespan would be strictly less than OPT = 1; a contradiction. Thus there must arrive a job that ends the loop, i.e., some job x j with L 2 + x j ≥ B 3 . If L 2 + x j is in S 1 , or L 1 + x j is in S 2 , or L 2 + x j is in S 3 , we go back to Step 1. If Step 1 or Step 2 is executed, we are done. Otherwise the condition of Step 3 will be examined. We know that the condition L 2 + x j ∈ S 3 is fulfilled. Observe that the second condition of Step 3, i.e. L 1 ≤ B 2 also holds, since L 1 ≤ T 4 still holds and we have T 4 < B 2 from Lemma 4.1. Thus Step 3 is executed, and we are done. Now assume that none of the conditions L 2 +x j ∈ S 1 , L 1 +x j ∈ S 2 , or L 2 +x j ∈ S 3 is satisfied. Let us consider the size of the actual job, x j . Since L 2 + x j ≥ B 3 (from the choice of x j ), but L 2 + x j is not in S 3 , we deduce that L 2 + x j > T 3 . Hence together with L 2 < B 3 (also from the choice of x j ) it follows that x j > D 3 . Then, using L 1 ≥ B 4 , we get L 1 + x j > B 4 + D 3 = B 2 by Lemma 3.4. Since L 1 + x j is not in S 2 , we also deduce that L 1 + x j > T 2 holds. On the other hand, the actual load L 1 of M1 is at most T 4 . Thus where the equality comes from Lemma 3.2. Suppose that L 2 + x j > T 1 . Then x j > T 1 − T 3 = s (by the first part of Lemma 3.2) would follow, which would violate the value of OPT, because even the faster machine M2 can process this job within this makespan. Hence L 2 + x j ≤ T 1 . Together with the fact that L 2 + x j / ∈ S 1 , we have that L 2 + x j < B 1 . At this point x j is assigned to M2 by the algorithm. Now several subsequent jobs may be assigned to M2, while the load of M2 remains below B 1 . But, similarly to the previous steps, there must arrive a further job x k that would exceed B 1 . Indeed, assume that no such jobs exists. Then L 1 ≤ T 4 = r − 1 < 1 (by Lemma 2.1) and L 2 ≤ B 1 < s (by Lemma 5.2), so the makespan would stay below OPT = 1; a contradiction. Thus the assignment of jobs to M2 is stopped, and the algorithm goes back to Step 1. We claim that one of Step 1 or Step 2 will be executed. If Step 1 is not executed, then Lemma 5.1,and B 4 + D 3 = B 2 by Lemma 3.4, hence L 1 + x k > B 2 . Assume that Step 2 is not executed either. Then L 1 + x k / ∈ S 2 . Hence L 1 + x k > T 2 . From this is follows that x k > T 2 − L 1 ≥ T 2 − T 4 = 1, because L 1 ≤ T 4 is still true and we have T 2 − T 4 = 1 (from Lemma 3.2). Then there are two jobs, say x k and x j , which are both bigger than 1, thus both have to be assigned to the fast machine in the optimal schedule. Therefore we have OPT > 2 s , and 2 s > 1 (from 2 > s), which is a contradiction. 5. Finally, suppose that Step 5 is executed. We assign first the actual job to the machine M2 and then we assign jobs to the machine M1 until L 1 + x i < B 4 . Observe that L 1 cannot remain below B 4 . Assume the opposite. Then L 1 ≤ B 4 < B 2 < 1 by Lemma 5.2. Moreover, L 2 ≤ T 5 < B 1 < s by Lemma 2.1. Hence the makespan would be strictly less than OPT = 1; a contradiction. Thus there must arrive a job that ends the loop, i.e., some job x j with L 1 + x j ≥ B 4 . If any of the four conditions L 1 + x j ∈ S 4 , or L 1 + x j ∈ S 2 , or L 2 + x j ∈ S 3 , or L 2 +x j ∈ S 1 is satisfied, we go back to Step 1. Note that at this moment L 1 < B 4 < B 2 and L 2 ≤ T 5 < B 3 (applying Lemma 4). Hence it follows that some of Step 1 -Step 4 must be executed, and we are done. Therefore, suppose that none of the four conditions is satisfied. Let us consider the size of x j .
Since L 1 + x j ≥ B 4 (from the choice of x j ), but L 1 + x j is not in S 4 , we deduce that L 1 + x j > T 4 . Hence together with L 1 < B 4 (also from the choice of x j ) it follows that x j > D 4 . Then L 2 + x j > B 5 + D 4 = B 3 , applying L 2 ≥ B 5 and Lemma 3.4.
On the other hand, we know that L 1 + x j is not in S 2 , thus it follows that L 1 + x j > T 2 . Consequently, using Lemma 3.2, we get y > T 2 − T 4 = 1.
We know that L 2 +x j is not in S 1 . Suppose that L 2 +x j > T 1 . Then x j > T 1 − L 2 > T 1 − T 3 = s would follow, applying Lemma 3.1, and L 2 ≤ T 5 < T 3 by Lemma 4.1; a contradiction. Therefore at this point we assign x j to machine M2, and the increased load of M2 is strictly bigger than T 3 and strictly smaller than B 1 . Now several subsequent jobs may be assigned to M2, while the load of M2 remains below B 1 . There must arrive a job, say x k , such that L 2 + x k ≥ B 1 . Indeed, assume that it stays below B 1 . Since we know that L 1 ≤ T 4 , we conclude similarly to the proof of the previous point that this would lead to a makespan strictly less than 1 = OPT; a contradiction.
At this point the algorithm goes back to Step 1. We claim that either Step 1 or Step 2 will be executed. If Step 1 is not executed, then L 2 +x k > T 1 , since L 2 +x k ≥ B 1 . This together with L 2 < B 1 implies that x k > D 1 . Therefore we get L 1 + x k > D 1 > B 2 , by Lemma 5.1. If Step 2 is not executed either, which means that L 1 + x k / ∈ S 2 and hence L 1 + x k > T 2 , then x k > T 2 − L 1 ≥ T 2 − B 4 > T 2 − T 4 = 1, where we applied L 1 < B 4 , B 4 < T 4 (by Lemma 4.1), and T 2 − T 4 = 1 (by Lemma 3.2).
Summarizing our analysis, we have two jobs, x j and x k , both greater than 1, thus both have to be assigned to the fast machine in the optimal schedule. Therefore we have OPT > 2 s , and 2 s > 1 (from 2 > s), which is a contradiction. Therefore Step 1 or Step 2 has to be executed and we are done.
We have seen that Algorithm FinalCases solves the problem (does not violate the competitive ratio) if some step of the algorithm is executed. The problem is that it may happen-although only rarely-that no step can be executed because the condition of no step is satisfied. We must take care about these remaining cases. For this we define another algorithm in the next section.
We say that Algorithm FinalCases is executable if the condition of some step is satisfied. Summarizing our previous investigations, if Algorithm FinalCases is executable, then doing so we obtain a schedule which does not violate the competitive ratio.

Algorithm InitialCases
In order to handle the case where Algorithm FinalCases is not executable, we now give the algorithm InitialCases that calls FinalCases as a subroutine.

call Algorithm FinalCases
For proving that Algorithm InitialCases is r -competitive in the considered interval, we still need one more claim as below.
Lemma 7 Suppose that machine M1 is empty (i.e., L 1 = 0), and that the load L 2 of machine M2 is at most B 5 . If x is a job whose size satisfies x / ∈ S 2 and Recall that there is no job assigned to M1 so far. Since x / ∈ S 2 , we obtain x > T 2 ≥ B 1 (where the last estimation was shown in Lemma 5.5). From x > B 1 it then follows that by Lemma 4.2 and Lemma 3.2). This is a contradiction, since no job can be bigger than s · OPT.
After this, we state the next theorem.

Proof 1. If Algorithm FinalCases is called in
Step 1 and there all jobs are assigned to machines (in Step 1 and Step 2 of Algorithm FinalCases), then FinalCases terminates and all jobs are within the safe sets, so the competitive ratio of r is not exceeded. At the end of Step 1, let us denote the actual job by x i . It holds that L 2 +x i ≥ B 5 , and before x i came, L 2 was below B 5 . Algorithm FinalCases was called at the end of Step 1, but none of the conditions of the five Steps 1-5 in Algorithm FinalCases was actually true (i.e., FinalCases was not executable). In particular, Step 5 of FinalCases was not executed. Since L 1 = 0 (machine M1 is empty), and B 4 > 0 (from Lemma 4.1), it thus follows that L 2 + x i > T 5 . Together with L 2 < B 5 it follows from Lemma 3.6 that x i > T 5 − B 5 = B 4 . Note that at this point still there is no job assigned to M1. Since x i is not assigned to M1 (as FinalCases was not executable), in particular, Step 4 of FinalCases is not executable. Since L 2 < B 5 < B 3 (from Lemma 4.2), it means that L 1 + x i / ∈ S 4 . From x i > B 4 (see above) it then follows that x i > T 4 .
Suppose that x i > B 3 holds (from which we derive a contradiction). Then it follows that Step 3 of Algorithm FinalCases would be executed; a contradiction. Hence x i > T 3 − B 5 . Note that all assumptions of Lemma 7 are satisfied. Hence Thus we conclude from the previous two paragraphs that T 4 < x i < B 3 . Let us investigate how big the actual load of M2 would be, if x i was assigned to this machine; that is, we want to estimate L 2 + x i . We are going to show that T 5 < L 2 +x i < B 3 , by excluding all other possibilities. To prove the lower bound, note that since the algorithm terminated the while-loop, we have L 2 < B 5 and L 2 +x i ≥ B 5 . As we argued above, we know that L 2 + x i / ∈ S 5 , hence we have L 2 + x i > T 5 . To prove the upper bound, we need to exclude two more cases (see also Fig. 2).
(a) Suppose that L 2 + x i ∈ S 3 = [B 3 , T 3 ]. Since L 1 = 0 ≤ B 2 (by Lemma 4.1), Step 3 of Algorithm FinalCases would have been executed; a contradiction. Thus . Note that all assumptions of Lemma 7 are satisfied. Hence Consequently, 2. We enter Step 2. We assign x i to M2. From the analysis above we know that the load L 2 after this assignment is above T 5 and below B 3 .
Then several jobs may come, and they are assigned to machine M2, while the load L 2 of M2 remains below B 3 . This termination point of the while-loop will come for sure: otherwise we would have an empty machine M1, and the total load of all jobs, all on machine M2, would be still below B 3 . Since B 3 < B 1 < s = s · OPT (by Lemmas 5.2 and 4.2), this contradicts the assumption that the optimum value is OPT.
Let x j denote the job upon terminating the while-loop. Now we call Algorithm FinalCases with this index j. Assume FinalCases is not executable (otherwise we are done). It holds that L 2 < B 3 and L 2 + x j ≥ B 3 . Furthermore, L 1 = 0 ≤ B 2 (by Lemma 4.1), but Step 3 of Algorithm FinalCases was not executed, thus L 2 + x j / ∈ S 3 . Consequently, L 2 + x j > T 3 , and thus x j > D 3 . By Lemma 5.6 we have D 3 > B 4 . Since no job is assigned to M1, and Step 4 of FinalCases was not executable, moreover L 2 ≤ B 3 , we have that The assumption of x j ≥ B 2 will lead to a contradiction as follows. Since Step 2 of FinalCases was not executable, it holds that L 1 + x j = x j / ∈ S 2 , hence x j > T 2 . In Lemma 5.5 we proved that T 2 > B 1 , hence x j > B 1 . Since also Step 1 of FinalCases was not executable, it holds that L 2 + x j / ∈ S 1 . From x j > B 1 we thus deduce that L 2 + x j > T 1 . Thus we estimate x j > T 1 − L 2 > T 1 − T 3 = s, where the second estimation uses L 2 < B 3 < T 3 and the last inequality is due to Lemma 3.2. Hence x j > s = s · OPT, so job x j would be too large for an optimum value of OPT.
Summing up, we conclude that T 4 < x j < B 2 holds.

In
Step 3 we assign x j to M1, and since this is the only job which has been assigned to M 1 ever, the load L 1 of M1 is between T 4 and B 2 .
Then again, several jobs may come, and they are assigned to machine M2, while the load L 2 of M2 remains below B 3 . This termination point of the while-loop will come for sure: otherwise we would have machine M1 with a load lower than B 2 < 1 = OPT by Lemma 5.2, and the load of L 2 is below B 3 < B 1 < s = s · OPT by Lemma 5.2. This contradicts the assumption that the optimum value is OPT.
Let x k denote the job upon terminating the while-loop. Now we call Algorithm FinalCases with this index k. Assume that FinalCases is not executable (otherwise we are done). In particular, Step 3 of FinalCases was not executable, and since L 1 ≤ B 2 , it follows that L 2 + x k / ∈ S 3 . Taking into account that L 2 < B 3 and L 2 + x k ≥ B 3 , it follows that L 2 + x k > T 3 , hence x k > D 3 .
From Lemma 5.7 it follows that x j +x k −B 2 > T 4 +D 3 −B 2 > 0, thus x j +x k > B 2 . Since Step 2 of FinalCases was not executable, it means that L 1 + x k = x j + x k / ∈ S 2 , hence x j + x k > T 2 . Since L 1 = x j ≤ B 2 , we have x k > D 2 = D 1 (by the definition of D 1 and D 2 ).
Assume that L 2 + x k ≥ B 1 . Since Step 1 of FinalCases was not executed, it would follow that L 2 + x k ≥ T 1 . Thus taking into account that L 2 < B 3 , we obtain the estimation x k ≥ T 1 − L 2 > T 1 − B 3 > T 1 − T 3 = s = s · OPT (by Lemma 4.2 and Lemma 3.2), which contradicts the optimality of value OPT. Thus L 2 + x k < B 1 .

We start
Step 4 with assigning x k to M2. Then the new load L 2 is between T 3 and B 1 .
Then for the last time, several jobs may come, and they are assigned to machine M2, as long as the load L 2 of M2 remains below B 1 . The termination point of the whileloop will come for sure: otherwise we would have a machine M1 with a load lower than B 2 < 1 = OPT (by Lemma 5.2), and the load of L 2 is below B 1 < s = s · OPT by Lemma 5.8. This contradicts the assumption that the optimum value is OPT.
Let x denote the job upon terminating the while-loop. We will show that now FinalCases is executable, thus we are done. Assume the opposite: FinalCases is not executable.
At this point we have L 2 < B 1 and L 2 + x ≥ B 1 . Since FinalCases is not executable, in particular, Step 1 of FinalCases was not executable, meaning L 2 + x / ∈ S 1 . Hence L 2 + x > T 1 , thus x > D 1 . Using x j > T 4 from Step 2 above, we can estimate x j + x > T 4 + D 1 > D 1 > B 2 using Lemmas 4.1 and 3.1. Since at this point only x j is assigned to M1, and Step 2 of FinalCases is not executable, that is L 1 + x = x j + x / ∈ S 2 , it also holds that x j + x > T 2 .
We summarize: x i , x j > T 4 , x k , x > D 2 = D 1 , moreover x j + x k > T 2 and x j + x > T 2 .
Note that x k + x > 2D 1 > s = s · OPT (by Lemma 5.8). So it follows that x k and x must be assigned to different machines in any optimum schedule, because even the faster machine M2 cannot handle both jobs within a makespan of OPT.
First, consider an optimum schedule where x k is assigned to the slower machine M1 and x is assigned to the faster machine M2. Assume that x i is also assigned to M1. Then we can estimate the load of this machine: L 1 ≥ x k + x i > D 1 + T 4 > 1 = OPT (by Lemma 5.9); a contradiction. Hence x i cannot be assigned to M1. Similarly, if we assume that x j is assigned to M1, we can deduce the very same estimation. Hence also x j cannot be assigned to M1. So both x i and x j must be assigned to the faster machine M2.
Second, consider an optimum schedule where x is assigned to the slower machine. Then by repeating the same arguments as above, we can deduce that also in this case, both x i and x j must be assigned to the faster machine M2.
Thus in any optimal schedule, both x i and x j are assigned to the fast machine M2, and one of x k and x is also assigned to the fast machine. Thus by Lemma 5.10 we get s · OPT ≥ min{x i + x j + x k , x i + x j + x )} = x i + min{x j + x k , x j + x } > T 4 + min{T 2 , T 2 } = T 4 + T 2 ≥ s = s · OPT; a contradiction.
It follows that our assumption was false, i.e., when job x is revealed, FinalCases is executable. This completes the proof.

Conclusions
We gave a compound algorithm and showed that its competitive ratio equals the previously known lower bound for any speed s ∈ [ 5+ √ 241 12 , √ 3] ≈ [1.7103, 1.7321], i.e. on the "wide" interval. Although the considered interval is in fact "not too wide", we applied new ideas, to be able to get the tight ratio here.
Our idea (as we described it also in the Introduction) in the algorithm design is as follows. Instead of having a universal algorithm, we have two algorithms: one for the "good cases" and another for the problematic cases. If the incoming job is good in some sense for us, we assign it with the first algorithm. Otherwise, if the incoming job is bad, we assign it by the second algorithm. (Of course, we make only one common schedule, the next job is assigned by the rule of either the first, or the second algorithm, but not both.) The good or bad status of the incoming job depends on its size, and on the actual values of the loads of the machines as well.
If, at any time, a good job arrives, we win against the adversary list, as we are able to finish the schedule by the first algorithm, without violating the prescribed competitive ratio. And it turns out that in any sequence there must come a good job. It means that the problematic cases are intermediate cases, and if we can "survive" these problematic cases without making a bad decision (that would lead us to violate the competitive ratio), sooner or later a good case must come.
Except for the narrow interval (which is approximately [1.6934, 1.6963]) where the gap between the upper and lower bounds is very small, the question about the tight value of the competitive ratio for our problem remains open for speeds between √ 73+3 8 ≈ 1.443 and 5 3 . We think that the applied ideas can be helpful to get the tight ratio (or a ratio which is close to the tight ratio), where the question is actually open.
We also performed computational experiments, which are consistent with our theoretical results. Among other details, these investigations can be found in Dósa et al. (2015b).