An improved partial solution to the task assignment and multiway cut problems

An improved partial solution to the task assignment and multiway cut problems

Operations Research Letters 12 (1992) 3-10 North-Holland July 1992 An improved partial solution to the task assignment and multiway cut problems Van...

458KB Sizes 2 Downloads 44 Views

Operations Research Letters 12 (1992) 3-10 North-Holland

July 1992

An improved partial solution to the task assignment and multiway cut problems Vangelis F. Magirou Athens Unil,ersity o f Economics and Business, Patission 76, 104 34 Athens, Greece Received February 1991 Revised October 1991

The Task Assignment problem consists of assigning tasks to processors in order to minimize the sum of execution times and communication costs. It is equivalent to the Multiway Cut problem, where for a weighted graph with specified vertices S = {s i . . . . . s N} one has to select a set of edges of minimal weight that separates the si's. A problem's size can be reduced by Stone's observation that vertices in the same components as s~ in a minimal (s 1, S - s~) cut remain so in an optimal multiway cut. Hence the optimal assignment of a task to a processor might sometimes be determined by solving an auxiliary two processor problem, which amounts to a max flow computation. In this paper we show that the same property holds in a different two cut-two processor problem, and at least as many tasks are thus assigned as through Stone's procedure. Computational results show that the improvement is significant although for large problems no reduction is to be expected. The method can be extended to identify, tasks whose optimal assignment is restricted to be in a subset of the processors. task assignment; graph flow algorithms; multiway cut

1. Introduction

The Task Assignment problem was introduced by Stone [7] in the context of distributed computing, where the tasks comprising a program can be executed by different processors. It is reasonable to expect that the system's throughput will increase if tasks are assigned to processors so as to minimize overall cost, including the cost of running a task on a processor, and the cost of interprocessor communication that arises in case data transfer is required between different processors. It was observed in [7] that the Task Assignment problem can be reduced to the problem of finding a minimal weight edge set separating some distinguished vertices (whose number equals that of the processors) in a properly constructed weighed graph. This is the Multiway Cut Problem which is polynomial in the case of separating two vertices, but becomes NP-complete in the case of

Correspondence to: Vangelis F. Magirou, Athens University of Economics and Business, Patission 76, 104 34 Athens, Greece.

three or more vertices as shown by Dahlhaus et al. [31. Several exhaustive search methods, heuristics and special structure solutions have appeared to deal with problems in 3 or more processors (for instance Bokhari [2], Lo [4], Magirou and Mills [5] and Price [6]). Most of these methods can benefit from a method due to Stone that can reduce the number of tasks to be assigned: Stone [7] examines an auxiliary 2-processor problem where a certain processor is singled out and all other processors are lumped into a new one. He then shows that the tasks assigned to the distinguished processor in the auxiliary problem retain this assignment in (some) optimal solution of the original problem (this is subject to qualifications noted by Abraham and Davison in [1]). An analogous result holds for the Multiway Cut problem, and serves as a basis for a bounded approximation scheme [3]. Stone's result is effective when the auxiliary problem assigns many tasks to the distinguished processor. Computational experience shows that this is not the case, especially for large problems.

0167-6377/92/$05.00 © 1992 - Elsevier Science Publishers B.V. All rights reserved

3

Volume 12, N u m b e r 1

OPERATIONS RESEARCH LETTERS

In this p a p e r we propose a different auxiliary 2-processor problem which is guaranteed to assign at least as many tasks as Stone's. In the computations reported in this p a p e r the number of tasks assigned by our method significantly exceeds those assigned by Stone's, although both methods give null results for large problems. In case no tasks can be preassigned to single processors, our method can be extended to identify tasks that will be assigned to one of the processors in a particular processor group. This technique can sometimes solve analytically problems otherwise intractable and, failing that, can reduce the computation in exhaustive procedures.

2. Problem formulation and theoretical development The Task Assignment problem [4] consists of a set T = {t~, t 2. . . . . t M} of tasks to be executed in a distributed system containing N processors P = { P p P2 . . . . . PN}" The execution cost of tz on Pk is denoted by Eik. In case t i and t~ are run on different processors a communication cost c,i = cji is incurred. We assume that the communication costs do not depend on the particular processors the tasks are assigned to. The objective is to find the assignment f : T ~ P that minimizes the sum of execution and communication costs. In the Multiway Cut problem [3], given a graph G = (V, E), a set S = {s I . . . . , s N} of N specified vertices and weights w(e) for e ~ E, we are asked to find a minimum weight set of edges E ' such that the removal of E ' from E disconnects each si from all the others. The two problems can be transformed to one another as follows: For a task assignment problem we can construct a graph G = (V, E ) with I V I = M + N and where S = {s 1. . . . . SN} C_ V corresponds to the processor set P = {Pl . . . . . PN}" The vertices in V - S correspond to T = {t~. . . . . tM}. The edge set E will consist of edges between the tasks with w(ti, t j ) = cii and edges between each t i and s k with w(ti, Sk) = Wik ~ , r E i r / ( N - 1 ) - Eik. It can be verified that the minimum multiway cut provides a solution to the task assignment problem by assigning to Pk the tasks that belong to the same component as s k when the cut edges are removed. Conversely a multiway cut problem can be transformed to a =

July 1992

task assignment problem with P = S, T = V - S, cii = w(t~, tj), and Eik = ~r ~ kW(ti, Pr)" As the multiway cut and the task assignment problems are NP-complete for N > 3 [3] while they are polynomial for N = 2, the following observation is important [3,7]: If E i is a minimum cut separating vertex si from the other members of S and V, are the vertices connected to s i after the Ez are removed, there exists an optimal multiway cut that leaves all the vertices in Vii in the same component as si. In terms of the task assignment problem, if a task t i is associated to pj, in a two processor assignment where the P - - p k processors are combined into a new one p' with execution times E w, = wik then t i is assigned to Pk in some optimal N-processor assignment. Thus a given problem can be reduced in the number of tasks by computing {Pk, P - - P k } two-cuts. It is important to note that for this method to work we must ensure that the Wgk are nonnegative. In several computations we noted that the above method does not provide substantial reduction to the number of tasks even for small problems. A more efficient reduction procedure is based on the following intuitively obvious proposition whose proof is given in the Appendix:

Proposition 1. Consider a task assignment problem ( P, T, Ei~, cii) and let an optimal assignment consist of a partition ( A 1. . . . . A N) o f T, A m being the tasks assigned to Pm" Consider a modified problem (P, T, Efk, cij) where E 2
Volume 12. Number 1

OPERATIONS RESEARCH LETTERS

upgraded then at least as many tasks should be assigned to them, Formally we have: Corollary 1. In the statement of Proposition 1 let E~, <_E)p ]br all p in a processor set P' c_P. There exists an optimal assignment ( B 1 , . . . , B N) such that

UA,,.

p~p'

p~p'

The last inclusion is reuersed if Eilp <_E~,.

July 1992

sition 1 the same or fewer tasks are assigned to p and hence at least as many tasks are assigned to Pl as claimed. Our main results can also be stated in terms of the multiway cut problem as follows. Corollary 2. In a multiway cut problem and for a specific certex s I, consider an auxiliary two cut problem to separate s~ and a new rertex s with corresponding edge weights"

w(i, s) = max w(i, Sk). The result follows easily from the observation that the assignment (A~ u BI, A 2 - B~ . . . . . A u B I ) is optimal and (A I u B~) o (A k - B 1) includes A1 OAk. We can use the above results to identify tasks that will definitely be assigned to a given processor, say p,,. This is described in the following proposition:

Proposition 2. For a task assignment problem with P = (Pl . . . . . PN), consider the auxiliary twoprocessor problem in one of the original processors Pm and a new one p with performance Eip= mink,,nEik, communication costs remaining the same. If ( A m, A) is the optimal assignment for the latter problem that is maximal in the tasks assigned to p, then the tasks in A m are assigned to Pm in any optimal solution of the original problem. (See Appendix ) It is interesting to note that at least as many tasks will be assigned through Proposition 2 as with Stone's procedure. In Stone's two processor reduction for say processor p~ the auxiliary processor q has execution cost

k N - 1

It might occur that the method of Proposition 2 also fails to assign a significant number of tasks to single processors. The next result (which follows from a repeated application of Corollary 1) can give information about the group of processors a task might be assigned to in an optimal solution: Corollary 3. Consider a task assignment problem (P, T, Eik, c u) and let P be partitioned in two

processor sets R and S. Consider the two processor problem in processors r and s with same communication costs as before and execution costs Eir

If

=

max Eip and El. ~ = min L i p . pER

( A 1. . . . .

p~S

A N) is a solution of the original prob-

lem there exists a solution (Bn, B s) of the modified problem such that p~R

Eil

which must be nonnegative for the procedure to apply. Now, the method suggested in Proposition 2 gives the auxiliary processor p an execution cost

E i p = m i n { E i k } = m ki n. l{ F = E Wir -- m a x k~l i.

Consider the optimal cut that is maximal in s. Then the component that contains s~ is included in the component corresponding to s~ in some optimal multiway cut.

B R = {Tasks assigned to r} c U Ap.

Eik Eiq = wil

k~l

Wik ~ Wil -~- E l q

where we have used the assumption W;k > O. Thus the p processor defined in Proposition 2 has inferior performance than q. By virtue of Propo-

Thus tasks assigned to r will be assigned to some processor in R in an optimal assignment. This observation can be useful in case there is a group of processors of comparable performance competing with another group. The methods that examine partial assignments to individual processors are likely to fail, but grouping the processors in the manner suggested by the corollary might provide nontrivial results as shown in the example of the next section. Furthermore, partial assignments to the subset of processors reduce the branching factor of exhaustive search methods.

Volume 12, Number 1 3.

Numerical

OPERATIONS RESEARCH LETTERS

July 1992

problem resulting from ours. The min-cut in Figure l(b) assigns no tasks to Pl, but the min-cut in Figure 1(c) assigns t~ and t 2 to pl while another cut assigns t 3 t o P2" Stone's method fails to assign tasks to any processors. A problem illustrating the method suggested in Corollary 3 is given in Figure 2(a). The min-cut

examples

Consider the 3-processor, 3-task assignment problem whose E u are shown in Figure l(a) and for which c u = 2. Figure l(b) shows the two processor problem resulting from Stone's method with respect to pl while Figure 1(c) shows the

Cij

-

i

--

t

-

i

(a)

I //

I

0

-

6

(b) / /

/ / (c) Fig. I

=

Volume 12, Number 1

O P E R A T I O N S R E S E A R C H LETTERS

method assigns no tasks to any processor (Figure 2(b)). If we now group p~ and P2 to a new processor r, we get the problem of Figure 2(c) whose solution assigns all tasks to r. Thus all tasks run on either p~ or P2 and a further cut shows that the optimal solution assigns all tasks to Pi"

July 1992

Some computational experiments are shown in Tables 1 and 2. Each entry of Table 1 summarises the results of running 50 task assignment problems in the number of processors-tasks corresponding to the entry's position. The parameters E and c are selected from a uniform distribution and the communication grahs have edge density ½.

1

2

3

1

4

4

9

2

6

5

2

3

5

6

7

Cij

(a)

/

6

6

(b)

7

/

/ (c) Fig. 2

6

=

9.

Volume 12, N u m b e r 1

OPERATIONS RESEARCH LETTERS

July 1992

Table 1 Percentage of tasks assigned No. of tasks

10 15 20 25 30 40 50

No. of proc. 3

4

5

10

20

56.6 70.6 31.5 50.3 18.3 27.6 7.9 16.0 3.0 6.1 0.5 2.5 0.0 0.0

12.2 47.4 6.0 24.8 4.3 10.9 1.9 5.3 0.7 1.9 0.0 0.4 0.0 0.1

3.0 39.0 0.9 14.1 0.7 7.0 0.6 3.0 0.1 1.2 0.1 0.3 0.0 0.0

0.0 10.4 0.0 3.5 0.0 1.3 0.0 0.3 0.0 0.0 0.0 0.0 0.0 0.0

0.0 3.0 0.0 0.4 0.0 0.0 0.0 0.1 0.0 0.0 0.0 0.0 0.0 0.0

The upper entry of the table shows the average percentage of tasks partially assigned using Stone's procedure while the lower entry shows the corresponding number for ours. Table 2 shows the percentage of problems for which the two methods result in a complete solution of the problem. As expected the proposed method gives better results but both cut methods give insignificant reductions for large problems.

4. Directions for further research

One would expect that the proposed cut method would provide a bounded polynomial approximation scheme for the Multiway Cut problem just like Stone's method does. Unfortunately,

Table 2 Percentage of problems completely solved by cut methods No. of tasks

10 15 20 25 30

No. of proc 3

4

4 20 0 6 0 4 0 2 0 0

0 6 0 0 0 0 0 0 0 0

the direct analog of the approximation in [3] fails to be bounded when Stone's cut is replaced by that of Proposition 2. It would be interesting to see if different approximation schemes can improve the bound 2(N - 1 ) / N of [3] for the Multiway Cut, and extend the scheme to the Task Assignment problem. Appendix Proof of Proposition I. Consider two task assignment problems with identical P = {Pl . . . . . PN}, T = {t~ . . . . . t M} and communication costs cii. The execution costs E~k and EZk satisfy Ell > E 2 and Ei~ = EZk for k 4: 1. Let the task partition A = A | . . . . . A N) be optimal with respect to E 1, and B - - ( B 1 , . . . , BN) be optimal with respect to E e. Consider now the assignments

B ' = ( A l t.j Bl, A z - B l . . . . . A N - B 1 ) = (B~,.. . , and A ' = ( A lfqB1, B2 + A z A B 1. . . . . BN + A N ~ B I ) = (A'I .....

A'N).

We will use the plus sign for the union of disjoint sets and omit the intersection symbol. By the optimality of A, B we have

E

E El~+c(A~ ..... AN)

k iEA k

<- E

E E ] k + c ( A ' l . . . . . A'N),

k i~A~

(1)

Volume 12, Number 1

OPERATIONS RESEARCH LETTERS

RHS = c(Al UB,, A, U B , ) + c ( / i , e , , / i l e l )

E E ES+dB1 ..... k i~B k

<- E

July 1992

+ c( / I 2 - B I , . . . , A N ~ E S + c ( B ; .... , B N )

(2)

+ c(B 2

k i~B~

=c(Al

where c ( ' " ) denotes the relevant communication costs. By the elementary properties of sets we have

+/I2BI . . . . . BN + A ~ B I )

- Bl,

+c(/i2-B

-

/iiBl)-l-c(Bi

-/ii.

AIBi)

+ C( /IIBI, AIB1) + c( /IIBI, /IIB.)

c( /il ..... ~ix) <

B1)

1. . . . . A N - B I )

+ c ( B 2 +/izB1 . . . . . B~. +A~.B I).

y" Eill tE_A I - B I

(6b)

Since in addition to (6)

c( A i B I, /iiBl ) + c t A1B,, / i , < ) k-> -,2

t~B~

+ d/i;,...,

Ak

iEAk-Bk-B

=c(A1BI, L)+C(A,B,,B,),

I

/i',~ ),

(3)

and

A--i - A i B l

c ( B i . . . . . BN)

=AI -Bl =B,-/i,,

Bl - A 1 B 1 = B1 - A l =A1 - BI,

<- E i~A 1 B I

the basic inequality (5) simplifies to

2c( A I - B I, B 1 - AI) + c( A 2 . . . . . A~ ) k~2

i~B k A k

i~Ak-Bk-B

+ c(B2,...,

I

t

+ c( B; . . . . . B N ).

(4)

Since E,~ < E)~ and E,.Zk= Es~ for k 4= 1 we get by adding (3) and (4) that C(/iI

..... /IN) +c(B1,'",BN)

_

< c ( A , t . . . . . A xt ) +c(B1 t . . . . . BN)

(5)

.

Note that each c ( X 1. . . . . X N) expression is defined as c(X, .....

x,,)= E E

E

m k
We will use the facts A U B = / I B, A B = A U B, the bar denoting complement. The LHS, RHS of (5) become LHS=c(AI,

ztl)+c(B,,

+ c(B 2 .....

=c(AiBl,

B,) + c ( A 2 . . . . . AN)

BN)

,dl) + c ( A 1 B 1 , Bl)

+ c ( A i - Bl, .dl) + c ( B i - A i ,

+ C ( / i 2. . . . . AN) + c ( B 2.....

B1) BN) ,

(6a)

BN)

< c ( B 2 + A 2 B 1. . . . . B x + A N B I ) + c( A2-

B 1. . . . .

AN-

BI).

(7)

We will show now that each term in the RHS of (7) is also in the LHS, showing thus that (7) must be an equality. Consider first a c u that appears in both expressions of the RHS. Then if i is in ( B 2 + A 2 B 1) ( A k - B I) it is also in B2A k and if j is in (B 3 + A 3 B I) ( A , , , - B 1) it is also in B3A m. Hence the term c u will appear in both c(B2, B~ .... ) and c(., A k . . . . . A,,,,. ). A c u that appears only in c(A 2 - B I. . . . . A N - B ~ ) also appears in c(A 2.... , A N ) . Finally consider a c,i that appears only in c ( B 2 + A 2 B I. . . . , B N + ANB1). If i ~ B k, j ~ B m or i ~ A k, j ~ / i , , , the t e r m will a p p e a r in c ( B 2 , . . . , B N) or c(A2 . . . . . /IN)" If however i ~ B k and j e A , , , B j then j ~ B l - / I I , while i is either in Bk/i ~ and hence in / i i - B l or in B k ( A z U " ' " U / I N ) . Therefore either c u is in c(/i 1 - B I, B I - / i 1 ) or in c(A 2. . . . . A N ) , which exhausts the examination of the R H S terms. Since (7) is an equality, the inequalities (1), (2) and (5) are all equalities and the proposition has been proven. The proof also shows that c(/i I - B ~ , B 1 - A l) = 0 and hence if c u > 0 we have either A~ c B 1

Volume 12, Number 1

OPERATIONS RESEARCH LETTERS

o r B 1 _ A 1. Since t h e case B 1 c A r Since the case B~ c A ~ can be e x c l u d e d if Ei 1 > E/2k it follows t h a t an e - p e r t u r b a t i o n in the c, E ' s o f a p r o b l e m will p r o d u c e strict inclusions a n d thus r e m o v e c o m p l i c a t i o n s in specifying m a x i m a l o r m i n i m a l t a s k sets. P r o o f of P r o p o s i t i o n 2. W i t h o u t loss of g e n e r a l i t y let m = 1. C o n s i d e r p r o c e s s o r s P 2 , ' ' ' , P N a n d i n t r o d u c e an u p g r a d e d p r o c e s s o r p with

Eip = min Elk. k~l A g a i n w i t h o u t loss o f g e n e r a l i t y r e p l a c e p r o c e s s o r P2 b y p . I n t h e assignment problem ( P t , P, P3 . . . . . PN) t h e r e exists an o p t i m a l assignm e n t with no tasks a s s i g n e d to P3 . . . . . PN" This is c l e a r b e c a u s e if ( A 1, A=, A3, . . . ) is o p t i m a l a n d A k ~ ~, k >__3, we can r e a s s i g n all t c A k to p w i t h o u t any i n c r e a s e in e x e c u t i o n o r c o m m u n i c a tion costs. T h e e x e c u t i o n costs a r e at least as g o o d since Eip <_Eik a n d the c o m m u n i c a t i o n costs will n o t i n c r e a s e as f e w e r c o m m u n i c a t i o n s a r e involved. T h u s t h e ( P l , P, P3 . . . . . pN ) p r o b l e m r e d u c e s to a two p r o c e s s o r one, (p~, p). L e t ( A i , A ) b e t h e o p t i m a l a s s i g n m e n t t h a t has the m a x i m a l set o f tasks a s s i g n e d to p. N o w if (B~, B= . . . . , B N) w e r e an o p t i m a l a s s i g n m e n t for t h e original p r o b l e m , by virtue o f P r o p o s i t i o n 1, B 2 c A . N o t e f u r t h e r m o r e t h a t the s a m e set A w o u l d result if p~ i n s t e a d o f P2 w e r e i m p r o v e d to p a n d thus A _ ~ B k for k > 2 . F i n a l l y we have A ~B2u ".. uB k and hence A 1 cBl.

10

July 1992

Acknowledgement I w o u l d like to t h a n k Dr. J. Milis for carrying o u t the c o m p u t a t i o n s r e p o r t e d in this p a p e r , Prof. C.H. P a p a d i m i t r i o u for p o i n t i n g out [3], a n d an a n o n y m o u s r e f e r e e for several constructive comments.

References [1] S. Abraham and E. Davidson, "Task assignment using network flow methods for minimizing communication in n-processor systems", Center for Supercomputing, Res. Develop. Technical Report 598, Sept. 1986. [2] S.H. Bokhari, "A shortest tree algorithm for optimal assignment across space and time in a distributed processing system", IEEE Trans. Software Engrg. 7, 583-589 (1981). [3] E. Dahlhaus, D. Johnson, C. Papadimitriou, P. Seymour and M. Yannakakis, "The complexity of multiway cuts", Extended Abstract, 1983. [4] V. Lo, "Heuristic algorithms for task assignment in distributed systems", IEEE Trans. Comput. 37, 1384-1397 (1988). [5] V. Magirou and J. Milis, "An algorithm for the multiprocessor assignment problem", Oper. Res. Lett. 8/6, 351-356 (1989). [6] C. Price, "The assignment of computational tasks among processors in a distributed system", in: Proc. Nat. Computer. Conf., 291-296, May 1981. [7] H. Stone, "Multiprocessor scheduling with the aid of network flow algorithms", IEEE Trans. Software Engrg. 3, 85-93 (1977).