Part II On-Line Algorithms
3.3 Performance analysis of the greedy algorithm
3.3.2 Semi-online case
As Pruhs and Torng (1994) point out, on-line algorithms may typically behave poorly because of a large variance of job parameters, which may be exceptional in real life. It is therefore of interest to analyze special cases in which the algorithm is fed additional knowledge about the structure of the problem in order to further our understanding of the general problem. Such an algorithm is called a semi- online algorithm. This consideration has motivated us to analyze the special case introduced and justiο¬ed by Rebaine and Strusevich (1999), in which the time lags are relatively small for all jobs. Speciο¬cally, they assume that
ππ β€π=1,2;1β€πβ€πmin πππ, for each π = 1, . . . , π, and πππ > 0, (3.3)
and show that the oο¬-line version is solvable in π(π) time. We consider the semi- online setting of this problem, where the release times, processing times and time lags are not known before the jobs arrive. Furthermore, we assume that operations with zero processing time require no processing at all. We prove the following result.
3.3 Performance analysis of the greedy algorithm 37
Theorem 5 The greedy algorithm has a competitive ratio of 5/3 if condition
(3.3) is satisο¬ed, this bound is tight, and no non-delay algorithm can do better. Proof. Since πΆ1π+ ππ β₯ π for each π½π β π³ together with condition (3.3), there
can be no more than two jobs in π³.
Case 1. There is only one job in π³, say, π½π.
We know that during the time interval [ππ, π1π] both machines are busy, oth-
erwise the algorithm would have started π½π earlier. We split this case up in two:
Case 1.1 π΄ β= β ;
In this case, one or more jobs are released after time π , and hence we have
πΆπΊ
max= π + π2π+ π2(π΄)
β€ π(π΄) + π2(π΄) + π2π
β€ πΆmaxβ + π2π.
If π2π β€ 23πΆmaxβ , then πΆmaxπΊ β€ 53πΆmaxβ , and we are done.
Alternatively, if π2π > 23πΆmaxβ , we must have that ππ + π1π + ππ < 13πΆmaxβ ,
because of (3.1). Furthermore, let πΌ2 denote the total idle time on π2; note that
idle time on π2 must occur in the intervals [0, ππ] and [π1π, π ]. Since πΆ1π+ ππ=
π1π+ π1π+ ππ β₯ π , we derive that
πΌ2β€ ππ+ π β π1π
β€ ππ+ π1π+ ππ (3.4)
< 13πΆmaxβ .
Hence we have that
πΆmaxπΊ = π2(π₯) + πΌ2< 43πΆmaxβ .
Case 1.2 π΄ = β .
In this case, it must be that πΆ1π+ππ = π , since π½π is the only job in π³. Hence,
we have
πΆπΊ
38 3 Two-Machine Open Shop
If π1πβππ β€ 23πΆmaxβ , since ππ+π1π+ππ+π2π β€ πΆmaxβ , we have πΆmaxπΊ β€ 53πΆmaxβ , and
we are done. Therefore, we assume π1πβ ππ > 23πΆmaxβ in the following discussion.
We deο¬ne π± as the set of jobs that have operations ο¬nishing in the time interval (ππ, π1π] on machine π1, that is, π± = {π½πβ£ππ < πΆ1π β€ π1π}; remember that both
machines are busy during this time interval. Because of (3.1), we have that
π(π± + π½π) + π1(π± + π½π) β€ πΆmaxβ . (3.5)
Assume that ππ= π(π±) for some π½πβ π±. Inequality (3.5) boils then down to
ππ+ π1(π±) + π1πβ€ πΆmaxβ .
Since π1(π±) β₯ π1πβ ππ> 23πΆmaxβ , we obtain that
ππ+ π1π < 13πΆmaxβ , (3.6)
and hence also that
ππ+ ππ< 13πΆmaxβ . (3.7)
Apparently, it holds that ππβ€ ππ, and we need to branch into three subcases.
Case 1.2.1 Machine π1is either busy during the period of [ππ, ππ], or ππ= ππ.
Let πΌ1denote the total idle time on π1; note that idle time on π1 must occur
in the intervals [0, ππ] and [πΆ1π, πΆmaxπΊ ]. Since πΆ1π+ ππ = π and πΆmaxπΊ = π + π2π,
we derive that
πΌ1β€ ππ+ ππ+ π2π.
With π2π< 13πΆmaxβ due to π1πβ ππ> 23πΆmaxβ and (3.7), we have that
πΆπΊ
max= π1(π₯) + πΌ1< 53πΆmaxβ .
Case 1.2.2 Machine π2 is busy during the period of [ππ, ππ].
Let πΌ2denote the total idle time on π2; note that idle time on π2 must occur
in the intervals [0, ππ] and [π1π, πΆ1π+ ππ]. We derive that
3.3 Performance analysis of the greedy algorithm 39
With ππ < 13πΆmaxβ due to π2π< 13πΆmaxβ and (3.6), we have that
πΆmaxπΊ = π2(π₯) + πΌ2< 53πΆmaxβ .
Case 1.2.3 Both machines have idle time in the period [ππ, ππ], that is, they
are not fully occupied in this interval.
In this case, the analysis is substantially more intricate. Since π1π is ο¬nished
in the period of [ππ, π1π] and job π½πis released at ππ, π2πmust start before π1πfor
otherwise π1πwould have started earlier on machine π1, and π2πmust end before
ππ, for otherwise machine π2would be fully occupied in the interval [ππ, ππ]. Due
to π1πβ ππ > 23πΆmaxβ , it holds that
π2π+ π2π< 13πΆmaxβ , (3.8)
and hence
ππ+ ππ < 13πΆmaxβ . (3.9)
During the period [ππ, π2π], both machines must be busy otherwise job π½π
would have started earlier. Deο¬ne
π₯π= max{ππβ (πΆ2π+ ππ), 0}.
If π₯π = 0, we have πΌ2 β€ ππ+ ππ+ π1π + ππ. Using (3.7) and (3.9), we have
πΆπΊ
max = π2(π₯) + πΌ2 β€ 53πΆmaxβ and we are done. Hence, we assume π₯π> 0 in the
following discussion.
If π₯π> 0, machine π1must be busy during the period [πΆ2π+ππ, ππ], otherwise
π1π would have started earlier. Therefore, in this case, we have that
πΌ1β€ ππ+ π2π+ ππ+ ππ+ π2π, and (3.10)
πΌ2 β€ ππ+ ππ+ π₯π+ π1π+ ππ. (3.11)
We further branch this case into three subcases.
Case 1.2.3.1 There is an operation π1π ο¬nished before πΆ2π+ ππin machine
40 3 Two-Machine Open Shop
In this case, we have π1π+π₯π+π1π < 13πΆmaxβ due to π1πβππ > 23πΆmaxβ . Hence,
we get
ππ+ π₯π+ π1π < 13πΆmaxβ ,
since ππ β€ π1π due to (3.3). Together with (3.7) and (3.11), we have πΆmaxπΊ =
π2(π₯) + πΌ2< 53πΆmaxβ .
Case 1.2.3.2 There is an operation π2π ο¬nished before π2π in machine π2.
In this case, we have π2π+ π2π+ π2π < 13πΆmaxβ due to π1πβ ππ > 23πΆmaxβ . Hence,
we get
ππ+ π2π+ π2π< 13πΆmaxβ ,
since ππ β€ π2π due to (3.3). Together with (3.7) and (3.10), we have πΆmaxπΊ =
π1(π₯) + πΌ1< 53πΆmaxβ .
Case 1.2.3.3 No operation ο¬nishes before πΆ2π+ ππ on machine π1 and no
operation ο¬nishes before π2π on machine π2.
In this case, remember that there is idle time before πΆ2π + ππ on machine
π1, and no job is released before ππ, for otherwise there would be an operation
ο¬nished either on machine π1 before πΆ2π+ ππ, or on machine π2 before π2π.
Hence we have that
ππ+ π1(π₯) < πΆmaxβ .
Together with the maximal idle time on machine π1 after ππ, we have
πΆπΊ
max β€ ππ+ π1(π₯) + π2π+ ππ+ ππ+ π2π.
Using the inequalities (3.8) and (3.9), we get πΆπΊ
max < 53πΆmaxβ . This completes
the case with only a single job in π³.
Case 2. We now consider the case that there are two jobs in π³, say, π½π’ and
π½π£. Assume without loss of generality that π½π’precedes π½π£on π1. First of all, note
that no other job can be executed between π1π’ and π1π£. To see this, suppose
there is some other job, say, π½π, executed between them. Since the time lags are
small, see inequality (3.3), and since ππ£ < π , and πΆ1π’+ ππ’ β₯ π , job π½π would
delay the start of job π½π£ on machine π1 to a time later than π . In such a case,
3.3 Performance analysis of the greedy algorithm 41
π2π£ < π and πΆ2π£ β₯ π , which contradicts the property that π2 is busy in the
time interval [π, πΆπΊ
max] but idle immediately before time π .
Case 2.1 π΄ β= β .
In this case, if we have π2π’> 13πΆmaxβ , we get ππ’+ π1π’+ ππ’< 23πΆmaxβ . Note that
the idle time in machine π2 is bounded by πΌ2 β€ ππ’+ π1π’+ ππ’, since π2 is busy
in the period [ππ’, π1π’] and after πΆ1π’+ ππ’. This immediately gives πΆmaxπΊ < 53πΆmaxβ .
Therefore, we consider
π2π’β€ 13πΆmaxβ (3.12)
in the remainder of this case. Accordingly, we have that
πΆπΊ
max= π + π2π’+ π2π£+ π2(π΄). (3.13)
If π2π’+ π2π£ β€ 23πΆmaxβ , we obtain that
πΆπΊ
max = π + π2π’+ π2π£+ π2(π΄) β€ π(π΄) + π2(π΄) +32πΆmaxβ β€ 53πΆmaxβ ,
and we are done. Hence, we assume π2π’+ π2π£> 23πΆmaxβ in this case. This implies
that
(π1π£β ππ£) + π2(π΄) < 13πΆmaxβ , (3.14)
since both machines must be busy in the interval [ππ£, π1π£] and π1π£< π .
In addition, we have π1π£+ π1π£+ ππ£ β₯ π , since otherwise operation π2π£ would
have started before time π . Substituting this in (3.13), we obtain
πΆπΊ
max β€ π1π£+ π1π£+ ππ£+ π2π’+ π2π£+ π2(π΄).
Together with ππ£+ π1π£+ ππ£+ π2π£β€ πΆmaxβ , (3.12) and (3.14), it holds that πΆmaxπΊ < 5
3πΆmaxβ and we are done.
Case 2.2 π΄ = β .
In this case, it must be that πΆ1π’+ ππ’= π and πΆ1π£+ ππ£β€ πΆ2π’, for otherwise
there would be idle time on π2between π2π’and π2π£, contradicting our deο¬nition
of π . Hence, we write πΆπΊ
42 3 Two-Machine Open Shop
πΆmaxπΊ = ππ’+ (π1π’β ππ’) + π1π’+ ππ’+ π2π’+ π2π£, and (3.15)
πΆmaxπΊ = ππ£+ (π1π£β ππ£) + π1π£+ ππ£+ (πΆ2π’β (πΆ1π£+ ππ£)) + π2π£. (3.16)
If (π1π’β ππ’) + π2π£ β€ 23πΆmaxβ or (π1π£β ππ£) + (πΆ2π’β (πΆ1π£+ ππ£)) β€ 23πΆmaxβ , then we
conclude from (3.15) or (3.16) that πΆπΊ
maxβ€ 53πΆmaxβ .
So, it only remains to consider the situation that (π1π’β ππ’) + π2π£ > 23πΆmaxβ
and (π1π£β ππ£) + (πΆ2π’β (πΆ1π£+ ππ£)) > 23πΆmaxβ .
These two inequalities imply that ππ£ < π1π’; otherwise, π2 would have been
busy during the disjoint periods [ππ’, π1π’], [ππ£, π1π£], [π2π£, πΆ2π£] and [πΆ1π£+ ππ£, πΆ2π’],
and hence (π1π’β ππ’) + π2π£ and (π1π£β ππ£) + (πΆ2π’β (πΆ1π£+ ππ£)) cannot each be
greater than 2
3πΆmaxβ at the same time. This means that machine π2must be busy
in the intervals [ππ’, π1π’] and [π1π’, πΆ1π’], for otherwise π2π£ would have started on
π2 before time πΆ1π’.
Let now π² = {π½π β£ πΆ2π> ππ’}. We obtain that
π(π²) + (π1π’β ππ’) + (πΆ1π’β π1π’) + π2π’+ π2π£β€ πΆmaxβ ,
since machine π2 is busy during the periods [ππ’, π1π’] and [π1π’, πΆ1π’]. Due to
(π1π’β ππ’) + π2π£ > 23πΆmaxβ , we get that
π(π²) + π1π’+ π2π’< 13πΆmaxβ . (3.17)
Let now π½π be a job with ππ = π(π²). We analyze three further subcases:
Case 2.2.1 π2π is scheduled before π1π, or π1π is absent;
In this case, π2must be busy in the interval [ππ, ππ’]. For πΌ2, the total idle time
on π2, this implies that πΌ2β€ ππ+ππ’, since the length of the idle time immediately
before time π on machine π2must be smaller than or equal to ππ’, as π1π£is started
immediately after π1π’and cannot be started earlier. Accordingly, by use of (3.3)
and (3.17), we obtain that
πΆmaxπΊ = π(π₯) + πΌ2β€ πΆmaxβ + ππ+ ππ’β€ πΆmaxβ + ππ+ π1π’+ π2π’< 43πΆmaxβ .
Case 2.2.2 π2π is scheduled after π1π and πΆ1π+ ππ > ππ£;
3.4 The worst-case performance of on-line delay algorithms 43 πΌ1β€ ππ+ ππ+ π2π’+ π2π£, (3.18)
since π1 must be busy in the intervals [ππ, πΆ1π] and [ππ£, πΆ1π£]. From (π1π£β ππ£) +
(πΆ2π’ β (πΆ1π£+ ππ£)) > 23πΆmaxβ and π2(π₯) β€ πΆmaxβ , we derive that π2π£ < 13πΆmaxβ .
This inequality together with inequalities (3.3), (3.17) and (3.18) imply that
πΆπΊ
max = π1(π₯) + πΌ1< 53πΆmaxβ .
Case 2.2.3 π2π is scheduled after π1π and πΆ1π+ ππ β€ ππ£.
In this case, πΌ1 is bounded from above by
πΌ1β€ ππ+ ππ+ (ππ£β (πΆ1π+ ππ)) + π2π’+ π2π£. (3.19)
It is known that period [πΆ1π + ππ, ππ£] precedes period [ππ£, π1π£] and period
[πΆ1π£+ ππ£, πΆ2π’] precedes period [π2π£, πΆ2π£], and machine π2 is fully occupied in
these periods. From (π1π£β ππ£) + (πΆ2π’β (πΆ1π£+ ππ£)) > 23πΆmaxβ and π2(π₯) β€ πΆmaxβ , it
follows that π2π£+ (ππ£β (πΆ1π+ ππ)) < 13πΆmaxβ . Using this inequality together with
(3.3), (3.17) and (3.19), we obtain that πΆπΊ
max = π1(π₯) + πΌ1 < 53πΆmaxβ .
This concludes the case-by-case analysis to prove the competitive ratio for the case with small time lags.
To conclude, we give an example to show that the bound is tight for non-delay and non-preemptive schedules. Consider the following instance of the problem. At time π‘ = 0, jobs π½1= (π11 = 2, π1= 0, π21= 0) and π½2= (π12= 0, π1= 0, π22= 2)
arrive; at time π‘ = π, job π½3 = (π13 = 1, π1 = 1, π23 = 1) arrives, with some
0 < π β€ 1/2. Any non-delay and non-preemptive algorithm gives a schedule of length 5, whereas the optimal makespan is 3 + π. Therefore, a ratio of 3+π5 is best possible for any non-delay and non-preemptive algorithm. As π could be arbitrarily small, the ratio could be arbitrarily close to 5/3. β‘
3.4 The worst-case performance of on-line delay algorithms
Does a delay algorithm, that is, an algorithm that is willing to keep a machine deliberately idle while an operation is available for processing, have a better com- petitive ratio than the greedy algorithm, which is non-delay? After all, allowing tactical delays may lead to better schedules (Kanet (1986); Kanet and Sridharan (2000)). The answer is βnoβ for the non-clairvoyant version of the problem, both
44 3 Two-Machine Open Shop
for the general case and for the case with small time lags, as we will prove in the next theorem.
Theorem 6 For the non-clairvoyant version of the problem, no on-line delay
algorithm has a better competitive ratio than an on-line greedy algorithm. Proof. We use an adversary strategy against which any on-line delay algo- rithm must perform poorly. Consider the following instance of the problem. At time π‘ = 0, jobs π½1= (π11, π1 = 0, π21= 0) and π½2 = (π12= 0, π1= 0, π22) arrive.
Let algorithm π» be any delay algorithm. Suppose algorithm π» imposes delib- erate delays π1 and π2 to schedule jobs π½1 and π½2, respectively. Without loss of
generality, assume π2β₯ π1β₯ 0.
If π2 > 0, let π = 2 and π11= π22 = π2. The minimum makespan is now π2,
but algorithm π» will ο¬nish the two jobs at time 2π2. It has therefore a competitive
ratio at least 2.
If π2= 0, let π = 3 and job π½3 arrives at time π‘ = π. For the general case, we
let π11 = π22 = 1 and π½3 = (π13 = π, π1 = 1 β 2π, π23 = π), whereas for the case
with small time lags we let π11 = π22 = 2 and π½3 = (π13 = 1, π1 = 1, π23 = 1).
Since these two instances boil down to those used in Theorem 4 and Theorem 5 to prove the competitive ratios 2 and 5/3 for the greedy algorithm, algorithm π» does not outperform the greedy algorithm. β‘ Accordingly, the greedy algorithm is a best possible algorithm for the non- clairvoyant variant of the problem.
For the clairvoyant problem, we prove that any on-line delay algorithm has a competitive ratio of at least β2 β 1.414. However, this results leaves open the question whether an on-line delay algorithm has a better competitive ratio than the greedy algorithm.
Theorem 7 For clairvoyant version of the problem, no on-line delay algorithm
has a competitive ratio better than β2.
Proof. Consider the following instance of the problem. At time π‘ = 0, jobs π½1=
(π11 = 1, π1 = 0, π21 = 0) and π½2 = (π12 = 0, π2 = 0, π22 = 1) arrive. Let
algorithm π» be any delay algorithm, and suppose algorithm π» imposes deliberate delays π1 and π2 for jobs π½1 and π½2, respectively. Without loss of generality, we
3.5 Conclusions 45
job π½3 = (π13 = π, π3 = 1 β 2π, π23 = π) arrives at time π2+ π, 0 < π β€ 1/2. In
the former case, the schedule given by π» has πΆmax= 1 + π2, while in the latter
case we have πΆmax = 2 + π1. The optimal makespans are 1 and 1 + π2+ 2π,
respectively. So, the competitive ratio of algorithm π» is greater than or equal to max{1+π2
1 ,1+π2+π2+2π1 }. Accordingly, the minimum competitive ratio is equal to β
2, which is achieved for π1= 0 and π2=β2 β 1. β‘
3.5 Conclusions
We have proven that the greedy algorithm for the on-line two-machine open shop scheduling problem with time lags has a tight competitive ratio of 2; this ratio is 5/3 in the case of small time lags. For the non-clairvoyant versions of these problems, the greedy algorithm is a best possible algorithm. For the clairvoyant versions, the greedy algorithm is a best possible non-delay algorithm; however, since we could only prove a lower bound ofβ2 β 1.414 on the competitive ratio in general, a delay algorithm may have a better competitive ratio.
Other interesting avenues for further research are the problems with asym- metric time lags and problems with other types of small time lags, such as ππ β€ min{π1π, π2π} for all jobs π½π.