MIN-MAX OBJECTIVE FUNCTION ... work of all three authors was supported by the Center for Telecommunications .... We call such a path P an optimal path.
Discrete
Applied
Mathematics
26 (1990) 105-l 15
105
North-Holland
THE COMPLEXITY OF FINDING TWO DISJOINT MIN-MAX OBJECTIVE FUNCTION Chung-Lun
LI, S. Thomas
MCCORMICK
and David
PATHS WITH
SIMCHI-LEVI*
Department of Industrial Engineering and Operations Research, Columbia University, New York, NY 10027, USA Received
15 December
Revised
16 November
Given a network disjoint
paths
complete.
G = (V, E) and two vertices s and t, we consider
from s to
several variants: or undirected.
1987 1988 the problem
t such that the length of the longer path is minimized.
The paths may be vertex-disjoint We show that all four versions
or arc-disjoint
and the network
as well as some related
We also give a pseudo-polynomial-time
algorithm
problems
for the acyclic
of finding
two
The problem
has
may be directed are strongly
directed
NP-
case.
1. Introduction Let G = (V, E) be a network with source s and sink t, and a nonnegative integral length iij for each edge i-j E E. The length I(P) of a path P is defined as the sum of the lengths of its edges. Two paths are said to be edge-disjoint if they have no edges in common; they are said to be vertex-disjoint if they have no vertices in common except at the terminals. In this paper, we consider the problem of finding two (or more) disjoint paths from s to t such that the maximum of their lengths is minimized. We call this the min-max 2 (or p) path problem. The problem has four versions depending on whether G is a directed or undirected graph and whether the paths are required to be vertex-disjoint or edge-disjoint. The complexity of the edge-disjoint and vertexdisjoint versions on an undirected network was mentioned in [6] as “an interesting open question”. Such problems arise in routing “noninterfering” messages through communications networks. See [6] for a discussion of applications. In Section 2, we prove that the undirected problems from [6] as well as the directed versions are strongly NP-complete (see Garey and Johnson [3] for a background on NP-completeness). In Section 3, we describe a pseudo-polynomial algorithm for the acyclic directed case. This algorithm can be generalized to a pseudo-polynomial algorithm for fin-
* The work of all three authors NSF Grant CDR 84-21402.
0166-218X/90/$3.50
0
was supported
1990, Elsevier
Science
by the Center
Publishers
for Telecommunications
B.V. (North-Holland)
Research
under
106
C.-L. Li et al.
ding p pairwise fixed. An analysis
disjoint
s- t paths
of some related
in an acyclic
problems
directed
is given in Section
network
where p>2
is
4.
2. NP-completeness In this section, we use the Maximum 2-Satisfiability Problem [3] (Max 2-Sat) to show that all the four versions of the problem are NP-complete. An instance of Max 2-Sat has variables x1,x2, . . . ,x,, with each variable xi giving rise to literals xi, pi. It also has clauses Ci, C2, . . . , C,, each a 2-subset of literals. A truth assignment is a function T : {xi} + {true, false). We say that Cj is satisfied under r if Cj contains a literal Xi with r(xi) = true, or a literal Xi with r(Xi) = false. Finally, the instance has a bound K in G with total vertical arc length = It and total horizontal arc length = 12. Our objective is to obtain an (s,s) + (t, t) path P in G such that max{total
horizontal
arc length
of P, total vertical
arc length
is minimized. We call such a path P an optimal path. We now describe a “scanning and labeling” algorithm that keeps label at each vertex. In the algorithm, we use labels of the form (x,-v, x and y are, respectively, the total vertical and horizontal distances the current vertex through a certain path, (p, q) is the previous vertex path
from
(s,s),
and i is the position
of the previous
of P>
more than one (p, q)i), where from (s,s) to on the labeled
label at vertex
(p,q).
Algorithm for finding an optimal path P in t?. Label (s, s) with (0,0, - ); forp=s,,...,tl do for q=s2,...,t2 do {scan vertex (p, q)} for each vertex u adjacent to (p,q) do for each label (x,~, *) at vertex (p,q) do add label (x+ 6,y, (p, q)i) to u if (p, q) -+ u is a vertical arc; add label (x,y + S, (p, q) i) to u if (p, q) + u is a horizontal arc;
Complexity
(where 6 = arc length
of two min-max
paths
111
of (p, q) + U,
and i = position of the label (x,y, *) at vertex (p, q) -+ u); delete any “redundant labels” at u (see definition below); if (t, t) has no label then STOP, no path P exists in G; else select a label (x,y, *) at (t, t) such that max{x, y} is minimized; back to obtain optimal path P.
trace
We define a label (x, y, *) at vertex u to be redundant if there exists another label (x’, y’, *‘) at vertex u such that x2x’ and yry’. Note that G is also acyclic and the algorithm scans the vertices of G in an acyclic order, so there are no “backward arcs”. Hence our algorithm actually enumerates all possible paths from 0,s) to paths” which corres(p, q) when it reaches vertex (p, q), except those “redundant pond to redundant labels. Therefore, the path P obtained by the algorithm is an optimal path. 3.2.
Computational
complexity of the algorithm
Define L = sum of all arc lengths in G, an upper bound on the size of any label. It is easy to see that a vertex in G can have at most L. + 1 nonredundant labels. Scanning arc (p, q) --f u takes O(L) time per label at (p, q) in eliminating possibly redundant labels at u. Since (p, q) has at most 21 VI neighbors in G, scanning (p, q) takes O(/ VIL2) time. Now G has fewer than j VI2 vertices, so total work is O(l v13L2). The above algorithm can be generalized to solve the problem of finding p (p? 2 is a fixed number) pairwise vertex-disjoint s-t paths in G by constructing a “pdimensional” network G where the vertices in G are of the form (ui, . . . , up). The “p-dimensional” algorithm takes 0( I VI f’+1L2p-2) time and O(l VIPLP-‘) space if we eliminate possible redundant labels when we add new labels, or O(l VlpflLP) time and O(l VlpLp) space if we keep all labels. 3.3.
The arc-disjoint case
We can transform the acyclic arc-disjoint case to the vertex-disjoint case as follows. Given G, add new arcs u +s and t + u of length 0 to G. Now form the directed line-graph (see [5]), calling the vertex corresponding to u + s (respectively I -+ u) s’ (respectively t’). Each arc in the line-graph has length 0. Now split each vertex w in the line graph into an arc wi --f w2 such that all arcs into (out of) w are into wi (out of w,). The length of arc wt + w2 is the length of the arc in G corresponding to w. Call this new graph G’. Clearly G’is acyclic, and there arep vertexdisjoint s’+ t’ paths in G’ if and only if there are p corresponding arc-disjoint s---t t paths in G. This transformation can be accomplished in 0( IA I) time, so we can also solve the min-max p arc-disjoint path problem in pseudo-polynomial time (the previous time bounds will have j V/ replaced by lA( since 1V’1 =O(jA I)).
112
C.-L.
Li et al.
4. Some related problems lfn this section. we show that some relatedprohfems are ako NP-comnlete. We use the following result due to Fortune, Hopcroft and Wyllie [2]. Given any directed graph G =(I/,A) and four vertkes s=%. Thus may?jZ.r_7 i5f$$ma-+jz.~_T 653=2. The I’olIowing theorem states rnaf in a direcred network, the mm-sum IreurXc has the best possible worst-case behavior among all pseudo-polynomial-time heuristics (unless P = NP).
then any pseudo-polynomial-time heuristic for finding two -+ t paths in a directed network has a worstmin-max vertex-disjoint (arc-disjoint) s care bua& 02 at .&z& 2.
Theorem
2. If P #NP,
Fig. 4.
113
Complexity of two min-max paths
Proof. To reduce 2DP problem into our problem, G = (V, A) and define the network G = (E A^) by
P= vu
add two new vertices s and t to
{s,t},
where arcs s -+ s1 and t, -+ t have length 1 and all other arcs have length 0. Note that the longer path among any pair of vertex-disjoint (arc-disjoint) s--* t paths in G has length equal to either 1 or 2. Furthermore, there exist two vertexdisjoint (arc-disjoint) s-+ t paths in G such that the longer one has length equal to 1 if and only if there exist two vertex-disjoint (arc-disjoint) paths in G connecting s, with t, and s2 with t2. Thus if there were a pseudo-polynomial-time heuristic for finding two min-max vertex-disjoint (arc-disjoint) s + t paths in G with a worst-case bound less than 2, then the heuristic would optimally solve the problem of finding disjoint 17 s2 + t2 paths in G. This contradicts the assumption that P # NP.
s1 + t, and
4.2. Finding two disjoint paths with lengths bounded by a fixed number Given a directed network G, let d* denote the G. The problem of deciding if G has two disjoint most d*, can be solved in polynomial time by any consider the problem of finding two disjoint paths
length of a shortest s+ t path in s+ t paths, both with length at shortest path algorithm. We now with lengths bounded by d *+ 1.
Theorem 3. The probem of finding two vertex-disjoint (arc-disjoint) s + t paths in a directed network with nonnegative integral arc-lengths such that the lengths of the paths are at most d * + 1 is strongly NP-complete. Proof. The problem belongs to NP. We reduce 2DP into this problem. Given any directed graph G = (V, A) and four distinct vertices sr , tl , s2, t2 E V, we construct the network G as defined in the proof of Theorem 2. We show that the answer to 2DP is yes if and only if G has two paths bounded by d*+ 1. Assume that the answer to 2DP problem in G is yes. Then there are clearly two disjoint paths from s to t in G with length Ed *+ 1. Assume now that the answer to 2DP problem in G is no. Then if t1 is reachable from s2, d* is 0 and hence the length of any possible path from s to t through vertices sr and t2 is at least 2, so the answer to our problem is no. If tl is not reachable from s2, there are not two disjoint paths from s to t in 6, hence the answer to our problem is also no. 0 If we restrict disjoint version Theorem
this problem to allow only positive integral of the problem can be solved in polynomial
4. The problem
arc-lengths, time.
the arc-
of finding two arc-disjoint s --t t paths in a directed net-
114
C.-L.
Li et al.
work with positive integral arc-lengths such that the lengths of the paths are I d * + 1 is polynomial-time solvable. Proof. Given a directed G’ = (V’, A’) as follows:
network
(1) compute d(s, o), the shortest (2) for each arc u--f u, compute
G = (I/,A),
we can construct
a new network
distance from s to u, for every vertex the “reduced arc-length”
o;
r(u + u) = l(u + u) - d(s, o) + d(s, u); (3) delete those arcs with reduced arc-length r(u -+ u) > 1; (4) delete those vertices (and their incident arcs) which cannot
reach
t.
The resultant network G’ is called a core. Arcs in the core with reduced length 0 are called forward arcs, whereas those with reduced length 1 are called sideways arcs. We then replace each vertex u E V’ by two vertices u’ and u” and an arc u’+ u” with reduced length 0. All forward arcs into (out of) u become incoming arcs of u’ (outgoing arcs of u”). Each sideways arc u + u in G’ is changed to arc u’-+ u” with reduced length 1. We call this new network G”. It is easy to see that the following three statements are equivalent: (i) there exist two arc-disjoint (ii) there exist two arc-disjoint length at most 1; (iii) there exist two arc-disjoint length at most 1.
s + t paths in G, each with length at most d *+ 1; s+ t paths in G’, each with total reduced arcs’+ t” paths in G”, each with total reduced
arc-
Note that all cycles in G’ contain only sideways arcs, so that G” is acyclic. By using the algorithm given in Section 3, the arc-disjoint version of the problem is polynomially solvable since the transformation from G to G” can be done in polynomial time. 0 For the undirected edge-disjoint version of the “d * + 1 problem” with positive integral edge-lengths, we can treat those edges with reduced edge-length 0 as directed forward arcs and change each edge u - u in the core with r(u - u) = 1 to a pair of sideways arcs u -+ u and u + U. Then the problem can be solved in polynomial time as in the proof of Theorem 4. Therefore, the undirected edge-disjoint version of the problem can also be solved in polynomial time.
5. Conclusion We have shown that all four versions of the min-max 2 path problem as well as some related problems are strongly NP-complete, except when the given network is acyclic in which case a pseudo-polynomial-time algorithm exists. An interesting
Complexity of two min-max paths
related
is: Let each edge i-j
problem
115
have two types of lengths
cii, Wij. Let I(P,)
(I&)) be the length of the first (second) path with respect to the lengths Cij (wij). We want to find two disjoint s- t paths such that f(Pr) + f(P,) is minimized. Techniques similar to those in Section 4.1 show that such problems are also strongly NP-complete in the directed case, even if one of the cost functions is a multiple of the other, i.e., wU=a.cti for all arcs i-j and a#1 (see [7]).
Acknowledgment We would like to thank Professor blem which motivated this paper.
Mischa Schwartz
for introducing
us to the pro-
References [l] S. Even,
A.
Itai and
A. Shamir,
On the complexity
problems, SIAM J. Comput. 5 (1976) 691-703. [2] S. Fortune, J. Hopcroft and J. Wyllie, The directed Comput. [3] M.R.
Carey
and D.S.
Computers
San Francisco,
D.S. Johnson
Comput.
[5] F. Harary,
Johnson,
(Freeman,
Carey,
Theoret.
constraints, Thesis,
Graph
Theory
Networks
Li, Complexity Columbia
works
Suurballe
CA,
and Intractability:
problem,
Theoret.
A Guide
to the Theory
of NP-
1979).
and L. Stockmeyer, (Addison-Wesley,
Some simplified
Reading,
The complexity
and worst-case
University,
NP-complete
graph
problems,
MA,
of finding
1972). maximum
disjoint
paths
with length
Finding
and R.E. Tarjan,
14 (1984) 325-336.
analysis
of some network
and routing
problems,
Eng.Sc.D.
New York (to appear).
A.C.M. 25(l) (1978) l-9. [9] J.W. Suurballe, Disjoint paths J.W.
homeomorphism
flow
12 (1982) 277-286.
[8] Y. Per1 and Y. Shiloach,
[lo]
multicommodity
Sci. 1 (1976) 237-267.
[6] A. Itai, Y. Per1 and Y. Shiloach, [7] C.L.
subgraph
and
Sci. 10 (1980) 111-121.
Completeness [4] M.R.
of timetable
two disjoint
in a network,
paths
between
Networks
A quick method
two pairs of vertices
in a graph,
J.
4 (1974) 125-145.
for finding
shortest
pairs of disjoint
paths,
Net-