Parallel complexity of computing a maximal set of disjoint paths

3
Information Processing Letters 41 (1992) 149-151 North-Holland 6 March 1992 Parallel complexity of computing a maximal set of disjoint paths Alok Aggarwal IBM Research Division, Thomas J. Watson Research Center, P.O. Box 218, Yorktown Heights, NY 10598, USA Communicated by M.J. Atallah Received 10 June 1991 Revised 25 November 1991 Abstract Aggatwal, A., Parallel complexity of computing a maximal set of disjoint paths, Information Processing Letters 41 (1992) 149-1.51. Given a graph, G = (V, El, and sets S c V and Q c V, the maximal paths problem requires the computation of a maximal set of vertex disjoint paths in G that begin at vertices of S and end at vertices of Q. It is well known that this problem can be solved sequentially in time that is proportional to the number of edges in G. However, its parallel complexity is not known. This note shows that this problem is NC-reducible to that of computing a depth-first search forest in a suitable n-vertex graph. This result can also be extended to directed graphs. Keywords: Computational complexity, maximal paths, depth-first search, NC, polylogarithmic time, parallel complexity, directed graphs, PRAMS, undirected graphs 1. Introduction Given an n-node undirected graph, G= (V, E), and two sets S c V and Q c V, the maxi- mal paths problem requires the computation of a maximal set of vertex disjoint paths in G such that one of the end-points of each path is a vertex in S and the other is a vertex in Q; furthermore, the remaining path does not contain any vertices of S or of Q. It is fairly easy to show that this problem can be solved sequentially in time that is proportional to the number of edges in G. How- ever, its parallel complexity is not known. Aggar- wal and Anderson [ll have shown that this prob- lem belongs to the class RNC, i.e., this problem can be solved by using a randomized algorithm that uses polynomial number of processors and solves it in polylogarithmic time. (In fact, they show that this problem can be solved by solving an instance of the network flow problem where all edges have an integral capacity of at most one; see [l] for details.) In a subsequent paper, Gold- berg, Plotkin and Vaidya [3] showed that a maxi- mal set of disjoint paths for a graph with n nodes and e edges can be computed in O(6 x log”n1 time by using a Concurrent Read Exclusive Write (CREW) PRAM with n2 processors. It remains unresolved whether a maximal set of disjoint paths can be computed deterministically in polyloga- rithmic time by using a polynomial number of processors. For directed graphs also the maximal paths problem belongs to the class RNC [2]. This note shows that this problem is NC-re- ducible to that of computing a depth-first search forest in G. More precisely, we show that if we are given any n-vertex graph G’= (V’, E’), a vertex x E I/‘, and if we can compute a depth-first search forest of G’ with x as its root, on a CREW PRAM with P processors in T time, then we can compute a maximal set of vertex disjoint 0020-0190/92/$05.00 0 1992 - Elsevier Science Publishers B.V. All rights reserved 149

Transcript of Parallel complexity of computing a maximal set of disjoint paths

Page 1: Parallel complexity of computing a maximal set of disjoint paths

Information Processing Letters 41 (1992) 149-151

North-Holland 6 March 1992

Parallel complexity of computing a maximal set of disjoint paths Alok Aggarwal IBM Research Division, Thomas J. Watson Research Center, P.O. Box 218, Yorktown Heights, NY 10598, USA

Communicated by M.J. Atallah

Received 10 June 1991

Revised 25 November 1991

Abstract

Aggatwal, A., Parallel complexity of computing a maximal set of disjoint paths, Information Processing Letters 41 (1992)

149-1.51.

Given a graph, G = (V, El, and sets S c V and Q c V, the maximal paths problem requires the computation of a maximal

set of vertex disjoint paths in G that begin at vertices of S and end at vertices of Q. It is well known that this problem can be

solved sequentially in time that is proportional to the number of edges in G. However, its parallel complexity is not known. This note shows that this problem is NC-reducible to that of computing a depth-first search forest in a suitable n-vertex

graph. This result can also be extended to directed graphs.

Keywords: Computational complexity, maximal paths, depth-first search, NC, polylogarithmic time, parallel complexity,

directed graphs, PRAMS, undirected graphs

1. Introduction

Given an n-node undirected graph, G= (V, E), and two sets S c V and Q c V, the maxi- mal paths problem requires the computation of a maximal set of vertex disjoint paths in G such that one of the end-points of each path is a vertex in S and the other is a vertex in Q; furthermore, the remaining path does not contain any vertices of S or of Q. It is fairly easy to show that this problem can be solved sequentially in time that is proportional to the number of edges in G. How- ever, its parallel complexity is not known. Aggar- wal and Anderson [ll have shown that this prob- lem belongs to the class RNC, i.e., this problem can be solved by using a randomized algorithm that uses polynomial number of processors and solves it in polylogarithmic time. (In fact, they show that this problem can be solved by solving an instance of the network flow problem where

all edges have an integral capacity of at most one; see [l] for details.) In a subsequent paper, Gold- berg, Plotkin and Vaidya [3] showed that a maxi- mal set of disjoint paths for a graph with n nodes and e edges can be computed in O(6 x log”n1 time by using a Concurrent Read Exclusive Write (CREW) PRAM with n2 processors. It remains unresolved whether a maximal set of disjoint paths can be computed deterministically in polyloga- rithmic time by using a polynomial number of processors. For directed graphs also the maximal paths problem belongs to the class RNC [2].

This note shows that this problem is NC-re- ducible to that of computing a depth-first search forest in G. More precisely, we show that if we are given any n-vertex graph G’= (V’, E’), a vertex x E I/‘, and if we can compute a depth-first search forest of G’ with x as its root, on a CREW PRAM with P processors in T time, then we can compute a maximal set of vertex disjoint

0020-0190/92/$05.00 0 1992 - Elsevier Science Publishers B.V. All rights reserved 149

Page 2: Parallel complexity of computing a maximal set of disjoint paths

Volume 41, Number 3 INFORMATION PROCESSING LETTERS 6 March 1992

paths in G, from S to Q, on a CREW PRAM PRAM, where e denotes the number of edges in with P + e processors and G.

O( T log n + log%)

time; it is assumed throughout that e > n. This result can be easily extended to directed graphs; this extension is omitted for the sake of brevity.

Although the maximal path problem is inter- esting on its own, motivation for understanding its parallel complexity also arises from the work of [ll and [2]. These papers reduce the problem of computing depth-first search forests in di- rected and undirected graphs to that of comput- ing a maximal set of vertex disjoint paths in other graphs. (In fact, they require a maximal set of vertex disjoint paths with the minimal weight in a graph that has integral weights on its edges be- tween 1 and n.1

2. An algorithm for computing a maximal set of vertex disjoint paths

Step 1: Let S = {si, s2, . . . , s,}, and Q =

{4,, q2, *. . > qJ. Let G’ denote the graph that is obtained by removing the vertices of S, and let

G,, Gz,..., G,,, denote the connected compo- nents of G’ where each component contains at least one vertex of Q and each component is adjacent to at least one vertex of S. Let D denote the set of vertices that results after removing the vertices of S, G,, G,, . . . , G, from G. We call the vertices of D, dead vertices, since these vertices cannot belong to any path in any maximal set of disjoint paths.

Step 2: Form a bipartite graph such that one set of its vertices is simply the vertices of S and the other set contains one vertex for each G,. Denote the vertex corresponding to Gj by vi, and put an edge (si, vi) if si is adjacent to some vertex in Gi; observe that the edges in the new bipartite graph are no more than that in G. Now, compute a maximal matching in this bipartite graph. From [4], observe that this computation for all G,‘s takes e processors and 0(log4n) time on a CREW

Step 3: For 1 < i G m, let j denote the index such that vi was matched to sj in step 2. In parallel, for 1 < i G m, compute a depth-first search tree of Gj U (sj) where the root of the tree in sj. (If some uj is not matched to any si then do nothing for GJ Observe that this computation can be performed for all graphs in parallel in T time with a P-processor CREW PRAM. Call this depth-first search tree of Gj, Hi. Let Hj have ylj vertices. Observe that this tree has a separating path, y:., that begins at sj, i.e., one of the end- points of Y; is sj and the removal of the vertices of y. from Gj U {sj) results in a graph with con- nected components having no more than [n,/2] vertices, each. Furthermore, observe that by ma- nipulating the vertices and edges of Hi, Yj can be computed in O(log n> time on a CREW PRAM with yli processors. (This can be done, for exam- ple, by assigning a processor to each vertex of Hi, then computing all the vertices whose subtrees have at least [n/2] vertices, and finally, by using list ranking to compute the path q.) Let the separating path y. = {sj, y,, y2,. . . , y,}, where

Yl, Y *, . . _, y, occur in increasing order of dis- tance from sj. Let y, denote the farthest vertex from sj such that the subtree in Hj that has ym as its root, has at least one vertex of Q. Let t, denote the vertex of Q that is nearest to y, in this subtree. Compute the path from y, to t, in this subtree, call this path, y’. Observe that this computation takes O(Iog n) time by using ylj pro- cessors on a CREW PRAM. Remove the path X.” = {Sj, yi,. . .) y,} u (yi’), add this path to the set of disjoint paths, and delete the nodes in Y#” from G, u {s,}. Furthermore, delete all the ver- tices that belong to the subtree with root y, + 1 in H,, from Gj, and add these nodes to the set of dead vertices, D; observe that this subtree does not contain any vertices of Q, and therefore, its vertices can no longer belong to any maximal path.

Step 4: Let G* denote the graph that is obtained after removing the vertices of all paths (that were obtained in step 3) and after removing the dead

150

Page 3: Parallel complexity of computing a maximal set of disjoint paths

Volume 41, Number 3 INFORMATION PROCESSING LETTERS 6 March 1992

vertices, i.e., the vertices of D. If G* is not empty, go to step 1.

end;

Theorem. If a depth-first search forest for any graph with n certices and e edges can be found in T time with P processors on a CREW PRAM, then a maximal set of disjoint paths from S to Q in G can be found in

O(T log n + log5n)

time using a CREW PRAM with P + e processors.

Proof. The proof of correctness of the above algorithm is easy and omitted. For estimating the time complexity, observe that step 1 takes O(log*n) time if e processors are used. Since a maximal matching is being computed in step 2, this step takes O(log4n) time if e processors are used [4]. Step 4 requires constant time, and step 3 requires O(T + log n> time if P + e processors are used. Consequently, an execution of steps 1 through 4 requires

O(T log n + log4n)

time. Now, since either the number of vertices in each connected component matched in step 2 is halved or the component is deleted after the execution of steps 1 through 4, these steps will be repeated at most log n times. (This is so because if a connected component did not get matched then all the sources, s,, that were adjacent to a vertex of this component were matched during the execution of step 2; hence this connected component can be deleted.) Consequently, the entire algorithm takes

O(T log n + log5n)

when P + e processors are used. 0

Remark. Observe that in the above algorithm, one need not compute the depth-first search trees for log n iterations. Indeed, after removing the nodes in the subtree with root y, +, and those in the path q”, from Hi, we are left with subtrees that are depth-first search trees. Consequently, in

the next iteration, we only need to change the roots of these depth-first search trees (to the appropriate source nodes), and the re-rooting can be done in O(log2n) time by using n3 processors [5]. Consequently, for undirected graphs, the maximal paths problem can also be solved in O(T + log5n) time if P + n” processors are used.

3. Conclusion

We showed that the maximal paths problem is NC-reducible to the depth-first search problem. The papers [l] and [2], showed that the depth-first search problem is NC-reducible to that of finding a maximal set of paths with minimal weight. These papers also showed that a maximal set of paths with minimal weight can be found in randomized polylogarithmic time by using a polynomial num- ber of processors. It remains unresolved whether the depth-first search problem is NC-reducible to the maximal paths problem. Also, it remains un- resolved whether the maximal paths problem is in the class NC.

Acknowledgment

The author thanks S. Rao Kosaraju and two anonymous referees for improving the readability of this paper.

References

[I] A. Aggarwal and R. Anderson, A random NC algorithm

for depth first search, Combinatorics 8 (1988) 1-12.

[2] A. Aggarwal, R. Anderson and M.Y. Kao, Parallel depth-

first search in general directed graphs, SIAM .I. Comput.

19 (2) (1990) 397-409.

(31 A. Goldberg, S. Plotkin and P. Vaidya, Sublinear-time

parallel algorithms for matching and related problems, in: Proc. 29th Ann. IEEE Symp. on the Foundations of Com-

puter Science (IEEE Computer Society, Washington, DC, 1988) 174-185.

[4] A. Israeli and Y. Schiloach, An improved algorithm for maximal matching, Inform. Process. Lett. 22 (1986) 77-X0.

[5] P. Tiwari, An efficient parallel algorithm for shifting the root of a depth first search tree, J. Algorithms 7 (1986)

105-l 19.

151