Short Length Versions of Menger's Theorem Zvi Galil, Xiangdong Yu
(EXTENDED ABSTRACT)
SUMMARY OF RESULTS Consider a simple n-vertex undirected graph and assume there are edge-disjoint paths between two vertices u and v . We prove the following two results:
Therepare edge-disjoint paths between u and v, the average length of which is O(n= ) If all vertices have degree at least , there are edge-disjoint paths between u and v, each of which has length O(n=). These bounds are best possible. For directed graphs, the rst result still holds but not the second. Some of the paths can be at least (n) long. We also describe how to use a minimum cost ow algorithm to nd the paths implied by the above results in time O(m). In a edge-connected graph, we de ne the concept of bistance (or bulk distance). The bistance between u and v is the minimum over all edge-disjoint paths between u and v of the maximum path length. We prove that bistance forms a metric. We give NP-hardness results on computing bistances in two cases. The third remaining case is open but we give evidence to its diculty.
Warning: The main results of this paper are graph theoretic. You may not wish to read beyond this point.
Contact Author: Xiangdong Yu Department of Computer Science Columbia University New York, NY 10027 e-mail:
[email protected]
1 Introduction The connectivity of a graph is an important area in graph theory and in algorithm research. It is also closely related to the reliability and stability of a network. Menger's Theorem[16][9] is a classic result on graph connectivity. It has an edge version and a vertex version. For the case of edge connectivity, it gives an equivalence condition between the minimum edge cut separating two vertices and the existence of edge-disjoint paths between them. However, it does not state anything about the lengths of these paths, which is important if we view the graph as a circuit or communication network and the paths as signal/message transmission channels where both time and reliability are important. In this paper, we prove two short length versions of Menger's Theorem, which say that in any simple (no self cycles and parallel edges) undirected graph with n vertices and m edges, there are edge-disjoint paths between any pair of -edge connected vertices, p the average length of which is O(n= ); and if in addition the degrees of all vertices are at least , then there are edge-disjoint paths between the pair of vertices, each of which has length O(n=). These bounds are tight in the sense that there are graphs and vertex pairs in them such that the lengths of any edge-disjoint paths between these vertices meet the bounds. In directed graphs, the rst result (about the average length) still holds but not the second. We show that we may not be able to avoid paths of length (n). There are various algorithms to decide the edge connectivity of graphs and to nd edge-disjoint paths between vertices. See [6] and [15] for sequential algorithms and [13] for a parallel parallel algorithm. All these algorithms ignore the lengths of the edge-disjoint paths. Using the approach of minimum cost ow, we propose an algorithm that nds the edge-disjoint paths claimed above. It runs in time O(m). In a -edge connected graph, we de ne a new kind of distance called Bulk Distance, or Bistance for short, between any two vertices. The bistance between u and v is the minimum of length L such that between u and v there are edge-disjoint paths each of which has length no more than L. We show that bistance forms a metric for undirected graphs, and the short length version of Menger's Theorem can be restated using bistance. Unfortunately, nding bistance is hard. We give NP-hardness results for general weighted graph with as small as 2 and for unweigted graph with variable . For unweighted graph but xed , we prove that unlike the usual ow problem (which ignores path lengths) where single commodity and multicommodity dier signi cantly, the single pair bistance problem is in some sense \equivalent" to its \multi-pair" version. In their extensive work on \Graph Minors", Robertson and Seymour designed a complicated polynomial time algorithm for nding edge/vertex-disjoint paths linking a xed number of pairs of vertices [18]. But their techniques do not seem to be directly applicable in our case when path lengths are also considered. A similar result on the -pair bistance problem for xed may be as hard or harder. In [14], Lovasz, Neumann-Lara and Plummer wrote a paper called \Mengerian Theorems for Paths of Bounded Length". This is the only work known to us that takes into account the length of the paths. It deals exclusively with vertex connectivity and it investigates the relation between the size of vertex-cuts that break all short paths and the number of short vertex-disjoint paths between a given pair of vertices. Their work seems unrelated to ours.
2 Model and De nitions
De nition 1 Let G =< V; E > be a simple (without self cycles and parallel edges) undirected graph with vertex set V and edge set E , where jV j = n; jE j = m. Two vertices u; v 2 V are said to be -edge connected if for any subset V V with u 2 V and v 62 V , the size of the cut, i.e. the 1
1
1
1
set of edges with one end in V1 and the other in V ? V1, is at least . Graph G is said to be -edge connected if any two dierent vertices in G are -edge connected.
De nition 2 Given graph G =< V; E >, the length of a path p in G, length(p), is the number of edges in it. Let Pu;v = fp ; p P ; : : :; pg be a set of edge-disjoint paths between a pair of vertices u; v, we de ne Avg(Pu;v ) = i length(pi) and Long(Pu;v ) = MAX flength(pi)j1 i g. Let 1
1
2
=1
() Pavg (u; v) be a path set minimizing Avg(Pu;v ) and Bavg (u; v ) = Avg (Pavg (u; v )), let Plong (u; v ) be () () (u; v ) the -average one minimizing Long (Pu;v ) and Blong (u; v ) = Long (Plong (u; v )), we call Bavg () distance between u and v , and Blong (u; v ) the -bulk distance between u and v . We usually simplify the latter as B () (u; v ) or B (u; v ), and call it -bistance, or just bistance when is clear from the
context.
De nition 3 Let P be a set of edge-disjoint paths between vertex u and v in graph G, a uv orien-
tation of P is a digraph obtained from P by changing every edge in P into an arc pointing to the same direction the edge is passed as the path is traced from u to v .
3 Short Paths between a -edge Connected Pair of Vertices Let D be the uv orientation of Pavg (u; v ).
Lemma 1 D is acyclic. Proof : First, due to the optimality of Pavg (u; v ), each path in it is a simple path, i.e., does not contain cycle. Assume D contains a cycle C = a1 a2 : : :ak , where ai are arcs, we will derive a contradiction below. (See Figure 1.) Cycle C can be partitioned into segments, each of which appears in a single path. Of course, dierent segments may appear in the same path. Note that the ending vertex of a segment is the starting vertex of the other, whereas vertex u can only be the start of any arc and v can only be the end of any arc, hence these two vertices do not appear in the cycle. For each segment, there is an incoming arc attached to its start vertex and an outgoing arc attached to its end vertex. We list the segments in the cycle and their incoming and outgoing arcs as C = s1 s2 : : :sl , incoming: r1 ; r2; : : :; rl; and outgoing: t1 ; t2; : : :; tl . Then we can rearrange the paths so that they are still edge-disjoint but do not use any arcs in the cycle, which contradicts the optimality of Pavg (u; v ). The new paths go like this: At any moment, each new path proceeds along one old path. It leaves the old path that it follows when an ri is reached. Instead of getting into the cycle, the new path switches to the old path containing arc ti?1 , or tl if i = 1, and continues. Note that each edge has a unique distinct successor before the transformation. Since the transformation permutes and deletes some successors, each edge has a unique distinct successor after the transformation. We need to show two things. First, each new path will arrive at v . This follows from the unique distinct successor property because if we do not arrive in v we must have a cycle and violate this property. The new paths are edge-disjoint again by the unique distinct successor property. Since D is acyclic, it can be represented as layered graph using topological ordering as follows. The rst layer H0 consists of u. After de ning a number of layers and deleting all vertices and edges in these layers, the next layer consists of all vertices with no incoming edges. We have the following de nitions and lemmas about our layered graph.
2
De nition 4 Assume layered graph D has l + 1 layers. Let Hi be the set of vertices in layer i, for l. interval H [i; j ] is de ned as the subgraph obtained by restricting D to vertex set S 0 Hih. An s-interval is one satisfying (j ? i + 1) = s. We say that an arc a spans interval ihj H [i; j ] if a 2 Hi Hj . A base arc is one spanning H [i; i + 1] for some i. The starting vertex of a base arc is called a parent of the end vertex. For 0 i < l, cut Ci is de ned as the set of arcs starting at H [0; i] and ending at H [i + 1; l]. Properties: For the layered graph D the following is true: 1. The highest layer H = fug; 2. The lowest layer Hl = fv g; 0
3. All arcs are downward, i.e., the starting vertex of any arc is at a higher layer than the ending vertex. And, for 0 i < l, there are exactly arcs in Ci. 4. Long (Pavg (u; v )) l. 5. Any vertex not in H0 has an incoming base arc. But some vertices not in Hl may have no outgoing base arc. (They will still have outgoing non-base arc.) 6. Except for u and v , a vertex has an indegree equal to its outdegree. We next de ne an operation SINK that will help us modify the graph D into another graph with the same number of edges. We will be able to estimate the number of the edges of the new graph. See Figure 2.
De nition 5 (Operation SINK). Interval H [i; j ] is said to be s-saturated for some s satisfying 1 s (j ? i + 1), if i j , and any of its s-subintervals forms a complete s-partite graph if the orientation of arcs are ignored, i.e., between any two vertices in dierent layers in the subinterval there is an arc. The maximum such s is called the saturation degree of interval H [i; j ]. H [i; j ] is fully saturated if s = (j ? i + 1). An arc spanning H [i; j ] can be sinked if H [i; j ] has a saturation degree s < (j ? i). In operation SINK, the original arc is taken away, replaced by a new arc spanning the highest unsaturated (s + 1)-subinterval in H [i; j ]. A fully sinked graph FS (D) from D is one obtained by repeatedly applying operation SINK to D until no arc is sinkable. Properties: After a SINK, the graph has the same number of layers, each layer has the same set of
vertices, the total number of arcs in the graph is unchanged, and the size of Ci does not increase for 0 i < l. In FS (D), whenever there is an arc spanning interval H [i; j ], H [i; j ] is (j ? i)-saturated. (u; v ) = Theorem 1 If vertices u and v are -edge connected in an undirected simple graph, then Bavg p O(n= ). ( )
P
() (u; v ) = W=. Note that p W is just the number of edges Proof : Let W = i=1 length(pi), then Bavg in D, or equivalently, in F = FS (D). Below we bound W to be O ( n ). P For a set of layers A, let kAkp= Hi 2A jHij. We divide the layers into two parts: Part S containing those Hi 's with jHij p < except the rst and the last layer, and Part L contains the rest. It follows that jLj kLk= + 2. For any Hi 2 L, since jCi?1 [ Cij 2, we can estimate the number X of arcs touching or passing layers in L:
X
X jC
Hi 2L
i?1 [ Ci j = O( jLj) = O(
3
p kLk) = O(np):
The rest of the arcs can only touch or pass layers in S . To analyse this case, we determine a sequence of layer numbers 0 = l0 ; l1; : : :; lh = l in F , such that for 0 i < h, Hli+1 is the farthest layer to which any arc from Hli can go. This, combined with the fact that F is fully sinked, implies that H [li; li+1] is (li+1 ? li )-saturated and no arcs from layers above Hli can reach layers below Hli+1 . We call interval H [li; li+1] a trunk, denoted by Ti. See Figure 3. Consider any two layers Hx; Hy in L such that all layers in between are in S . Let S1 = fHijx < i < yg, Ta; Ta+1; : : :; Tb be the minimal such sequence of trunks that cover S1 , and the intersections of S1 with those trunks be G1; G2; : : :; Gq where q = (b ? a + 1). Claim. For 1 i q, kGik = O(p).
p
layer Hf and the lowest Proof : Assume kGik > 5 for somep1 i q , Since both the highest p vertices least 3 in the intermediate layer Hg in Gi have size smaller than , there must be at p be one intermediate layer layers. Since each intermediate layer has size smaller than , there must p Hj in Gi such that kH [f + 1; j ] \ Gi k > p, and k H [ j + 1 ; g ? 1] \ G k > . Since H [f + 1; g ? 1] i p p is fully saturated, there would be more than = arcs in Cj , a contradiction. Therefore kGik 5p. Next we bound Y , the number of arcs that is not counted above in X (edges not touching or passing over layers of L). From the property of trunks we know that any such arc is either within a Gi, called internal arc, or from a Gi vertex to a Gi+1 vertex, called external arc. The number of internal arcs of Gi is bounded by kGik2 . The number of external arcs from Gi to Gi+1 is bounded by kGi k kGi+1 k, which is in turn bounded by (kGik2 + kGi+1 k2)=2. So we get X Y 2 kGi k2; Gi
where Gi ranges between all pairs of big layers Hx and Hy described above. Since two suchp Gi's overlap in at most one layer, the total size of Gi is less than 2kS k. With constraint kGik 5 , it p can be shown that Y achieves the maximum when every Gi has maximal size 5 , in which case p p p p Y 2 (5 )2 2kS k=(5 ) = O( kS k) = O(n ): p Now W = X + Y = O(n ). The same proof appleis in case of directed graphs. (u; v ) = Corollary 1 If vertices u and v are -edge connected in a simple directed graph, then Bavg p O(n= ). ( )
Remarks. Example 1 in Figure 5 shows that the bound given in Theorem 1 is tight and holds for
the average length only; long paths may not be avoidable. In spite of the existence of such odd path, one can get a large enough set of edge-disjoint paths each of which is short. Corollary 2 If u and v are -edge connected in graph G, there are () edge-disjoint paths between u and v such that each of these paths has length O(n=p).
4 Better Results for Graphs of High Degree In section 3 we bounded the average length of a set of paths but gave an example that contains an odd long path. In this section we show that if the graph has degree then we can guarantee that all paths are short, and the bound is even smaller. 4
De nition 6 A graph is called mixed if it contains both directed and undirected edges. A cycle in a
mixed graph may have both types of edges, but the directions of the directed ones must be consistent. We say a cycle is heavy if the number of undirected edges in it is smaller than that of directed ones.
De nition 7 An embedded uv orientation of a set P of edge-disjoint paths between u and v in
graph G is a mixed graph obtained from G by changing edges in P in the same way as the uv orientation of P while keeping all other edges untouched.
Given path set Pavg (u; v ), one can represent its uv orientation D as layered graph by topological ordering as in Section 3, then add in the remaining vertices and edges to form the embedded uv orientation M .
De nition 8 Assume D has layers H ; H ; : : :; Hl. Let e = (x; y) be a nonpath edge with x 2 Hi. If y 62 Hi , we say y is e's outer end with respect to Hi , denoted by Outeri (e), or simply Outer(e) 0
1
when i is clear. If this outer end falls into one of the layers, we call e a jump, otherwise, we call the outer vertex a satellite of Hi . All the satellites of Hi form a set SATi, and the union of SATi; SATi+1; : : :; SATj is denoted by SAT [i; j ]. A Cluster is de ned S as the set of vertices dedicated exclusively to three neighbouring layers, i.e. CLUi = H [i; i + 2] (SAT [i; i + 2] ? SAT [0; i ? 1] ? SAT [i + 3; l]).
Lemma 2 Let M be the embedded uv orientation of Pavg (u; v). Then M does not contain heavy
cycle.
Proof : This can be shown in nearly the same way as Lemma 1. The dierence is that here the heavy cycle will be written as s1 g1 s2 g2 : : :sl gl where si (directed) are path segments and gi (undirected) contains zero or more edges that are not in any path. Each si has an incoming arc ri and an outgoing arc ti . Note that now u and v may be in the cycle, in that case we let the ri or ti be a dummy arc. Again we construct new paths from u following old paths. At its current vertex (which is u at the beginning), each new path must decide which arc to choose as successor. The rule is: if the current vertex is not in the cycle, take the successor in the same way as the old path it currently follows. Otherwise, the current vertex must be the start vertex of an si . Let j = i ? 1, or l if i = 1. If gj is empty, then choose tj as successor. Otherwise, let gj = e1 ; e2; : : :; eh, where e1 is adjacent to sj 's end vertex and eh is adjacent to si 's start vertex. Orient edges in gj so that it forms a path going in counter direction: eh ; : : :; e2; e1. The new path then takes in turn as successors eh ; : : :; e2; e1, and takes tj after that. (Of course, if tj is a dummy one, that means v is reached and no further successor need to be taken). It is easy to see that dierent arcs have dierent successors, no arcs in any si are taken by any new path, and successors always exist unless v is reached. This implies that every new path must reach v and does not share arcs with others. The new set of paths drop all si 's and introduce nothing more than the gi 's. Since the cycle is heavy, the new path set would have shorter average length, a contradition.
Theorem 2 If vertices u and v are -edge connected in an undirected degree graph, then () (u; v ) = O(n=). Blong
() (u; v ). The layers in D are clasProof : It is enough to bound above Long (Pavg (u; v )) Blong si ed into three types, and the number of layers in each type is shown to be O(n=). Thus Long(Pavg (u; v)) which is not larger than the total number of layers, equals to O(n=). Type I. Layer Hi is of type I if jCLUij =6.
5
Type II. Layers containing one vertex (a critical vertex) that has less than =3 nonpath edges. Type III. Layers not of type I or II. Since CLUi \ CLUj = ; for j > i + 2, we have for each t, 0 t 2, there can be at most
O(n=) type I layers in Ht; Ht+3; Ht+23; Ht+33; : : :. So that total number of layers of type I is 3 O(n=) = O(n=). For type II layers, we have the following obversation. The critical vertex has degree at least , more than 2=3 of its edges lay in the paths. Every path going through it uses exactly two of the 2=3 arcs; there must be more than =3 paths passing through it.
In the sequence of such layers listed top-down, we partition them in order into subgroups of size 5. Consider an interval H [p; q ] that holds one such subgroup fA1 ; A2; A3; A4; A5g such that Hp = A1 and Hq = A5 . The critical vertex of any Ai has at least =3 arcs going down, which must end at dierent vertex (no parallel edges). If for all 1 i 4, more than =6 of the at least =3 arcs go below Hq , plus the at least =3 arcs going down from A5 , there would be more than arcs in Cq , which is impossible. Hence, one of the Ai , 1 i 4 must have at least =6 end vertices in H [p; q ], causing the size of H [p; q ] to be (). Since such intervals are disjoint for dierent subgroups, there should only be O(n=) of them. The total number of type II layers is therefore 5 O(n=) = O(n=). In a type III layer Hi, every vertex has at least =3 nonpath edges. The outer ends of =6 of them must fall outside CLUi since jCLUij =6. There are two possibilities. First, everySvertex in Hi is adjacent to a nonpath edge whose outer end is in LOWER BLOCK = H [i + 3; l] SAT [i + 3; l]. We will show this would imply a heavy cycle in M , and thus is not possible. To nd the heavy cycle, one starts from any vertex w0 2 Hi , goes along a nonpath edge from w0 to r0 2 LOWER BLOCK . If r0 2 SATj for some j , one can nd r1 2 Hj such that (r0; r1) is a nonpath edge. This means that there is always a shortcut of length 1 or 2 from w0 to a lower layer Hj , j > i + 2. On the other hand, from the ending vertex in Hj one can always backtrack layer by layer to some vertex w1 in Hi through j ? i > 2 base arcs. From w1 one can repeat the same procedure as from w0, to get w2, etc. This procedure is stopped when we reach a vertex t for the second time. All the vertices from t's rst occurrence to its second occurrence form a cycle. This cycle is heavy because the rearrangement around t still keeps the shortcuts within length 2 and the directed segments above length 2. See Figure 4. So the only possibility left is the case in which at S least one vertex w in Hi has =6 of its nonpath edges adjacent to UPPER BLOCK = H [0; i ? 1] (SAT [0; i ? 1] ? SAT [i; l]) and no nonpath edge to LOWER BLOCK . Call the set of outer end vertices of those up-going edges the cover set of w. If any member of the cover set had a nonpath edge jumpping down to H [i + 3; l], this member would have the same eect as one in SAT [i + 3; l] in causing a shortcut of length 2 from w to H [i +3; l], and the heavy cycle argument above would apply. So for at least one w the cover set has no nonpath edge jumpping down to H [i + 3; l]. We call such vertex w interesting. Consequently, the cover set of an interesting vertex w in Hi is disjoint from the cover set of an interesting vertex w1 in any type III layer Hj for j i + 3. Since a cover set contains at least () vertices, the total number of type III layers is 3 O(n=) = O(n=).
Corollary 3 If G is -edge connected, then there are edge-disjoint paths of length O(n=) between
any two dierent vertices. Remarks. Example 2 of Figure 6 shows that the bound given in Theorem 2 and in Corollary 3 is tight. It gives a edge-connected graph such that for every set of edge-disjoint paths between vertices u and v , each path in the set has length at least (n=). Theorem 2 and Corollary 3 do not hold for directed graphs. Example 3 in Figure 7 shows that one cannot avoid paths of length (n) even if the graph is arc-connected.
6
5 Algorithm In this section we describe an algorithm that given graph G and vertex s; t, nds a Pavg (s; t), thus it achieves the bounds given by Theorem 1 and Theorem 2. We give a simple formulation of the problem as a minimum cost ow problem. In fact Lemma 1 and Lemma 2 follow from the well known fact that for a minimum cost ow of any value, the residual network has no negative cost cycle. In our case we preferred giving a more intuitive combinatorial proof. Due to lack of space we give the details in the Appendix. We transform G into a directed network F . The network has arcs with capacities in f0; 1g and costs in f?1; +1g. It follows from () the construction that there is an integral minimum cost ow in F and its cost is Bavg (u; v ). Minimum cost ow is a well studied problem in computer science and operation research. Due to the special characteristics of 1 cost network and the speci c requirements of our question, we obtain the bound below by making some small changes to one of the earliest algorithms for minimum cost ow, i.e. the successive shortest path algorithm developed independently by Jewell[11], Iri[10] and Busaker and Gowen[3].
Theorem 3 There is an O(m) time algorithm that either nds a minimum cost s ? t - ow in F , or decides that such ow does not exist.
Corollary 4 The edge-disjoint paths implied by Theorem 1 and Theorem 2 can be found in time O(m).
Proof : The nal subnetwork consisting of arcs (i; j ) with positive unit ow must be an acyclic Eulerian digraph. It is decomposable into arc-disjoint paths in linear time.
6 Bistance The usual concept of distance in graphs is based on the length of a single path. In edge-connected () () and Bavg are generalized distances based on edge-disjoint paths. A key property graphs, Blong of any distance measure is that it forms a metric. For bistance in an undirected graph, if B (u; u) is de ned to be 0, while B (u; v ) = B (v; u) is obviously true, its metric property will be implied by the following triangular inequality theorem.
Theorem 4 In a edge-connected graph G, for any three dierent nodes u; v and w, Bx (u; w) + Bx (w; v) Bx (u; v) is true for x = avg and x = long. Proof : Let the set of paths achieving Bx (u; w) be P = fp ; p ; : : :; pg and the let set of paths achieving Bx (w; v ) be Q = fq ; q ; : : :; q g. De ne a mapping R : Q ! E [ fg, where is a ( )
( )
( )
1
1
2
2
0
dummy edge, as follows. If qi has common edges with paths in P , then R0(qi ) is the rst such edge reached when tracing qi from v ; otherwise, R0(qi ) = . Based on R0, one can derive a set Q1 of partial paths from Q by keeping only those edges in qi from v until R0(qi) is included, or until w if R0(qi ) = . One can also derive a set P1 of partial paths from P by only keeping those edges in pi from u until an edge in R0(Q) is included, or until w if there is no such edge in pi . This operation is called conversion (P; Q; R0; P1; Q1). It is easy to see that conversion (P1 ; Q; R1; P2; Q2); (P2; Q; R2; P3; Q3); : : : can be done in a similar way. This procedure is continued until Pt+1 = Pt for some t as we shall see below. Note that we always use the entire set Q with Pj to generate Qj +1 and Pj +1 . Note also that the paths in Pj become shorter as j grows (except for j = t) and as a result the paths in Qj become longer. 7
Time t exists because each path in P has nite length. Note that for j > 0, any path in Pj has either no common edge with paths in Qj , or exactly one common edge. Since paths in Qj are edge disjoint, the exactly one common edge will be shared with exactly one path in Qj , and in this case we say the path in Pj and the one in Qj are coupled through this edge at time j . So, if q 2 Qt+1 is not coupled at time t + 1, it can not share edge with any path in Pt+1 . We claim that in this case q must equal to its complete form qi . For, if did not, its end edge Rt(qi ) would be in a path p 2 Pt = Pt+1 , a contradiction. Now edge-disjoint paths can be formed by a number of coupled pairs of Pt and Qt paths (possibly after deleting some shared edges), plus the remaining set of complete u ? w paths followed by the complete w ? v paths. Each suched u ? v path has length no larger than the length sum of a u ? w path in P and a w ? v path in Q, and their total length is at most the total length of P plus Q. So the triangular inequality is true for both x = long and x = avg . We have shown an ecient algorithm for Bavg in Section 5. But the computation of Blong is more dicult. The following two theorems are proved by simple reduction from the classic NP-complete problems of NUMBER-PARTITION and MULTI-PAIR EDGE-DISJOINT PATHS [12]. (u; v ) L given an undirected graph G =< V; E >, Theorem 5 The problem of deciding if Blong general weight function w : E 7! Z , vertices u and v , and length bound L is NP-complete. This ( )
+
is true even if G is a simple layered graph and = 2.
(u; v ) L given unweighted undirected graph G =< Theorem 6 The problem of deciding if Blong ( )
V; E >, , vertices u and v, and length bound L is NP-complete.
If P 6= NP , the only possible polynomial time algorithm could exist for bistance in the case when is xed and the edge is unweighted or polynomially weighted. However, below we show that it is probably harder than an already dicult problem.
De nition 9 Let [0; n ? 1] be the set of -tuples whose components take integer values from 0 to n ? 1. For any ; 2 [0; n ? 1] , de ne if i i for all 1 i and i < i for at least one i. The partial order digraph H =< [0; n ? 1] ; S > is de ned by letting (; ) 2 S if and only if and there is no 2 [0; n ? 1] such that . De nition 10 Given sources ~s = s ; s ; : : :; s and sinks ~t = t ; t ; : : :; t in an undirected graph G, de ne SPG(~s; ~t) to be the set of edge-disjoint path tuples (p ; p ; : : :; p) such that for 1 i , 1
2
1
1
2
2
pi is a simple path linking si and ti . Let PLG (~s; ~t) = f(l1; l2; : : :; l)j9(p1; p2; : : :; p) 2 SPG(~s; ~t)81 i ; li = length(pi )g; the multi-pair bistance MBG (~s; ~t) is de ned as the set of minimal points in PLG (~s; ~t), i.e., MBG (~s; ~t) = f 2 PLG (~s; ~t)j 6 9 2 PLG (~s; ~t) g Multi-pair bistance is a generalization of single pair bistance. In fact,
(u; v ) = min Blong 2MB (u;v ) (max1i i ) where we use u and v , to denote a sequence of u's and v 's, respectively. A multi-pair bistance
algorithm can be used to nd single pair bistance right away. We will show below that a single pair bistance algorithm can be used to nd multi-pair bistance with polynomial time penalty. Hence this two problems are in some sense equivalent. This is a contrast to ow problem, where single 8
commodity version diers from multi-commodity version signi cantly. There is a simpli ed version of multi-pair bistance problem, i.e., the MULTI-PAIR EDGE-DISJOINT PATHS problem used above, which just requires to decide if SPG (~s; ~t) is empty, without worrying about path lengths at all. From the extensive work on \Graph Minors" by Robertson and Seymour[18], we know for xed , that this problem is solvable in polynomial time by a complicated algorithm. But these techniques do not seem to be directly applicable in our case when path lengths are also considered. A similar result on the -pair bistance problem for xed may be as hard or harder.
Theorem 7 The existence of a single-pair bistance algorithm As running in time T (As) implies a -pair bistance algorithm Am running in time T (Am) = T (As) n . Proof : . We apply procedure EXPLORE PATHS to vertices in the partial order digraph H =< [1; n ? 1] ; S > in topological order, starting from (0; 0; : : :; 0). Whenever EXPLORE PATHS returns success for a tuple , all the descendents of need not be considered. As a result we generate exactly all elements of MBG (~s; ~t). Procedure EXPLORE PATHS (; G;~s; ~t)
begin
Construct graph F from G by adding node s and t, and for 1 i , link s and si by a path of length (ni + n ? i ) (new nodes need to be inserted to pad the path to that length), and link ti and t by a path of length n( ? i + 1). Set L = n( + 2). return As (F; s; t; L).
end
7 Conclusion We proved short length versions for the classic Menger's Theorem in graph theory, and described an algorithm for nding the claimed edge-disjoint paths. We de ned the concept of bistance and proved its metricity. We pointed out that bistance is hard to compute. The related open problems are:
Can we compute bistances in unweighted graphs for a xed xed in polynomial time? To what extent can we approximate it in all the cases?
9
References [1] R.K.Ahuja, T.L.Magnanti, and J.B.Orlin, \Network Flows", Prentice Hall, New Jersey, 1993. [2] R.K.Ahuja, A.V.Goldberg, J.B.Orlin, and R.E.Tarjan, \Finding Minimum-Cost Flows by Doubling Scaling", Mathematical Programming 53, 1992, pp. 243-266. [3] R.G.Busaker and P.J.Gowen, \A Procedure for Determining Minimal-Cost Network Flow Patterns", ORO Technical Report 15, 1961, Operational Research Oce, Johns Hopkins University, Baltimore, MD. [4] R.Dial, \Algorithm 360: Shortest Path Forest with Topological Ordering", Communications of ACM 12, 1969, pp. 632-633. [5] J.Edmonds and R.M.Karp, \Theoretical Improvements in Algorithmic Eciency for Netowrk Flow Problems", Journal of ACM 19, 1972, pp. 248-264. [6] S.Even and R.E.Tarjan, \Network Flow and Testing Graph Connectivity", SIAM J. on Computing, 4:507-518, 1975. [7] A.Frank, \Packing Paths, Circuits, and Cuts-A Survey", Algorithms and Combinatorics 9, Paths,Flows, and VLSI-Layout, Springer-Verlag 1990, pp. 47-100. [8] A.V.Goldberg and R.E.Tarjan, \Solving Minimum Cost Flow Problem by Successive Approximation", 19th STOC, 1987, pp. 7-18. Full paper in Mathematics of Operation Research 15(1990), 430-466. [9] F.Harary, \Graph Theory", Addison-Wesley, Reading, Ma, 1969. [10] M.Iri, \A New Method of Solving Transportation-Network Problems", Journal of the Operations Reseach Society of Japan 3, 1960, 27-87. [11] W.S.Jewell, \Optimal Flow through Networks", Interim Technical Report 8, 1958, Operation Research Center, MIT, Cambridge, MA. [12] R.M.Karp, \Reducibility among Combinatorial Problems", In: Miller,R.E., Thatcher,J.W. (eds.): Complexity of Computer Computations. Plenum Press, New York, NY, pp. 85-103 (IBM Res. Symp. Ser., Vol 4) [13] S.Khuller and B.Schieber, \Ecient Parallel Algorithms for Testing Connectivity, and Finding Disjoint s ? t Paths in Graphs", 30th FOCS 1989, pp 288-293. [14] L.Lovasz, V.Neumann-Lara and M.D.Plummer, \Mengerian theorems for paths with bounded length", Periodica Math. Hung. 9, 1978, pp. 269-276. [15] D.W.Matula, \Determining Edge Connectivity in O(nm)", 28th FOCS, 1987, pp. 249-251. [16] K.Menger, \Zur Allgemeinen Kurventheorie", Fundam. Math. 10, 1927, pp. 96-115. [17] J.B.Orlin, \A Faster Strongly polynomial Minimum Cost Flow Algorithm", 20th STOC, 1988, pp. 377-387. Full paper to appear in Operation Research. [18] N.Robertson and P.D.Seymour, \An Outline of a Disjoint Paths Algorithm", Combinatorics 9, Paths,Flows, and VLSI-Layout, Springer-Verlag 1990, pp. 267-292. 10
[19] R.E.Tarjan, \Data Structures and Network Algoithms", CBMS-NSF Regional Conference Series in Applied Mathematics, 1983. [20] N.Tomizava, \On Some Techniques Useful for Solution of Transportation Network Problems", Networks 1, 1972, pp. 173-194.
Appendix: Details of the Algorithm We transform G into a directed network F by replacing each edge (u; v ) with a subgraph < Vu;v ; Au;v > where Vu;v = fu; v; wuv; wvug and Au;v consists of the four pairs of opposite arcs between u and wuv , wuv and v , v and wvu , and wvu and u, respectively. We associate capacity 1 and cost 1 to arcs in cycle uwuv vwvu u, and capacity 0 and cost -1 to arcs in cycle uwvu vwuv u. Here the cost function is skew symmetric, i.e., cost(i; j ) = ?cost(j; i) for all arc (i; j ) 2 A. It is easy to see that a Pavg (s; t) in G can induce an integral minimum cost ow in F and vice versa. Minimum cost ow is a well studied area in computer science and operation research. For an n-vertex, m-arc network N with C being the largest magnitude of any arc cost and U being the largest magnitude of any supply/demand or nite arc capacity, the best known time bound for this problem is[1] O(minfnm log(n2 =m) log(nC ); nm(log log U ) log(nC ); (m log n)(m + n log n)g); where the three bounds inside min are, respectively, due to Goldberg and Tarjan[8], Ahuja, Goldberg, Orlin, and Tarjan[2], and Orlin[17]. While applying to the unit capacity cost network F described above, this time bound becomes O(nm log n). However, due to the special characteristics of 1 cost network and the speci c requirements of our question, one can get a slightly better time bound by making some small changes to one of the earliest algorithms for minimum cost ow, i.e. the successive shortest path algorithm developed independently by Jewell[11], Iri[10] and Busaker and Gowen[3]. By applying the node potential technique invented independently by Tomizava[20] and Edmonds and Karp [5], one can transform an arbitrary arc length network into a nonnegative length network, thus makes the computation of shortest paths more ecient. When the original network is of 1 cost, the shortest path problem on all the intermediate residual networks can be solved in linear time, therefore the log n factor typically associated with the time bounds can be dropped.
De nition 11 Given network F =< V; A > with arc capacity function u and skew symmetric arc cost function c. A b- ow from node s to t is a function x : A 7! R such that For all (i; j ) 2 A; 0 xij uij ; Xx = Xx; For all i 2 V; i = 6 s; t; ji ij j;i)2A
X x + bi;j=2AX x ; js sj j;s 2A s;j 2A X x +b= X x ;
(
(
P
)
t;j )2A
(
(
)
(
tj
)
j;t)2A
jt
(
The cost of this ow is cost(x) = (i;j )2A cij xij . A minimum cost b- ow is one that minimizes cost(x). Given ow x, the residual capacity function r is de ned as rij = uij + xji ? xij . The residual network F (x) induced by x is one consisting only of arcs with positive residual capacities, with capacity function r and the same cost function c.
11
De nition 12 A node potential is a function : V 7! R. The reduced cost function c is de ned as cij = cij + (i) ? (j ) for all arc (i; j ) 2 A. We cite the following classic criterion in [1].
Lemma 3 (Reduced Cost Optimality Conditions). A b- ow x is minimum cost if and only if some node potential satis es the following reduced cost optimality conditions:
cij 0
for every arc (i; j ) in F (x):
Proof of Theorem 3
Based on the Reduced Cost Optimality Condition (RCOC), a successive shortest path algorithm works as follows: 1. Initially, set all xij = 0, (i) = 0. This 0- ow meets RCOC because cij = cij = 1 for all (i; j ) 2 F (0). 2. Set b = 0. 3. While (b < ) do: (a) Build a shortest path tree rooted at s with c as edge length, denote by d(i) the distance from s to node i. (b) If d(t) = 1, return PATHS NOT EXIST . (c) Set = + d and update c . (d) Merge into x one unit of ow along the shortest path from s to t, increment b by 1. (e) Update F (x). We need only to show the step of building the shortest tree takes time O(m). Since c is nonnegative, Dial's implementation[4] of Dijkstra's algorithm is used. We apply the following observation to bound the length of the bucket sequence L: although cij may go (n) for some (i; j ), jd(i)j and j (i)j are always bounded by O(n) because (i) is just the s ? i distance in previous F (x) with the original c as arc length, thus ?n < (i) < n, and d(i) is the s ? i distance in current F (x) (still with original c as length) minus (i), thus 0 d(i) < 2n. In conclusion, the shortest path step takes time O(m + L) = O(m + n) = O(m) and the whole algorithm runs in time O(m).
12
Figure 1: Removing a cycle in Lemma 1.
a
b
a
e
b
e
c
c d
d
(a) A 2−saturated interval with 5 layers .
(b) (b,d) is sinked to (a,e), making the interval 3−saturated and (a,c) unsinkable.
Figure 2: Operation SINK.
13
14 0
11 4
6
7 Trunks are:
A layer
H[0,4],H[4,6],H[6,7] H[7,11], and H[11,14]
Any bipartite graph A complete bipartite graph
Figure 3: Trunks in the proof of Theorem 1.
w1
w1
w0
w0
t
t r
r0
r0
r2
1
r
1
Figure 4: Heavy cycles in the proof of Theorem 2.
14
u
1 2 3
k
2 4
k
1
k
2
k
k−1
k
k
2 k
2 k −3 2 k −2 2 k −1
v
k
2
Figure 5: Example 1: Theorem 1 is best possible.
1
1
2
3
k−2
k−1
k
u
2
3
k−1
k
v
Figure 6: Example 2: Theorem 2 is best possible. 15
u
k
1
2 2 3
1 4
k 2
2 k +1 k
2 k +1
k h−1
k h hk−3 hk−2
k
2 hk−1 hk
v x A clique of x vertices
A group of arcs from/to k vertices to/from one (depending on the direction of the arrow)
A complete bipartite graph
An arc
Figure 7: Example 3: Theorem 2 and Corollary 3 do not hold for directed graphs.
16