An O ( n ) Time Algorithm for Scheduling UET-UCT of Bipartite Digraphs of Depth One on Two Processors

Given n unit execution time (UET) tasks whose precedence constraints form a directed acyclic graph, the arcs are associated with unit communication time (UCT) delays. The problem is to schedule the tasks on two identical processors in order to minimize the makespan. Several polynomial algorithms in the literature are proposed for special classes of digraphs, but the complexity of solving this problem in general case is still a challenging open question. We present in this paper an O(n) time algorithm to compute an optimal schedule for the class of bipartite digraphs of depth one.


Introduction
The problem of scheduling a set of tasks on a set of identical processors under a precedence relation has been studied for a long time.A general description of the problem is the following.There are n tasks that have to be executed by m identical processors subject to precedence constraints and (may be without) communication delays.The objective is to schedule all the tasks on the processors such that the makespan is the minimum.Generally, this problem can be represented by a directed acyclic graph ( ) called a task graph.The set of vertices V corresponds to the set of tasks and the set of edges E corresponds to the set of precedence constrains.With every vertex i, a weight i p is associated that represents the execution time of the task i, and with every edge ( ) , i j , a weight ij c is associated that represents the communication time between the tasks i and j.If ( ) , i j E ∈ and the task i starts its execution at time t on a processor P, then either j starts its execution on P at time greater than or equal to j t p + , or j starts its execution on some other processor at time greater than or equal to j ij t p c + + .
According to the three field notation scheme introduced in [1] and extended in [2] for scheduling problems with communication delays, this problem is denoted as max | , , | m i ij P prec p c C .A large amount of work in the literature studies this problem with a restriction on its structure: the time of execution of every task is one unit execution time (UET), the number of processors m is fixed, the communication delays are neglected, constant or one unit (UCT), or special classes of task graph are considered.We find In this context, the problem remains an open question [5].The problem of two processors scheduling with communication delays is extensively studied [6] [7].In particular, it is proven in [8] that the problem 2 max | binary tree, 1, | is NP-hard where c is a large integer, whereas this problem is polynomial when the task graph is a complete binary tree.
A challenging open problem is the two processors scheduling with UET-UCT, i.e. the problem for which the complexity is unknown.However, several polynomial algorithms have been shown for special classes of task graphs, especially for trees [9] [10], interval orders [11] and a subclass of series parallel digraphs [12].In this paper we present an

( )
O n time algorithm to compute an optimal algorithm for the class of bipartite digraphs of depth one, that is the digraphs for which every vertex is either a source (without predecessors) or a sink (without successors).

Preliminaries
A schedule UET-UCT on two processors for a general directed acyclic digraph ( ) where v t is the time for which the task v is executed and i P the processor on which the task v is scheduled.
and v are scheduled on the same processor, and 2 u v t t + ≤ if u and v are scheduled on distinct processors.
A time t of a schedule σ is said to be idle if one of the processors is idle during this time.The makespan max C or the length of a schedule σ is the last non-idle time of σ , that is: is the minimum among all feasible schedules.Let ( ) =  be a bipartite digraph of depth one.Since every vertex of G is either a source or a sink, there exists always a feasible schedule such that the sources B are executed before executing the sinks W. Our algorithm for solving the problem under consideration produces an optimal schedule satisfies this condition and that we called a natural schedule defined as follows.
Definition 1 Let ( ) =  be a bipartite digraph of depth one.A natural schedule of G is obtained by scheduling first the sources B then the sinks W starting from the processor 1 P and alternating between 1 P and 2 P such that the resulting schedule is optimal.
The definition of a natural schedule σ of a bipartite digraph of depth one ( ) 1) The number of sources executed on 1  and the number of sources executed on 2 P is idle at this time (may be 1 P also).3) If B is odd then: a) σ contains at most 3 idle times, the first is at time  is an idle time then 2 P is idle at this time and 1

C
otherwise.

Figure 1.
Bipartite digraphs of depth one and their corresponding natural schedules.
. Figure 1 illustrates some bipartite digraphs of depth one and their corresponding natural schedules.

Scheduling Algorithm
The idea of solving the problem is to determine the necessary and sufficient conditions to exist idle times in a natural schedule of the task graph.In the following, we consider ( ) is a bipartite digraph of depth one where B is the set of sources and W is the set of sinks, and σ is a natural schedule for G.
. We distinguish two cases, B is even and B is odd.Lemma 2 Assume that B is even.
1) The two processors b and 2 b are not universal, a contradiction.In a similar way we prove the case b.


Notice that if B (or W) contains exactly one non-universal vertex b then the vertex of W which is independent of b is also non-universal but it is not necessary unique (see Figure 1).Algorithm Schedule_|B|_is_even (G) constructs a natural schedule for ( ) Algorithm Schedule_|B|_is_even (G)  then the vertex scheduled at this time would be of degree less than or equal to 2 B − , a contra- diction.
3) Assume that 2  is of degree less than or equal to 2 B − , since it must be independent of the two ver-


To construct a natural schedule for G when B is odd, we need to the Procedure Two_Vertices (G).This procedure return 1 if the condition 3.b of Lemma 3 holds, and return two vertices w, b such that ( ) , , ,  1 shows the construction of natural schedules of the graphs 3 4 , G G and 5 G resulting from the algo- rithm Schedule_|B|_is_odd (G).

Complexity
We assume that ( ) is represented by its adjacency lists, so the set of neighbors and the set of non neighbors of every vertex of G are known already.In this supposition, we can check easily that any step (except the step Two_Vertices (G)) of the two algorithms Schedule_|B|_is_even (G) and Schedule_|B|_is_ odd (G) can be executed either within a constant time or within an

Conclusion
We have presented an

( )
O n time algorithm for the optimal schedule of bipartite digraphs of depth one with UET-UCT on two processors.The complexity of this problem for general directed acyclic graphs is still an open question.We believe that our algorithm can be used to solve this problem in general as follow: Consider a topological sort of a directed acyclic graph G.The linear ordering defined by this topological sort decomposes G into consecutives bipartite digraphs of depth one.The schedule obtained by the concatenation of the schedules of these bipartite digraphs is a feasible schedule or may be modified to a feasible schedule of G. Now, if we can determine the necessary and sufficient conditions to exist idle times in this feasible schedule then we can determine the complexity of this problem.This is a useful guide and foundation for future research.

3 ,.
. The worst case of this Procedure occurs when its result is 1.In this case, for any 1 2 w = ∅  , otherwise, a vertex b independent of 1 w and 2 w would be of degree less than or equal to 2 W − .So the number of comparisons of if statement in this procedure is equal to at most Therefore, the procedure Two_Vertices (G) runs within ( ) O B time and the total time of our scheduling algorithm is ( ) O n .
loss of generality, we can suppose that both idle times max if and only if σ has at most the idle time max + .The inverse, let b and w be a source and a sink of G.If b is not adjacent to w, then we can schedule b on 2 and w be a source and a sink of G.If b is not adjacent to w, then we can schedule b on 1 we can schedule  on 2