WSPT ’ s Competitive Performance for Minimizing the Total Weighted Flow Time : From Single to Parallel Machines

We consider the classical online scheduling problem over single and parallel machines with the objective of minimizing total weighted flow time. We employ an intuitive and systematic analysis method and show that the weighted shortest processing time (WSPT) is an optimal online algorithmwith the competitive ratio ofP+1 for the case of singlemachine, and it is (P+(3/2)−(1/2m))competitive for the case of parallel machines (m > 1), where P is the ratio of the longest to the shortest processing time.


Introduction
In the context of scheduling problems, the flow time of a job is the total time it stays in the system.Sometimes it is also called response time.It is equal to the delay of waiting for service plus the actual service time.The total (weighted) flow time captures the overall quality of service of the system, which is a natural and important measure in many applications such as networks and parallel computing [1,2].From the prespective of optimal solutions, the objective of minimizing the total (weighted) flow time is equivalent to minimizing the total (weighted) completion time.However, online algorithms and approximation results are largely different between the two objectives.
In this work, we consider the online scheduling over parallel machines with the objective of minimizing the total weighted flow time.Formally, there is a set of  jobs and  identical machines.Each job   is associated with processing time   , release date   , and a positive weight   .All the information about one job is not revealed until it is released.Also, the total number  of jobs is unknown a priori.An online algorithm determines which machine to be chosen and what time to start for processing each job without interruption.Denote the completion time and flow time of   by   and   , respectively.Then,   =   −   holds.The problem can be denoted by |  | ∑     in terms of the standard three field notations for scheduling problems [3].
When the objective is to minimize the total (weighted) completion time, it is well known that optimal deterministic online algorithms with the competitive ratio of 2 have been presented for 1|  | ∑   [4,5] and 1|  | ∑     , respectively [6,7].As for the parallel machine scheduling |  | ∑     , the current best online algorithm is given by Correa and Wagner [8]; they design a 2.618-competitive algorithm based on linear programming techniques and the concept of -point.However, no online algorithm with bounded competitive ratio exists for the case of total (weighted) flow time scheduling.Even for offline approximate algorithms, the lower bound on worst-case performance guarantee is still at least Ω( √1/2− ) for the single machine case [9] and Ω( √1/3− ) for the multiple machines case [2].
Since the lower bound is so strong, an intuitive idea is to impose some additional assumptions on the original problem.A widely used assumption is that the ratio of the longest to the shortest processing time is not greater than a constant, say .With this assumption, Bunde [10] proves that the shorting processing time (SPT) rule is optimal with the competitive ratio of ( + 1)/2 for 1|  | ∑   .Most of other previous works focus on the preemptive setting.Chekuri et al. [11] consider the problem 1|  , | ∑     .They present a (log 2 )-competitive online algorithm when the weights are also bounded.Leonardi and Raz [2] prove that the shortest remaining processing time (SRPT) algorithm has a competitive ratio of (log(min((/), ))) for |  , | ∑     .The same authors also provide a Ω(log(min((/), ))) lower bound on the competitive ratio of any randomized algorithm for this problem.Bansal and Dhamdhere [12] make another kind of assumption.They assume that the job weights belong to at most  different arbitrary weight classes.Under this assumption, they construct an online algorithm for 1|  , | ∑     and prove that it is -competitive.Combining this conclusion and the assumption that the ratio of the maximum to the minimum job weight is , the authors further obtain a (log )-competitive algorithm, since weights can be rounded up to a power of 2.
To the best of our knowledge, no positive results exist when nontrivial weights are considered and preemption is not allowed.In this work, we show that the weighted shortest processing time (WSPT) rule is optimal with the competitive ratio of  + 1 for 1|  | ∑     , and it is ( + (3/2) − (1/2))-competitive for |  , | ∑     ( > 1).The competitive analysis method is based on the idea of instance transformation, which is first introduced by us in [13] and is further developed in [14,15].The method tries to search for the worst-case instance in the instance space.It starts from an arbitrary instance and modifies the instance towards the possible structure of the worst-case instance with respect to the given online algorithm.The modification guarantees that the performance ratio of the modified instance does not decrease.Eventually, the modification ends up with an instance with a relatively simple and special structure, whose performance ratio can be much easily evaluated.
The paper is organized as follows.In Section 2 we show that the worst-case instance with respect to the WSPT rule is characterized by two kinds of special structures.Then, we analyze the performance ratio of these two kinds of instances for the single machine and parallel machines in Sections 3 and 4, respectively.Concluding remarks are given in Section 5.

Block Structure of the Schedule and Instance Transformation
For any instance , denote the schedule obtained by WSPT by (), the optimal offline schedule by  * (), and the objective values of the two schedules by ALG() and OPT(), respectively.For any job   in , denote its flow time in () and  * () by   and  *  .It can be easily shown that the worst-case instance can be obtained among such instances for which the schedules by WSPT rule are composed of a single block.A block means a time interval in which jobs are processed contiguously without keeping all the machines idle at the same time.Denote any one of these instances by  1 .Without loss of generality, assume that the first job is released at time 0; that is, the single block begins at time 0. According to the nondecreasing order of starting times of jobs in ( 1 ), we further partition jobs into subblocks, such that the jobs within each subblock are ordered according to the WSPT rule and the last job of a subblock has a greater ratio of processing time to weight (hereafter, we use weighted processing time to refer to the ratio) than the first job of the succeeding subblock if it exists.
We will further show that a new instance with a more simple and special structure can be obtained by modifying the weights of jobs in  1 .First we introduce an important lemma without proof since it can be derived from basic mathematics.The following lemma will be repeatedly used in the competitive analysis.Lemma 1.Let () and () be two positive functions defined in the interval [, V]; moreover, () is convex and () is concave.Then, ()/() reaches its maximum at one endpoint of the interval; that is, It can be easily shown that the above lemma still holds when the interval is open at some endpoint in the condition that the limitation of ()/() exists at the corresponding endpoint.

Lemma 2. For an arbitrary instance 𝐼 1 , a new instance can be constructed by modifying the weights of jobs in 𝐼 1
, such that all the jobs in the new instance have the same weighted processing time or there are jobs which not only have the same weighted processing time but also have positive infinite weights in the last subblock of the schedule for the new instance; denote the former new instance by  2 and the latter one by  3 ; then Proof.Assume that ( 1 ) is composed of  subblock.We first consider the case of  > 1. Next, we will show that an intermediate instance   can be obtained by modifying  1 , such that either (  ) is composed of  − 1 subblocks or there are jobs with positive infinite weights in the last subblock of (  ) with  subblocks.Denote the last job of the next-to-last subblock in ( 1 ) by   .Denote the set of all the jobs of the last subblock by   .Divide   into two subsets in terms of the relations between their weighted processing times and   's: Modify the weight   of each job   in   1 to   , where  is a parameter to be chosen later.Let Denote the intermediate instance after this adjustment by   .Since this adjustment does not change the mutual relationships of the weighted processing time among jobs in the last subblock, jobs are processed in (  ) in the same order as in ( 1 ) for any  ∈ [, +∞).

ALG(𝐼 󸀠
) is composed of the linear combination of all jobs' weights, where the coefficient of each weight is the corresponding job's flow time.Since the schedule does not change after adjustment and each job's flow time does not change, ALG(  ) is a monotonously increasing linear function with respect to .Consider how OPT(  ) changes with respect to .If jobs keep the same processing order as in  * ( 1 ), the objective value of the obtained schedule is also a monotonously increasing linear function with respect to .Since the optimal schedule  * (  ) is the one with the minimal objective value among all the feasible schedules, OPT(  ) is a piecewise linear function with respect to ; moreover, its slope does not increase with  increasing.It means that OPT(  ) is a concave function with respect to .According to Lemma 1, we can obtain an instance with a worse performance ratio by choosing  as either  or +∞.There are two cases.
(i) If  is chosen as , there is at least one job belonging to   1 whose weighted processing time is modified to   /  according to (3).Then, update   1 and   2 according to (2).If there remain jobs in   1 , modify their weights by repeating the above procedure; otherwise all the jobs in    1 have been removed into    2 .Since all the jobs in   2 have greater weighted processing time than   's, the last two subblocks in the original schedule ( 1 ) can be combined into a single subblock in the new instance according to the description of "subblock" in Section 2; that is, (  ) is composed of  − 1 subblocks.
(ii) If  tends to infinity, all the jobs in    1 have weights +∞.This intermediate instance is just the instance which we want to obtain at the beginning of the proof.
By repeatedly applying the above transformation procedure, we can eventually obtain a new instance, such that the schedule by WSPT for the new instance is composed of a single subblock, or there are jobs with positive infinite weights in the last subblock of the schedule for the new instance.For the former one, for ease of exposition, we still use   to denote it.Next we will show that   can be modified such that all the jobs have the same weighted processing time.
Denote the first job in the single subblock of (  ) by  1 .Divide all the jobs into other two sets in terms of the relations between their weighted processing time and  1 's: Similar to the previous adjustment, modify the weight   of each job   in   1 to   , where  is a parameter to be chosen later.Let We use Ĩ to denote the intermediate instance after this adjustment.Completely similar to the previous analysis, when  lies in (0, ], ALG( Ĩ ) is a monotonously increasing linear function with respect to .OPT( Ĩ ) is a concave function with respect to .According to Lemma 1, we can obtain an instance with a worse performance ratio by choosing  as either  or an infinitely small value .If  is chosen as , there is at least one job belonging to   1 whose weighted processing time is modified to  1 / 1 according to (5).Then, update   1 and   2 according to (4).If there remain jobs in   1 , modify their weights by repeating the above adjustment procedure.If  is chosen as an infinitely small value, all the jobs in    1 have weights tending to 0. These jobs are processed at last both in ( Ĩ ) and  * ( Ĩ ).Thus, we can directly delete these jobs, since they contribute nothing to the objective value.
After finite steps, all the jobs lie in   2 ; that is, all the jobs have the same weighted processing time as  1 's.It is just the instance  2 which we want to obtain in the theorem.For the intermediate instance, where there are jobs with positive infinite weights in the last subblock, we can apply the same above modification and modify these jobs such that they have the same weighted processing time.The resulted instance is  3 which we want to obtain in the theorem.

WSPT's Optimality for 1|𝑟 𝑗 | ∑ 𝑤 𝑗 𝐹 𝑗
In this section, we show that WSPT is optimal with the competitive ratio of  + 1 for 1|  | ∑     .We obtain the result by proving that  + 1 is both an upper bound on the competitive ratio of WSPT and a lower bound on the competitive ratio of any online algorithm.
We know that the worst-case instance can be achieved among such instances, for which the schedules by WSPT are composed of a single block.From Lemma 2, we show that any such instance can be modified to a new instance with a worse performance ratio.Next, we can directly analyze the performance ratio of the new instance obtained in Lemma 2 and get the competitive performance of WSPT algorithm.

Theorem 3. The WSPT algorithm is optimal with the competitive ratio of
Proof.For the new instance  2 described in Lemma 2, where all the jobs have the same weighted processing time, it is obvious that the schedule obtained by WSPT is just the optimal one for 1|  | ∑     .
As for another new instance  3 , there are jobs which not only have the same weighted processing time but also have positive infinite weights in the last subblock.Denote the last job of the next-to-last subblock by   .Denote the set of all these jobs with positive infinite weights in the last subblock by  ∞ .We can directly analyze the performance ratio of the instance by only considering these jobs in  ∞ since other jobs' weighted flow times can be omitted in the sense of limitation.All these jobs in  ∞ are released after   starts being processed in ( 3 ); otherwise they would be processed before   .These jobs are continuously processed immediately after   is finished in ( 3 ).They are processed in the optimal Jobs with positive infinite weights arriving after J k starts being processed in (I 3 ) The WSPT schedule and optimal schedule for  3 in the case of single machine.
schedule  * ( 3 ) in the same order as in ( 3 ); moreover, they start being processed not earlier than the time when   starts in ( 3 ).Figure 1 illustrates the schedules ( 3 ) and  * ( 3 ).Thus, we have So, we get an upper bound on the competitive ratio of WSPT algorithm, i.e.,  ≤ 1 + .
Next, we show that 1 +  is also a lower bound on the competitive ratio of any deterministic online algorithm for Consider the following instance.The first job  1 arrives at time 0 with  1 = 1 and  1 = 1.The online algorithm decides to schedule  1 at time .The second job  2 is released job at time  +  with  2 = 1/ and  2 , where  is an infinitely small value.The optimal schedule performs no worse than the one which first schedules  2 at time  + , then, followed by  1 .So we have When  tends to 0 and  2 tends to infinity, the above ratio tends to ( + 1).Since a competitive ratio of an online algorithm is the maximal performance ratio over all the instances, we can directly obtain that the competitive ratio of any deterministic online algorithm is no less than ( + 1).
According to the above analysis, we can immediately obtain that the WSPT algorithm is optimal with the competitive ratio of  + 1.

Competitive Analysis of WSPT Algorithm
for |  | ∑     Next, we will extend the result for the single machine in Section 3 to the case of parallel machines.Similar to the proof for Theorem Moreover, if the LP schedule is nonpreemptive, then, Hereafter, we refer to the lower bound in Corollary 4 as LP lower bound and denote it by LB  (⋅).
4.1.Performance Analysis of  2 and  3 .For simplicity, we give the result via three Lemmas.Lemma 5.For any instance  for |  | ∑     , if all the jobs have the same weighted processing time and there is no idle time on each machine before it completes its processing in the corresponding schedule (), then, Proof.All the jobs in the instance  have the same weighted processing time.Moreover, there is no idle time on each machine before it completes its processing in the corresponding schedule in ().We can find out that for the corresponding virtual -times faster single machine problem, the schedule which processes jobs without preemption and delay in the same starting order as in () is just a LP schedule.Without loss of generality, we can assume that   =   in order to simplify the analysis.Thus, the LP lower bound in (10) can be rewritten as Another trivial lower bound on OPT() is Taking how the LP schedule is constructed, we can bound the flow time   in the WSPT schedule as So Denote the two bounds in ( 12) and ( 13) by LB1 and LB2 respectively,.Next, we analyze the performance ratio by two cases.
Lemma 6.In the case of parallel machines, for the instance  2 obtained in Lemma 2, one has Jobs arriving before t Jobs arriving at and after t 0 t Proof.When there is no idle time on each machine before it completes its processing in ( 2 ), this result can be directly obtained from Lemma 5. Suppose that there are totally  ( > 1) periods of idle time in ( 2 ).Next, we will show that an intermediate instance    2 can be obtained such that there are  − 1 periods of idle time in (   2 ); moreover, For the sake of exposition, we take an instance with three machines; for example, see Figure 2.  is the ending time of the last (with respect to the ending point of the idle time) period of idle time.It means that all the jobs are continuously processed without idle time on each machine after .Since WSPT is a no-waiting strategy, we know that all the arrived jobs have been finished or are being processed at .   is the latest completion time of jobs which start before .Denote the maximal processing time among all the jobs by  max ; then,   −  ≤  max .
Construct an intermediate instance denoted by   2 , which is composed of all the jobs released before .In addition, we construct an auxiliary instance Ĩ2 .It includes all the jobs released at and after .We have In order to bound the later term in the above expression, similar to the proof of Lemma 5, consider the virtual -times faster single machine problem for Ĩ2 .Assume that jobs are continuously processed on the virtual -times faster single machine from time  in the same starting order as in ( 2 ) without considering the release time constrain.Denote the corresponding flow time of   by    .Then, we can bound the flow time in the WSPT schedule as Without loss of generality, let   =   ; we have In addition, for the virtual -times faster single machine problem for Ĩ2 , consider its LP schedule.Denote by  LP  the flow time in the LP schedule.We can get a lower bound on OPT( Ĩ2 ) as Another trivial lower bound on OPT( Ĩ2 ) is Combining ( 22),(23), and (24), we have Similar to the analysis of the two cases in the proof of Lemma 5, we can obtain In addition, it can be obtained from   −  ≤  max that According to the above analysis, we can obtain   Proof.For ease of presentation, we still take an instance with three machines; for example, see Figure 3. Assume that these jobs with positive infinite weights start being processed at the time .  is the latest starting time of jobs among all the machines before .  is the latest completion time of jobs which start before .Denote the maximal processing time among all the jobs by  max ; then,   −  ≤  max .We only need to consider these jobs with positive infinite weights in the last subblock.Then, the proof is similar to the one for Lemma 6 and the detailed procedure is omitted.
Following Lemmas 2, 6, and 7, we can immediately get the competitive performance of WSPT for the case of parallel machines.

Concluding Remarks
In this work, we consider the single and parallel machines online scheduling problem of minimizing the total weighted flow time.We show that WSPT rule is optimal with the competitive ratio of  + 1 for the single machine problem, where  is the ratio of the longest to the shortest processing time.We further prove that the WSPT rule is ( + (3/2) − (1/2))-competitive for the case of parallel machines ( > 1), which is consistent with the case of single machine problem.
In the competitive analysis, we introduce an intuitive and systematic method.The method is aiming to derive an upper bound on the competitive ratio of the online algorithm.The analysis method exploits the possible structure of the worstcase instance with respect to the given online algorithm.The basic idea behind it is to begin with an arbitrary instance and transform it by modifying the instance, such that the modified instance shows a more special structure of which we can take advantage to analyze the performance ratio.The analysis method deserves to be extended to other online algorithms in our further work.

Figure 2 :
Figure 2: The schedule obtained by WSPT for  2 in the case of parallel machines.

Figure 3 :Lemma 7 .
Figure 3: The schedule obtained by WSPT for  3 in the case of parallel machines.
[17] can analyze the performance ratio of the new instances  2 and  3 obtained in Lemma 2. First, an appropriate lower bound on the optimal schedule has to be established in order to further analyze the performance ratio of  2 and  3 .Chou et al.[16]show a lower bound on the corresponding weighted completion time problem of |  | ∑     by introducing a virtual -times faster single machine problem and the concept of LP schedule[17].We can readily extend this result to the weighted flow time problem due to the equivalence between optimal schedules for |  | ∑     and |  | ∑     .For an instance  of |  | ∑     , construct a virtual -times faster single machine instance   = {  ,   /,   }.For the corresponding LP schedule of   , denote the mean-busytime and flow time of job   by    and    , respectively, and then,