Tight Approximations for Resource Constrained ... - Semantic Scholar

Report 3 Downloads 118 Views
Tight Approximations for Resource Constrained Scheduling and Bin Packing Anand Srivastav  Peter Stangier January 21, 1999 Abstract

We consider the following resource constrained scheduling problem. Given m identical processors, s resources R1 ; : : :; R with upper bounds b1 ; : : :; b , n independent jobs T1 ; : : :; T of unit length, where each job T has a start time r 2 IIN, requires one processor and an amount R (j) 2 f0; 1g of resource R , i = 1; : : :; s. The optimization problem is to schedule the jobs at discrete times in IIN subject to the processor, resource and start-time constraints so that the latest scheduling time is minimum. Multidimensional bin packing is a special case of this problem. Resource constrained scheduling can be relaxed in a natural way when one allows to schedule fraction of jobs. Let C resp. C be the minimum schedule size for the integral resp. fractional scheduling. While the computation of C is a NP-hard problem, C can be computed by linear programming in polynomial time. In case of zero start times Rock and Schmidt (1983) showed for the integral problem a polynomial-time approximation within (m=2)C and de la Vega and Lueker (1981), improving a classical result of Garey, Graham, Johnson and Yao (1976), gave for every  > 0 a linear time algorithm with an asymptotic approximation guarantee of (s + )C . The main contributions of this paper include the rst polynomial-time algorithm approximating C for every  2 (0; 1) within a factor of 1 +  for instances with b = (?2 log(Cs)) for all i and m = (?2 logC), and a proof that the achieved approximation under the given condition is best possible, unless P = NP. Furthermore, in some cases for every xed > 1 a parallel 2 -factor approximation algorithm can be derived. s

s

n

j

i

j

i

opt

opt

opt

opt

opt

i

Keywords: resource constrained scheduling, multidimensional bin packing, randomized

algorithm, derandomization, approximation algorithm, chromatic index. AMS Classi cation: 60C05, 60E15, 68Q25, 90C10, 90B35. Note: Parts of this paper appeared in preliminary form in: J. van Leeuwen (ed.), Proceedings of the Second Annual European Symposium on Algorithms (ESA'94), pages 307 { 318, Lecture Notes in Computer Science, Vol 855, Springer Verlag, 1994.

 Institut fur Informatik; Humboldt Universitat zu Berlin; Unter den Linden 6, 10099 Berlin, Germany;

e-mail: [email protected]  Institut fur Informatik; Universitat zu Koln; Weyertal 80, 50931 Koln, Germany; e-mail: [email protected]

1

1 Introduction Resource constrained scheduling with start times is the following problem: The input is  a set T = fT1; : : :; Tng of independent jobs. Each job Tj needs one time unit for its completion and cannot be scheduled before its start time rj , rj 2 IIN.  a set P = fP1; : : :; Pmg of identical processors. Each job needs one processor.  a set R = fR1; : : :; Rsg of limited resources. This means that at any time all resources are available, but the available amount of each resource Ri is bounded by bi 2 IIN, i = 1; : : :; s.  For i = 1; : : :; s, j = 1 : : :; n let Ri(j ) be 0/1 resource requirements saying that every job Tj needs Ri (j ) units of resource Ri during its processing time. For a job Tj 2 T and a time z 2 IIN let xjz be the 0/1 variable which is 1 i job Tj is scheduled at time z .  Given a valid schedule let Cmax be the latest completion time de ned by Cmax = maxfz j xjz > 0; j = 1; : : :; ng. The combinatorial optimization problem is: De nition 1.1 (Resource Constrained Scheduling) (i) (Integral Problem) Find a schedule, that is a 0/1 assignment for allPvaribles xjz , subject to the start time, processor and resource constraints such that z2IIN xjz = 1 for all jobs Tj and Cmax is minimum. Let Copt denote this minimum. (ii) (Fractional Problem) Find a fractional schedule, that is an assignment of each xjz to a rational number in the closed interval [0; 1] subject to the start times, processor and P resource constraints so that z2IIN xjz = 1 for all jobs Tj and Cmax is minimum. Let C denote this minimum. We shall call Copt the (integral) optimal and C the fractional optimal schedule. 1 According to the standard notation of scheduling problems the integral problem can be formalized as P jres  1; rj ; pj = 1jCmax : This notation means: the number of identical processors is part of the input ( P j ), resources are involved ( res ), the number of resources and the amount of every resource are part of the input ( res   ), every job needs at most 1 unit of a resource ( res  1 ), start times are involved ( rj ), the processing time of all jobs is equal 1 (pj = 1) and the optimization problem is to schedule the jobs as soon as possible ( jCmax ). The integral problem is NP -hard in the strong sense, even if rj = 0 for all j = 1; : : :; n, s = 1 and m = 3 [GaJo79], while the fractional problem can be solved by linear programming in polynomial time (as we shall see in the next section). An interesting special case of resource constrained scheduling is the following generalized version of the multidimensional bin packing problem. De nition 1.2 ( Bin Packing Problem BIN (~l; d)) Let d; n; li 2 IIN, i = 1; : : :; d, and let ~l = (l1; : : :; ld). Given vectors ~v1 ; : : :;~vn 2 [0; 1]d, pack 2 all vectors in a minimum number P of bins such that in each bin B and for each coordinate i, i = 1; : : :; d, ~vj 2B vij  li . 1 Note

that by de nition the fractional optimal schedule C is an integer, only the assignments of jobs to times are rational numbers. 2 Packing simply means to nd a partitioning of vectors in a minimum number of sets so that the vectors in each partition (= bin) satisfy the upper bound conditions of the de nition.

2

De ne LR = dmax1id l1i nj=1 vij e: (Observe that LR is the minimum number of bins, if fractional packing is allowed.) P

BIN (1; d) is the multidimensional bin packing problem, and BIN (1; 1) is the classical bin packing problem. The intention behind the formulation with a bin size vector ~l is

to analyse the relationship between bin sizes and polynomial-time approximability of the problem. Previous Work. The known polynomial-time approximation algorithms for resource constrained scheduling with zero start times (problem class P jres ; rj = 0; pj = 1jCmax ) are due to Garey, Graham, Johnson, Yao [GGJY76] and Rock and Schmidt [RS83]. Garey et al. constructed with the First-Fit-Decreasing heuristic a schedule of length CFFD which asymptotically is a (s + 31 )-factor approximation, i.e. there is a non-negative integer C0 such that CFFD  Copt (s + 31 ) for all instances with Copt  C0. De la Vega and Lueker [VeLu81] improved this result presenting for every  > 0 a linear-time algorithm which achieves an asymptotic approximation factor of s + . Rock and Schmidt showed, employing the polynomial-time solvability of the simpler problem with two processors (problem class P 2jres   ; rj = 0; pj = 1jCmax ), an d m2 e-factor polynomial-time approximation algorithm. Thus for problems with small optimal schedules or many resource constraints resp. processors these algorithms have a weak performance. Note that all these results are based on the assumption that the start-times of all jobs are zero. For example, Rock and Schmidt's algorithm cannot be used, when non-zero start-times are given, because the problem P 2jres  1; rj ; pj = 1jCmax is NP -complete, so their basis solution cannot be constructed in polynomial time, unless P = NP . In [SrSt94] we showed a 2-factor approximation algorithm for resource constrained scheduling problems, when the resource bounds and the number of processors are in (log(Cs)), and proved for this class that a polynomial-time -approximation algorithm for  < 1:5 cannot exist, unless P = NP . Since this non-approximability result was derived with a reduction to the NP-complete problem of deciding if a schedule of length 2 does exist or not, we conjectured that for other instances with large optimal schedules better approximations might be possible. We will show that this conjecture is true in a comprehensive sense: The Results. As the one main result we present a polynomial-time approximation algorithm for resource constrained scheduling with non-zero start times (problem class P jres  1; rj ; pj = 1jCmax ): For every  > 0, (1=) 2 IIN, an integral schedule of size at most d(1 + )Copte can be constructed in strongly polynomial time, provided that all ) resource bounds bi are at least 3(1+ 2 log(8Cs) and the number of processors is at least 3(1+) log(8C ). As a surprising consequence a schedule of length C +1 can be constructed opt 2 in polynomial-time, 3 whenever bi  3C (C + 1) log(8Cs)) for all resource bounds bi and m  3C (C + 1) log(8C ). This approximation guarantee is independent of the number of processors or resources. Our proof techniques fall in the general scheme of randomized rounding and derandomization (Spencer [Sp87], Raghavan/Thompson [Ra88] and Raghavan [Ra88]). The randomized rounding technique introduced in this paper di ers from [Ra88], because we have to generate an integral solution which must be feasible with respect to both, equality 3 Note that C is at most the sum of n and the maximal start time, hence the factor log(Cs) is within the size of the problem input.

3

constraints and packing constraints. The leading idea to meet these constraints is to consider the following relaxation: We keep the equality and packing constraints, but enlarge the optimal fractional schedule in an appropriate way and perform randomized rounding on the enlarged schedule. Furthermore, for derandomization an algorithmic version of the Angluin-Valiant inequality for multivalued random variables [SrSt94] is invoked. One might wonder, if under the assumptions bi 2 (?2 log(Cs)) for all i and m 2 (?2 log C ) the scheduling problem is interesting enough. In other words, are such problems solvable in polynomial time ? The answer is negative: Under the hypothesis P 6= NP our approximation is best possible. Among others it is shown that for the problem without start times and under the above conditions on the upper bounds of the resources and on the number of processors, given an optimal fractional schedule of length C and a feasible integral schedule of length C + 1, it is NP -complete to decide whether or not there exists an integral schedule of size C . In conclusion, both results together precisely determine the border of approximability for resource constrained scheduling. Since multidimensional bin packing is a special case of resource constrained scheduling, all approximation results carry over. Furthermore, applying Berger/Rompel's [BeRo91] extension of the method of logc n-wise independence to multivalued random variables, we can parallelize our algorithm in special cases: Let   1 dlog C e =C  log n . We get an NC -algorithm which guarantees for every constant > 1, a 2 2 -factor approximation, but unfortunately under the much more restrictive conditions m; bi  ( ? 1)?1 n 21 + dlog 3n(s + 1)e1=2 for all i = 1; : : :; s. At the moment we are not able to get less restrictive lower bounds for the resource bounds and the number of processors. Such ugly conditions on the resource bounds are due to the estimation of higher moments required by the method of logc n-wise independence. We leave open the question, if for  > 0 there exists a parallel (1 + )-factor approximation algorithm for problems with m; bi 2 (?2 log(ns)). The paper is organized as follows. In section 2 we study a general system of integer inequalities related to resource constrained scheduling, show under which circumstances an integral solution can be constructed via derandomization, and apply the results to resource constrained scheduling. In section 3 it is proved that the achieved approximation is optimal, unless P = NP . In section 4, as an example, the multidimensional bin packing problem is discussed. In section 5 we give the NC -approximation algorithm and show in the appendix section 6 how the NC -derandomization scheme of [BeRo91] can be applied to our problem.

2 Integral Solvability of Inequality Systems In this section we introduce a system of inequalities and equalities of which resource constrained scheduling with start times is a special case. It will be shown how an integral solution to such a system can be constructed in polynomial time, when a fractional solution to the system, which arises by scaling the right hand side of the inequalities of the initial system by some factor in (0,1), is given. In other words, we start with a fractional solution for the system with tighter constraints and randomly round the fractional solution to an integral one for the initial system. It will turn out that the integral solution is feasible, because the fractional solution satis es tighter inequalities, thus enough room is left for rounding. In this section we rst consider the general framework of inequality systems 4

and then work out its application to resource constrained scheduling with start times. A general approach how to construct integral solutions for linear inequality and equality systems via derandomization can be found in [Sriv95]. Inequality Systems and Derandomization Let sb; n; N be non negative integers. Let A = (aij ) be a sb  n 0/1 matrix and let b 2 Qbs+. For a vector xj 2 f0; 1gN , j = 1; : : :; n, and for k = 1; : : :; N let xjk be its k-th component. Let x(k) be the vector of all the k-th components, i.e. x(k) = (x1k ; : : :; xnk ). Let rj 2 f1; : : :; N g be numbers which will later play the role of start times. Consider the following system of linear inequalities

Inequality System (IS)

Ax(k) jjxj jj1 xj xjk x(k)

 b 8k = 1; : : :; N = 1 8j = 1; : : :; n 2 f0; 1gN 8j = 1; : : :; n = 0 8k < rj 8j = 1; : : :; n = (x1k ; : : :; xnk ) 8k = 1; : : :; N:

(1)

Resource constrained scheduling with non-zero start times ts in the system (IS) as follows: Consider the processors as an additional resource Rs+1 with requirements Rs+1 (j ) = 1 for all j = 1; : : :; n and with resource bound m. Let R = (Ri(j ))ij be the resource constraint matrix, set A = R and take for the right-hand side of the rst inequality in (IS) the vector whose components are the resource bounds. Then, the problem of nding a minimum N such that (IS) has a solution is equivalent to the problem of nding a valid schedule of minimum length. In consequence, deciding the solvability of (IS) is a NP -complete problem. But a key observation is that (IS) can be solved, if the same system with a tighter right hand side, say (1 + )?1 b instead of b is fractionally solvable ( > 0). Let us de ne the -version of (IS) for parameters 0 <   1. -Inequality System (IS ())

 (1 + )?1b 8k = 1; : : :; N = 1 8j = 1; : : :; n 2 f0; 1gN 8j = 1; : : :; n = 0 8k < rj 8j = 1; : : :; n = (x1k ; : : :; xnk ) 8k = 1; : : :; N: We need the following parameters. Let s1 be an integer with s1  s and de ne b;1 = 3(1+2 ) log(4s1 N ) and b;2 = 3(1+2 ) log(4(s ? s1 )N ): Ax(k) jjxj jj1 xj xjk x(k)

(2)

b

b

(3)

A word to the motivation of these parameters. Later we will take the number of resources

s for s1 and s + 1 for sb. The reason is that we wish to distinguish between the lower

bound conditions for the number of processors and the other resource bounds. In fact, with sb = s + 1 and s1 = s, b;2 is smaller than b;1, so a less restrictive lower bound for the number of processors is required.

Theorem 2.1 (Rounding Theorem) Let 0 <   1. Let s1 and b;i (i = 1; 2) be as in (3). Suppose that bi  b;1 for all i = 1; : : :; s1 and bi  b;2 for all i > s1 . Suppose that 5

u = (u1; : : :; un) with uj 2 [0; 1]N is a fractional solution for the -inequality system IS(). Then a vector x = (x1 ; : : :; xn) with xj 2 f0; 1gN satisfying system (IS) can be constructed in O(N sbn2 log(N sbn)) time. For the proof we need the following derandomization result which is an algorithmic version of the Angluin-Valiant inequality for multi-valued random variables. Let sb; n; N be nonnegative integers. We are given n mutually independent random variables Xj with values in f1; : : :; N gPand probability distribution Prob(Xj = k) = x~jk for all j = 1; : : :; n, k = 1; : : :; N and Nk=1 x~jk = 1. Suppose that the x~jk are rational numbers with 0  x~jk  1. Let Xjk denote the random variable which is 1, if Xj = k and is 0 else. For i = 1; : : :; sb and j = 1; : : :;Pn let wij be 0/1 weights. For i = 1; : : :; sb and k = 1; : : :; N de ne the sums n ik by ik = j =1 wij Xjk : Let 0 < ik  1 be rational numbers. Let IE() denote the expectation operator and de ne the event Eik by ik

 IE( ik )(1 + ik ):

(4)

Let (Eik ) be a collection of sbN such events. Put 2 f ( ik ) = exp(? ik IE3( ik ) ):

(5)

By the Angluin-Valiant inequality ([McD89], Theorem 5.7) we have for all k = 1; : : :; N and all i = 1; : : :; sb Proposition 2.2 Let Eikc be the complement of the event Eikc . Then IP[Eikc ]  f ( ik ): P S P Thus IP ( ik Eikc )  bsi=1 Nk=1 f ( ik ): Let us assume that this is bounded away from one, i.e.

s N

b X X

i=1 k=1

f ( ik )  1 ? :

(6)

for some 0 < < 1. The following theorem is a special case of the algorithmic version of the Angluin-Valiant inequality for multivalued random variables (Theorem 2.13 in [SrSt94]). Theorem 2.3 ([SrSt94] LetT0 < T < 1 and let Eik be events de ned as above satisfyTN Tb s N b s ing inequality (6). Then IP( i=1 k=1 Eik )  and a vector x 2 i=1 k=1 Eik can be  constructed in O N sbn2 log N bsn -time. We are ready to prove Theorem 2.1. Proof of Theorem 2.1: Set [N ] = f1; : : :; N g. Let X1; : : :; Xn be mutually independent random variables with values in [N ] de ned by IP[Xj = k] = ujk , k 2 [N ]. For j = 1; : : :; n and k 2 [N ] let Xjk be the 0=1 random variable which is 1 if Xj = k and 0 else. Furthermore, for each k 2 [N ] let X (k) denote the vector (X1k ; : : :; Xnk ). For i = 1; : : :; sb and k 2 [N ] de ne sums ik by ik = (AX

n (k)) = X a X ; i ij jk j =1

6

and let Eik be the event

 (1 + )(1 + )?1bi: Let Eikc denote the complement of event Eik . Since bi  b;1 for 1  i  s1 and bi  b;2 for s1 + 1  i  s we have by the Angluin-Valiant inequality [McD89] 2 1 ; IP[Eikc ]  exp ? 3(1 +bi )  2N (7) ik

b

!

where  = s1 or  = sb ? s1 resp.. 4 Hence IP[ ik Eikc ]  21 : With = 21 we can invoke the algorithmic Angluin-Valiant inequality for multi-valued random variables (Theorem 2.3) and can construct in O(N sbn2 log(N sbn)) time vectors x1 ; : : :; xn satisfying the conditions xj 2 f0; 1gN , jjxj jj1 = 1 for all j = 1; : : :; n and Ax(k)  b for all k = 1; : : :; N: Observe that the start-time conditions xjk = 0 for all k < rj and all j = 1; : : :; n are automatically stais ed, because by de nition of the fractional solution uj we have ujk = 0 for all k < rj and all j = 1; : : :; n. (in other words, the random variables Xj are assigned to k < rj with probability equal 0) S

2

In order to show the claimed approximation guarantee for resource constrained scheduling we proceed as follows. In the rst step we solve the linear programming relaxation of the integer program associated to resource constrained scheduling. Now an integer schedule can be generated in principle with our rounding theorem (Theorem 2.1). Since the rounding theorem can be applied only if a fractional solution within the smaller resource bound vector (1 + )?1 b is available, in the second step we have to show the existence of such a solution. Generating Fractional Solutions. Let rmax := maxj=1;:::;n rj . W.l.o.g. we may assume that rj  j for all j = 1; : : :; n. (Otherwise, if k > 1 is the smallest integer such that rk > k, one can schedule job T1 at time 1,......, Tk?1 at time k ? 1 and the problem reduces trivially.) Hence, the maximal schedule length is at most n, thus C  Copt  n: The fractional optimal schedule C can be found in polynomial time using standard arguments (see for example [LST90]): Start with an integer Ce  n and check whether the LP n R (j )x jz j =1 i

P

P

n x z=1 jz xjz

xjz

 bi

8 Ri 2 R; z 2 f1; : : :; ng = 1 8 Tj 2 T = 0 8 Tj 2 T ; z < rj and 8 Tj 2 T ; z > Ce 2 [0; 1] 8 Tj 2 T 8z 2 f1; : : :; ng 

(8) 

2IE( ik ) direct application of the Angluin-Valiant bound gives only exp ? 3(1 + ) . To obtain (7) the following trick is helpful: Note that IE( ik )  bi . We de ne a random variable Z with IE(Z ) = bi . Suppose that X1 ; : : : ; Xn are independent 0/1 random variables and put X = X1 +: : :+Xn . Suppose that IE(X )  b. Let b0 = bb ? IE(X )c and p = b ? IE(X ) ? b0 . Let Y0 ; : : : ; Yb be independent 0/1 random variables with IE(Y0 ) = p and IE(Yj ) = 1 for all j  1. Then the random variable Z = X + Y satis es IE(Z ) = b and trivially Z  X . We have for every 2 (0; 1]: 4A

0

IP(X > b(1 + ))  IP(Z > b(1 + ))  e?b =3 : The last inequality holds because IE(Z ) = b and thus the Angluin-Valiant bound is applicable to Z . 2

7

has a solution. Using binary search we can nd C along with fractional assignments (xejz ) solving at most log n such LPs. Hence C can be computed in polynomial-time, if we use standard polynomial-time LP algorithms. Our goal is to nd an integral solution using the rounding theorem (Theorem 2.1). But at this moment we cannot apply it, because the rounding theorem requires the existence of a fractional solution within the tighter resource bound 1+b  , while C and the assignments (~xiz ) are feasible only within the bound b. It should be intuitively clear that given a fractional solution within the resource bound b and a fractional schedule of length C , a new fractional solution within 1+b  can be constructed by enlarging the length of the schedule to some C > C . In detail: Let  > 0 with (1=) 2 IIN. Consider the time interval f1; : : :; d(1 + )C eg. De ne a new fractional solution as follows. Call fC + 1; : : :; d(1 + )C eg the - compressed image of f1; : : :; C g. Put  = 1+1  and =  dC e. Set I = f1; : : :; d(1 + )C eg; I0 = f1; : : :; C g and I1 = fC + 1; : : :; C + dC eg: So I = I0 [ I1 . The new fractional assignments xbjl are 8
0 with (1=) 2 IIN, the algorithm SCHEDULE nds for the resource constrained scheduling problem with start times a valid integral schedule of ) size at most d(1 + )C e in polynomial time, provided that m  3(1+ 2 dlog (8C ))e and ) bi  3(1+ 2 dlog (8Cs))e for all i = 1; : : :; s.

Proof: As above let N = d(1 + )C e. Consider the inequality system (IS) where A = (Ri(j ))ij , (Ri (j ))ij is the (s + 1)  n resource requirement matrix where the resource Rs+1

represents the processors with requirements 1 for all jobs and bound bs+1 = m. The assertion of the theorem is equivalent to the problem of nding a solution to (IS). PN N By Lemma 2.4 the vectors xb1 ; : : :; xbn with xbj 2 [0; 1] and k=1 xbjk = 1 form a fractional solution to the -inequality system IS(). We invoke the rounding theorem (Theorem 2.1) with sb = s + 1 and s1 = s: Since b  3(1 + ) dlog (8Cs))e  3(1 + ) dlog (4s N )e 8i = 1; : : :; s i

and

2

2

1

m = bs+1  3(1+2 ) dlog (8C ))  3(1+2 ) dlog (4N )e;

the hypothesis of Theorem 2.1) are satis ed and we can nd in deterministic polynomial time a solution to the inequality system (IS).

2

With  = 1 we get our result from [SrSt94] Corollary 2.6 If m  6dlog(8C ))e and bi  6dlog(8Cs)e for all i = 1; : : :; s, then a schedule of size at most 2C can be found in deterministic polynomial time. And with  = C1 we infer - as it will be shown in the next section - the optimal approximation. 9

Corollary 2.7 If m  3C (C + 1)dlog(8C ))e and bi  3C (C + 1)dlog(8Cs)e, for all i =

1; : : :; s, then a schedule of size at most C + 1 can be found in deterministic polynomial time. Remark 2.8 (a) Note that we have a strongly polynomial approximation algorithm, because on the one hand the optimal fractional schedule C can be computed with the strongly polynomial LP algorithm of Tardos [Ta86] ( (Rij ) is a 0/1 matrix) and on the other hand derandomized rounding is a strongly polynomial algorithm. (The running time of the LP algorithm dominates the running time of derandomization.) (b) So far we have considered 0/1 resource requirements. But all results carry over to the case of rational requirements from the closed interval [0; 1], when the resource bounds are as large as required by Theorem 2.5. This helps to handle integer resource requirements Ri (j ) with bounds bi . One can reduce the problem to fractional resource requirements by scaling: compute for every resource Ri the number Rmax (i) = maxTj 2T Ri (j ), set bi i(j ) and b0 = Ri (j )0 = RRmax i Rmax (i) . (i) (c) For scheduling of unrelated parallel machines results of similar avour have been achieved by Lenstra, Shmoys and Tardos [LST90] and Lin and Vitter [LiVi92]. Lenstra, Shmoys and Tardos [LST90] gave a 2-factor approximation algorithm for the problem of scheduling independent jobs with di erent processing times on unrelated processors and also proved that there is no -approximation algorithm for  < 1:5 , unless P = NP . Lin and Vitter [LiVi92] considered the generalized assignment problem and the problem of scheduling of unrelated parallel machines. For the generalized assignment problem with resource constraint vector b they could show for every  > 0 an 1 +  approximation of the minimum assignment cost, which if feasible within the enlarged packing constraint (2 + 1 )b.

3 Non-Approximability In this section we consider the processors as an additional resource. Under the assumption

bi = (C 2 log(Cs)) we have constructed an integral schedule of size at most C + 1. This is very close to the optimal solution, because Copt is either C or C + 1. We will show for all xed C  3 that even under the assumption bi = (C 2 log(Cs)) it is NP -complete to decide whether Copt = C + 1 or Copt = C . (For C = 2 we refer to [SrSt94])

In the remainder of this section we consider the \simpler" problem with zero start times. The following results show the NP -completeness of resource constrained scheduling under di erent conditions. In Theorem 3.1 we consider bi = 1 for all i and 0/1 resource requirements Ri(j ). Theorem 3.2 covers the case of bi = (log(Cs)) for all i and 0/1 resource requirements. In Theorem 3.3 we include the case of some Ri(j ) being fractional, i.e Ri(j ) 2 f0; 1; 12 g, and bi = (C 2 log(Cs)) for all i. Theorem 3.1 Under the assumptions that there exists a fractional schedule of size C  3 and an integral schedule of size C + 1, bi = 1 for all i = 1; : : :; s and Ri(j ) 2 f0; 1g for all i = 1; : : :; s and j = 1; : : :; n, it is NP -complete to decide whether or not there exists an integral schedule of size C . Proof: We give a reduction to the chromatic index problem which is NP -complete [Hol81]. The following is known about the chromatic index 0 (G) of a graph G. Let 10

(G) be the maximal vertex degree in G. Then by Vizing's theorem [Viz64] (G)  0 (G)  (G) + 1 and an edge coloring with (G) + 1 colors can be constructed in polynomial time. But it is NP -complete to decide whether there exists a coloring that uses (G) colors, even for cubic graphs, i.e. (G) = 3 [Hol81]. Therefore the edge coloring problem is NP -complete for any xed   3. Now to the reduction. Let G = (V; E ) be a graph with jV j =  , jE j =  and deg(v )   for all v 2 V . We construct an instance of resource constrained scheduling as follows. Introduce for every edge e 2 E exactly one job Te and consider  = jE j identical processors. Let us freely call the edges jobs and vice versa. For every node v 2 V de ne a resource Rv with bound 1 and resource/job requirements

Rv (e) =

(

1 if v 2 e 0 if v 2= e:

It is straightforward to verify that there exists a coloring that uses  colours if and only if there is a feasible integral schedule of size . Furthermore, there is a fractional schedule of size C = : Simply set xez = 1 for all z = 1; : : :; .

2

In Corollary 2.6 we assumed bi = (log(Cs)) for all i. We did not respect this condition in the reduction above. In the next two theorem it is shown how this assumption can be included. Theorem 3.2 Under the assumption that there exists a fractional schedule of size C  3 and an integral schedule of size C + 1, bi = (log(Cs)) for all for all i = 1; : : :; s, Ri(j ) 2 f0; 1g for all i = 1; : : :; s and j = 1; : : :; n, and C is xed, it is NP -complete to decide whether or not there exists an integral schedule of size C . Proof: Let G = (V; E ) be a graph with  = jV j,  = jE j and maximum vertex degree . We follow the pattern of the proof of Theorem 3.1, but instead of respresenting each edge of the graph G = (V; E ) by one job, we consider 2K  jobs where K = log . To keep the calculation simple let us assume that K is an integer (the proof carries over also to K = dlog e with minor changes of constants). For each e 2 E let us introduce 2K red jobs T1r (e); : : :; T2rK (e) and 2K ( ? 1) blue jobs T1b (e); : : :; T2bK(?1)(e): In the following we will call jobs corresponding to an edge e simply e-jobs. In total we have 2K  jobs. Considering 2K  identical processors, the processor constraint is trivially satis ed. For every node v 2 V let Rv be a resource with bound 2K and introduce for every edge e 2 E a resource Re also having bound 2K . The requirements are: every red job Tir (e) needs one unit of resource Rv , if edge e is incident with node v . All other jobs including the blue jobs Tib (e) do not need resource Rv . Every red or blue job needs one unit of its corresponding edge-resource Re . Hence in a feasible schedule of size  all jobs corresponding to an edge must be scheduled in packets of size 2K . The crucial observation is: If we can ensure that all red jobs corresponding to the same edge are scheduled at the same time, then we can de ne a scheduling time for this edge and can argue as in the 11

proof of Theorem 3.1, where we showed that it is as hard to nd a schedule of size  as to determine the existence of an edge coloring with  colors. To ensure that all red jobs corresponding to the same edge are scheduled at the same time let us introduce a new resource type: For every edge e, every red job Tir (e) and every K -element subset S of blue jobs corresponding to e, de ne a resource RTir (e);S with bound K and the following requirements: Each job from the set S [ fTir (e)g needs one unit of RTir (e);S and all the other jobs do not need any unit of the resource RTir (e);S . Observe that the number of such resources is !

2K 2K ( ? 1) :

K

We are ready to show: Claim 1: The edges of G can be colored with  colors, if and only if the above de ned scheduling problem has a schedule of length . Here is a proof. Suppose that the edges of G can be colored with  colors taken from the set Z = f1; : : :; g. For each e 2 E schedule all red jobs Tir (e) at the time corresponding to the color of e, say ze 2 Z and schedule the blue jobs Tib (e) in packets of 2K at the remaining times z 6= ze , z 2 Z . It is easily veri ed that this is a feasible schedule. Suppose we are given a schedule of length . First observe that all red jobs Tir (e) corresponding to the same edge e must be scheduled at the same time. This can be seen as follows. For every edge e we have 2K  e-jobs distributed over  scheduling times. Due to resource Re with bound 2K at every time exactly 2K jobs must be scheduled. Now assume for a moment that there is an edge e0 so that not all red e0 -jobs are scheduled at the same time. Then there exists a time z0 2 Z so that at least K blue e0 -jobs and at least one red e0 -job is scheduled at time z0 . But this leads to a violation of the bound of some resource RTir (e);S : Let S0 be an arbitrary subset of the blue e0 -jobs and let Tir (e0 ) be a red e0-job scheduled at time z0 . The requirement of resource RTir (e0 );S0 at time z0 is K + 1, but its bound is K , thus the schedule is not feasible. This proves the claim. Now we can color every edge with the (unique) scheduling time of the red jobs corresponding to the edge. Following the proof of Theorem 3.1 it is easily veri ed that this is a feasible edge coloring. Next, we show that there is a fractional schedule of size  and an integral schedule of size  + 1. Since the chromatic index of G is at most  + 1, we can de ne an integral schedule of this size as in the proof of Claim 1. Furthermore, it is easily checked that the setting xjz = 1 for all jobs Tj and times z 2 Z de nes a fractional schedule of size . Thus we may take C = . Finally, it remains to show that bi = (log(Cs)) for all i = 1; : : :; s. W.l.o.g. let us assume that 2    . The number of resources s is

s =  +  + 2K 2( ? 1)K K

 2 + 2 log 22 log  < 6; 12

!

hence Cs  7 , K 

1 7 log(Cs)

and because  is xed, bi = (log(Cs)) for all i.

2

In the next theorem we invoke fractional resource requirements. Theorem 3.3 Under the assumptions that there exist a fractional schedule of size C  3 and an integral schedule of size C + 1, bi 2 (C 2 log(Cs) for all resource bounds, C is xed and Ri (j ) 2 f0; 12 ; 1g for all i; j , it is NP -complete to decide whether or not there exists an integral schedule of size C . Proof: We reduce to the to the chromatic index problem. Let G = (V; E ) be a graph with  = jV j;  = jE j and maximum vertex degree . Put K = 152 log(). For simplicity assume that K is an integer. For every edge e 2 E we consider 2K red and 2K ( ? 1) blue jobs denoted by b T1r(e); : : :; T2rK (e) and T1b (e); : : :; T2( ?1)K (e):

Again we consider 2K  identical processors. Hence the processor constraint is trivially satis ed. Let T denote the set of all jobs, Tr the set of red jobs, Tb the set of blue job, Tr (e) the set of red jobs corresponding to an edge e, Tb (e) the set of blue jobs corresponding to an edge e and T (e) = Tr (e) [ Tb (e). Resource Rv : For every node v 2 V let Rv be a resource with bound 2K and requirements 8 r > < 1 if Tj = Tj (e) Rv (j ) = > and edge e contains node v : 0 else. Resource Re: This resource ensures that no more than 2K jobs corresponding to the same edge e can be scheduled at the same time. Its bound is 2K and the requirements are

Re(j ) =

(

1 if Tj = Tir (e) or Tj = Tib (e) 0 else.

Resource Ri;e: This resource has fractional requirements. For every red job Tir (e)

choose exactly one other red job g (Tir (e)) corresponding to e as follows. Put g (Tir (e)) = Tir+1 (e) if i < 2K and put g(T2rK (e)) = T1r (e). Let us call g(Tir(e)) the buddy of Tir (e). For every red job Tir (e) let Ri;e be a resource with bound K and requirements 8 >
:

1 if Tjr (e) = Tir (e) 1 if T 2 T (e) ? fg (T r (e))g j i 2 0 else

Claim 2: G has an edge coloring with  colors, if and only if the above de ned scheduling problem has a schedule of length . Suppose that the edges of G can be colored with  colors taken from the set Z = f1; : : :; g. For each e 2 E schedule all red jobs Tir (e) at the time corresponding to the color of e, say ze 2 Z , and schedule the blue jobs Tib (e) in packets of 2K at the remaining times z 6= ze , z 2 Z . Set xjz = 1, if job Tj is scheduled at time z , and 0 else. It is straightforward to check that this schedlue does not violate the bounds of the resources

13

Rv and Re. Now let e 2 E and Tir0 (e) 2 Tr (e) be arbitrary. Consider the resource Ri0;e . Let z 2 Z . For z = ze we have X

Tj 2T

and for z 6= ze

Ri0;e xjze = X

Tj 2T

X

Tj 2T (e)?fg(Tir0 (e))g

Ri0 ;exjz =

X

Tj 2Tb(e)

Ri0 ;exjze = 1 + 12 (2K ? 2) = K;

Ri0 ;exjz = 21 (2K ) = K;

and the rst part of the claim is proved. Suppose now that we have a feasible schedule of length . We show that it is impossible to schedule the red jobs corresponding to the same edge at di erent times. Then we can again argue as in the proof of Theorem 3.1 taking the scheduling time of the red jobs corresponding to an edge as the color of the edge. Assume for a moment that there is an edge e0 2 E and a time z0 in a schedule of size  so that I red jobs corresponding to e0 with 1  I < 2K are scheduled at time z0 . Since due to resource Re0 at every time exactly 2K e0 -jobs must be scheduled, exactly 2K ? I blue e0 -jobs must be scheduled at time z0 . Since there are strictly less than 2K red e0 -jobs scheduled at time z0 , there is a (red) job Tir0 (e0) scheduled at time z0 , but whose buddy is not scheduled at time z0 . Then the requirement for resource Ri0;e0 at time z0 is X

Tj 2T

Ri0 ;e0 (j )xjz0 =

X

Tj 2T (e0 )

Ri0;e0 (j )xjz0

= 1 + 12 ((2K ? I ) + (I ? 1)) = K + 12 > K;

and the schedule requires more than K units of resource Ri0;e0 in contradiction to the feasibility assumption. Hence all red jobs corresponding to an edge must be scheduled at the same time. Finally, one may check as in the proof of Theorem 3.2 that there is a fractional schedule of size  and an integral schedule of size  + 1. Thus we can set C = . We show bi 2 (C 2 log(Cs)) for all resource bounds. We have introduced n = 2K jobs and s =  +  + 2K resources. W.l.o.g. assume that 2    . With K = 152 log() we have s  164 , thus Cs  165 which implies C 2 log(Cs)  9C 2 log   K , thus bi 2 (C 2 log(Cs)) for all i = 1; : : :; s.

2

4 Multidimensional Bin Packing

Consider the general multidimensional bin packing problem BIN (~l; d) as de ned in the introduction. Since BIN (~l; d) is nothing else than the resource constrained scheduling problem with as many processors as jobs, d resources with 0/1 requirements, resource bounds bi = li for all i = 1; : : :; d and zero start times, all the approximation and nonapproximability results proved for scheduling are valid for BIN (~l; d). Theorem 2.5 implies 14

Corollary 4.1 Let  > 0 with (1=) 2 IIN. If l 

3(1+) dlog (8nd)e, 2

then we can nd in

O(n3 d log(nd)) time a bin packing with L bins such that L  d(1 + )Lopt e.

Let us brie y compare this with previous approximation guarantees. The First-Fit heuristic gives a 2-factor approximation for BIN (1; 1), and using this result one can construct a solution for BIN (1; d) within 2dLopt in polynomial time [VeLu81]. A similar argumentation shows a (1 + 1l )d factor approximation for BIN (~l; d), when li = l for all i = 1; : : :; d. Thus, good approximations must beat these factors. The results of Garey, Graham, Johnson and Yao [GaJo79] for resource constrained scheduling (which we have already discussed in the introduction) applied to bin packing show the existence of an integer L0 such that LFFD  (d + 31 )Lopt for all instances with Lopt  L0 . de la Vega and Lueker [VeLu81] gave for every 0 <  < 1 a linear time algorithm A with asymptotic approximation guarantee LA  (d + )Lopt.

5 Parallel Scheduling and Bin Packing In this section we consider s +1 resources R1; : : :; Rs+1 where resource Rs+1 represents the processors. There is no obvious way to achieve the approximation guarantee of Theorem 2.5 in NC . In this section we will show that at least in some special cases there is an NC approximation algorithm. The algorithm is based on the method of logc n-wise independence. The important steps are: 1. Fractional Scheduling in Parallel. We wish to apply randomized rounding using logc (n)-wise independence and therefore rst have to generate an appropriate probability distribution in NC . Sequentially this is easy: solve the linear programming relaxation of the integer programming formulation of our scheduling problem and the fractional assignments of jobs to times will de ne the right distribution. Unfortunately, linear programming is P -complete ! But fortunately, due to the fact that the start times are zero, we have (as for the bin packing problem) a formula for the optimal fractional schedule. n o 2. Schedule Enlargement. De ne C 0 = max1is+1 b1i Pnj=1 Ri(j ) and C = dC 0e. Observe that C is the length of an optimal fractional schedule. In the sequential framework we de ned for > 1 the enlarged schedule length d by d = d C e. Here, in the parallel setting, d must be a power of a prime. This is, as we shall see, required by the analysis of the method of k-wise independence, in particular we need GF (d) to be a eld. Thus we de ne for every > 1 d = 2dlog( C )e; (10) hence d  2 C . The fractional assignments of jobs to times are xejz = 1=d for all j = 1; : : :; n, z = 1; : : :; d. Note that this assignment de nes a valid fractional schedule, even with tighter resource bound n X Ri(j )xejz  bi = (11) j =1

for all i = 1; : : :; s + 1, z = 1; : : :; d. 3. Rounding in NC is performed with the parallel conditional probability method for multivalued random variables (Theorem 6.2). First, C can be computed in parallel with standard methods. 15

Lemma 5.1 The size C of an optimal fractional schedule can be computed with O(ns) EREW ? PRAM -processors in O(log(ns)) time. The main result of this section is Theorem 5.2 Let > 1,   log1 n and suppose that bi  ( ? 1)?1n 12 + plog 3n(s + 1) 1 for all i = 1; : : :; s +1. Then there is an NC -algorithms that runs on O(n(ns)  +1 ) parallel processors and nds in O(( log(ns) )4 )) time a schedule of size at most 2dlog( C )e  2 C . De ne k-wise independent, uniformly distributed random variables X1; : : :; Xn with values in f1; : : :; dg, 5 and functions fiz (i = 1; : : :; s + 1, z = 1; : : :; d) and F as in Theorem 6.2. n(s+1) e. Then Lemma 5.3 Let k = d log3log n

IE

X

iz

jfiz (X1; : : :; Xn

)jk

!

1=k

 n 12 + dlog 3n(s + 1)e1=2:

Proof: Using an analog of the Cherno bound due to Alon and Spencer (Corollary A7, [ASE92]) we can show exactly as in Berger/Rompel [BeRo91], proof of Corollary 2.6, IE

X

iz

jfiz (X1; : : :; Xn

)jk

!

 2(k=2)!(n=2)k=2:

(12)

Robbins exact Stirling formula shows the existence of a constant n with 12n1+1  n  121n p p so that np! = (n=e)n 2ne n ([Bol85], page 4), thus n!  3(n=e)n n. Furthermore, for all k  2, 2 k(4e)?k=2  1. With this bounds the right hand side of inequality (12) becomes 3(k=n)1=2. The claimed bound now follows by summing over all i = 1 : : :; s +1, z = 1 : : :; d and taking the (1=k)-th root.

2

Proof of Theorem 5.2: Put s0 = s + 1, k = d log log3nsn0 e and let d be as de ned in (10), so d  2 C  2 n. Thus for xed we have dk = O(nk ) (we are not interested in large values of ). In the notation of Theorem 6.2, nb = s0 nk+1 . By Theorem 6.2 we can construct integers xb1 ; : : :; xbn , where xbj 2 f1; : : :; dg for all j such that

F (xb1 ; : : :; xbn )  IE(F (X1; : : :; Xn)) holds, using

(13)

O(max(dk ; nb)) = O(nk+1 s0) = O(n(ns) 1 +1 )

parallel processors in

O(k4 log4 n + k2 log n log d + k log n log s0) = O(( log(ns) )4)

time. To complete the proof we must show that the vector (xb1; : : :; xbn ) de nes a valid schedule. This is seen as follows. By de nition of the function F we have for all resources 5 In Theorem 6.2 we used a slightly

But this is only a convention.

di erent notation: the Xj 's take on values in the set f0; : : : ; d ? 1g:

16

Ri and z = 1; : : :; d X

n

j =1



Ri(j )(xjz ? 1d )  (F (x1; : : :; xn)) k1  (IE(F (X1; : : :; Xn)) k1

 n 12 + dlog 3ns0e1=2:

(14)

(the last inequality follows from Lemma 5.3). Hence, using (14), (11) and the assumption on the bi 's, we get for all resources Ri and all times z = 1; : : :; d n

X

j =1

Ri(j )xjz 

 

X

n



n X 1 Ri (j )(xjz ? d ) + Ri (j ) d1

j =1 j =1 1 + n 2 dlog 3ns0 e1=2 + bi= (1 ? 1= )bi + bi= = bi ;

and the theorem is proved.

2

For multidimensional bin packing Theorem 5.2 implies a 2 -factor approximation algorithm in NC . Remark 5.4 The reason why we have to assume bi = (n 21 + plog ns) is due to the estimation of the k-th moments. Improvements of this method with the goal to show a 2 -factor (or even better) NC -algorithm under the weaker assumption bi = (log ns) would be interesting. This would match the (presently) best sequential approximation guarantees.

Acknowledgement

The rst author thanks Professor Laszlo Lovasz for helpful discussions during a research stay at Yale University in Spring 1994, where a part of this paper has been written. We would also like to thank Andreas Kramer for helpful discussions. Last not least we thank two anonymous referees for their constructive critics and suggestions which helped to improve the paper.

References [ABI86] N.Alon, L Babai, A. Itai; A fast and simple randomized algorithm for the maximal independent set problem. J. Algo., 7 (1987), 567 - 583. [ASE92] N. Alon, J. Spencer, P. Erd}os; The probabilistic method. John Wiley & Sons, Inc. 1992. [AnVa79] D. Angluin, L.G. Valiant: Fast probabilistic algorithms for Hamiltonion circuits and matchings. J. Comp. Sys. Sci., Vol. 18, (1979), 155{193. [BeRo91] B. Berger, J. Rompel; Simulating (log cn)-wise independence in NC. JACM, 38 (4), (1991), 1026 { 1046. 17

[BESW93] J. Blazewicz, K. Ecker, G. Schmidt, J. Weglarz; Scheduling in computer and maufacturing systems. Springer-Verlag, Berlin (1993). [Bol85] B. Bollobas; Random Graphs. Academic Press, Orlando (1985). [GGJY76] M. R. Garey, R. L. Graham, D. S. Johnson, A.C.-C. Yao; Resource constrained scheduling as generalized bin packing. JCT Ser. A, 21 (1976), 257 - 298. [GaJo79] M. R. Garey, D. S. Johnson; Computers and Intractability. W. H. Freeman and Company, New York (1979). [GLS88] M. Grotschel, L. Lovasz, A. Schrijver; Geometric algorithms and combinatorial optimization. Springer-Verlag (1988). [Hol81] I. Holyer; The NP -completeness of edge coloring. SIAM J.Comp., 10 (4), (1981), 718 - 720. [Kr75] K. L. Krause, V. Y. Shen, H .D. Schwetmann; Analysis of several job-scheduling algorithms for a model of multiprogramming computer systems. JACM 22 (1975) 522{ 550. Erratum: JACM 24, (1977), p. 527. [LST90] J. K. Lenstra, D. B. Shmoys, E. Tardos; Approximating algorithms for scheduling unrelated parallel machines. Math. Programming, 46, (1990), 259 { 271. [LiVi92] J.-H. Lin, J. S. Vitter; -approximations with minimum packing constraint violation. Proceedings 24th Annual ACM Symposium on the Theory of Computation (1992), Victoria, B.C., Canada, 771 - 782. [Li82] J. H. van Lint; Introduction to Coding Theory. Springer Verlag New York, Heidelberg, Berlin (1982). [McSo77] F.J. MacWilliams, N.J.A. Sloane; The theory of error correcting codes. North Holland, Amsterdam, (1977). [McD89] C. McDiarmid; On the method of bounded di erences. Surveys in Combinatorics, 1989. J. Siemons, Ed.: London Math. Soc. Lectures Notes, Series 141, Cambridge University Press, Cambridge, England 1989. [MNN89] R. Motwani, J. Naor, M. Naor; The probabilistic method yields deterministic parallel algorithms. Proceedings 30the IEEE Conference on Foundation of Computer Science (FOCS'89), (1989), 8 { 13. [Ra88] P. Raghavan; Probabilistic construction of deterministic algorithms: approximating packing integer programs. J. Comp. Sys. Sci., 37, (1988), 130-143. [RT87] P. Raghavan, C. D. Thompson; Randomized rounding: a technique for provably good algorithms and algorithmic proofs. Combinatorica 7 (4), (1987), 365-374. [RS83] H. Rock, G. Schmidt; Machine aggregation heuristics in shop scheduling. Math. Oper. Res. 45(1983) 303{314. [Sp87] J. Spencer; Ten lectures on the probabilistic method. SIAM, Philadelphia (1987). 18

[SrSt94] A. Srivastav, P. Stangier; Algorithmic Cherno -Hoe ding inequalties in integer programming. Random Structures & Algorithms, Vol. 8, No. 1, (1996), 27 { 58. (preliminary version in: Du, Zhang (eds.), Proccedings of the 5th Annual Inernational Symposium on Algorithms and Computation (ISAAC'94), pages 264 - 234, Lecture Notes in Computer Science, Vol 834, Springer Verlag.) [Sriv95] A. Srivastav; Derandomized algorithms in combinatorial optimization. Habilitation thesis, Insitut fur Informatik, Freie Universitat Berlin, (1995), 180 pages. [Ta86] E. Tardos; A strongly polynomial algorithm to solve combinatorial linear programs. Oper. Res. 34 (1986), 250 - 256. [VeLu81] W. F. de la Vega, C. S. Lueker; Bin packing can be solved within 1 +  in linear time. Combinatorica, 1 (1981), 349 - 355. [Viz64] V. G. Vizing; On an estimate of the chromatic class of a p-graph. (Russian), Diskret. Analiz. 3 (1964), 25 - 30.

6 Appendix: Multivalued Random Variables and logc n-wise Independence Derandomization for logc n-wise independent multivalued random variables has already been discussed by Berger and Rompel [BeRo91]. Here we brie y point out how their framework can0 be applied to our problem and x the work and time bounds. 0 n 0 n Let n = 2 ? 1 for some n 2 IIN. A representation of GF (2 ) as a n0 -dimensional algebra over GF (2) can be explicitly constructed using irreducible polynomials, for example the polynomials given in [Li82], Theorem 1.1.28. Let b1; : : :; bn be the n non-zero elements 0 n of GF (2 ) in such an irreducible representation and let B = (bij ) the following n  d k?2 1 e matrix over GF (2n0 ) 3 2 1 b1 b31    b1k?1 6 b32 b2k?1 777 6 1 b2 6 3 b3k?1 77 : B = 66 1 b3 b3 .. .. .. .. 75 6 . 4 .. . . . . 1 bn b3n bnk?1

B can be viewed as a n  ` matrix over GF (2) with ` = 1+ d k?2 1 edlog(n +1)e = O(k log n). The matrix B is the well-known parity check matrix of binary BCH codes. Note that any k row vectors of B are linearly independent over GF (2) [McSo77]. Alon, Itai and Babai [ABI86] showed that k-wise independent 0/1 random variables can be constructed

from mutually independent 0/1 random variables using a BCH-matrix. The extension to multivalued random variables goes as follows. Let Y1 ; : : :; Y` be independent and uniformly distributed random variables with values in = f0; : : :; d ? 1g, d 2 IIN. Let Y be the vector Y = (Y1 ; : : :; Y` ) and de ne valued random variables X1; : : :; Xn by Xi = (BY )i mod d for all i = 1; : : :; n. With X = (X1; : : :; Xn) we can brie y write X = BY mod d. The following lemma follows 19

from the extension of Theorem 2.8 in [BeRo91] to multivalued random variables (see section 4.2 of [BeRo91]). Lemma 6.1 The random variables X1; : : :; Xn are k-wise independent and uniformly distributed. We consider the following class of functions F , arising in the analysis of resource constrained scheduling, for which an NC algorithm constructing vectors with F -value less than (resp. greater than) the expected value IE(F (X1 ; : : :; Xn )) can be derived. Let k; d be as above. Note that we assume k to be an even integer and d to be a power of some prime number, say a power of 2. This is necessary, since we shall need the fact that GF (d) is a eld. (In section 5 we have speci ed d in (10).) Let (Rij ) be the resource constraint matrix where we consider the processors as a resource, so (Rij ) is a (s + 1)  nmatrix. To simplify the notation put s0 = s + 1. For integers xj ; z 2 f1; : : :; d ? 1g let xjz be the indicator function which is 1 if xj = z and 0 otherwise. For i = 1; : : :; s0, z 2

and integers xj 2 , j = 1; : : :; n, de ne the functions fiz by

fiz (x1; : : :; xn) =

n

Rij (xjz ? d1 );

(15)

jfiz (x1; : : :; xn)jk :

(16)

X

j =1

and set

F (x1; : : :; xn) =

X

iz

Theorem 6.2 Put n = nk+1s0. Let X1; : : :; Xn be k-wise independent random variables with values in = f0; : : :; d ? 1g de ned as in Theorem 6.1 and let F be as in (16). Then with O(max(dk ; nk+1 s0 )) parallel processors we can construct integers x01 ; : : :; x0n 2 and x1 : : :; xn 2 in O(k4 log4 n + k2 log n log d + k log n log s0) time such that (i) F (x01 ; : : :; x0n )  IE(F (X1 ; : : :; Xn)) (ii) F (x1 ; : : :; xn )  IE(F (X1 ; : : :; Xn)): Proof: It suces to prove (i). Let I be the set of all k tuples ( 1; : : :; k) with j 2 f1; : : :; ng. For i = 1; : : :; s0, z 2 and integers xj 2 , j = 1; : : :; n de ne functions gj(iz) b

b

b

b

by

b

gj(iz) (x1 ; : : :; xn) = Rij (xjz ? d1 );

and de ne for a k-tupel 2 I; the product function g (iz) by

g (iz)(x1 ; : : :; xn) =

k

Y

j =1

g (izj ) (x1; : : :; xn):

Then

F (x1 ; : : :; xn) =

XX

iz 2I

20

g (iz)(x1; : : :; xn):

Note that this sum has at most nb terms. The random variables X1; : : :; Xn by de nition have the form Xj = (BY )j mod d. Therefore we may restrict us to the computation of values for the Yi 's. The conditional probability method goes as follows: Suppose that for some 1  t  ` we have computed the values Y1 = y1 ; : : :; Yt?1 = yt?1 where yj 2 ; j = 1; : : :; t ? 1. Then choose for Yt the value yt 2 that maximizes the function

w ! IE(F (X1; : : :; Xn) j y1 ; : : :; yt?1 ; Yt = w):

(17)

After ` steps this procedure terminates and the output is a vector y = (y1 ; : : :; y` ) with yj 2

, (j = 1; : : :; `). Then the vector ~x0 = (x01 ; : : :; x0n) with components x0j = (By )j mod d is the desired solution. For 1  t  ` it will be convevient to use the notation: put Y~t := (Y1; : : :; Yt), ~yt := (y1 ; : : :; yt) and Y~t := (Yt+1 ; : : :; Y` ), ~yt := (yt+1 ; : : :; y`). We are done, if we can compute the conditional expectations IE(F (X1; : : :; Xn) j Y~t = ~yt ) within the claimed time and work bounds. By linearity of expectation, it is sucient to compute for each tripel (i; z; ), 1  i  s0, z 2 , 2 I the conditional expectations IE(g (iz) (X1; : : :; Xn ) jY~t = ~yt ):

(18)

Let Ab be the k  ` matrix whose rows are the rows of B with row-indices 1; : : :; k . Let Ab1 resp. Ab2 be the rst t resp. last ` ? t columns of Ab. Then IE(g (iz) (X1; : : :; Xn ) jY~t = ~yt ) =

X

x2 k

g (iz) (x) Pr[AbY~ = x jY~t = ~yt ]:

(19)

And for every xed x 2 k Pr[AbY~ = x jY~t = ~yt ] = Pr[ Ab2Y~t = x ? Ab1~yt ] ( 2?rank(Ab2 ) if Ab2 Y~t = x ? Ab1~yt = 0 otherwise: (The last equality follows from [BeRo91], section 3.1 and 4.2). Now we are able to estimate the running time and work space. For every 2 I we can compute rank(Ab2 ) (in GF (d)) in O(`3 ) time. For every x 2 k the solvability of the linear system Ab2 Y~t = x ? Ab1~yt can be tested in O(`3) time. Since we have dk vectors x, we can compute IE(g (iz)) for every 1  t  `, 1  i  s0 and 0  z  d ? 1 with dk parallel processors in O(`3 + log(dk )) = O(`3 + k log d) time. Then we compute for every yt , 1  t  `, the expectation IE(F (X1 ; : : :; Xn ) j Y~t = ~yt ) in O(log nb ) time using O(nb ) parallel processors. Finally, that yt 2 which maximizes (17) can be computed nding the maximum of the d conditional expectations in O(log d) time with O(d) processors. The maximum number of processors used is O(max(dk ; nb )) = O(max(dk ; nk+1 s0 )) and the total running time over all ` steps is

O(`(`3 + k log d + log nb + log d)) = O(k4 log4 n + k2 log n log d + k log n log s0 ):

2

21