+ All Categories
Home > Documents > Multicommodity Flows in Even, Planar Networks

Multicommodity Flows in Even, Planar Networks

Date post: 26-Aug-2016
Category:
Upload: k
View: 217 times
Download: 1 times
Share this document with a friend
21

Click here to load reader

Transcript
Page 1: Multicommodity Flows in Even, Planar Networks

Algorithmica (1997) 18: 363–383 Algorithmica© 1997 Springer-Verlag New York Inc.

Multicommodity Flows in Even, Planar Networks1

K. Weihe2

Abstract. We consider the problem of finding an integral multicommodity flow in a planar, undirectedgraph where all sources and all targets are on the boundary of the infinite face. Moreover, all capacities and alldemands satisfy the so-calledevenness condition. The best algorithm known so far requiresO(kn+ n2) time,wheren denotes the number of vertices andk the number of source–target pairs. In this paper we introducean algorithm that is based on a completely new approach and is asymptotically optimal, that is, requires onlyO(kn) time in the worst case.

Key Words. Planar graphs, Multicommodity flow, Evenness condition.

1. Introduction

Problem. Let G = (V, E) be an undirected, planar graph, embedded in the planewithout crossings of arcs, and lets1, . . . , sk, t1, . . . , tk ∈ V be (not necessarily pairwisedifferent) vertices on the boundary ofG. See Figure 1. Moreover, for each edgee ∈ Elet Ce be a nonnegative integer, thecapacityof e, and for each pair{si , ti } let di be anonnegative integer, thedemandof the pair{si , ti }. In what follows we restrict attentionto instances that fulfill the so-calledevenness condition. That is, the sum of all demandslocated at a vertexplus the sum of the capacities of all incident edges must be even.More formally, forv ∈ V we have∑

i :si=vdi +

∑i :ti=v

di +∑

w:{v,w}∈E

C{v,w} = 0 (mod 2).

Let G→ = (V, A→) be thedirectedgraph arising fromG by replacing each undirectededge{v,w} with the directedarcs(v,w) and(w, v). The problem is to find an integral,nonnegative weightingf defined onA→ × {1, . . . , k} such that

k∑i=1

( f(v,w),i + f(w,v),i ) ≤ C{v,w}

1 An extended abstract of a preliminary version has been published under the same title in theProceedings ofthe Fourth International Symposium on Algorithms and Computation(ISAAC ’93), pp. 333–342. LNCS 762.Springer-Verlag, Berlin. For this abstract, thebest paper awardof ISAAC’93 was presented “in recognitionof the most outstanding paper written solely by a student.” An outline of the algorithm has been published in[RWW].2 Informatik, Universitat Konstanz, 78434 Konstanz, Germany. [email protected].

Received April 20, 1994; revised June 21, 1995. Communicated by T. Lengauer.

Page 2: Multicommodity Flows in Even, Planar Networks

364 K. Weihe

Fig. 1.An instance with eight pairs of terminals.

for all {v,w} ∈ E (capacity constraints), and, fori = 1, . . . , k, f(·,·),i is an(si , ti )-flowwith total flow value di , that is,

∑w:{v,w}∈E

( f(v,w),i − f(w,v),i ) =di , v = si ,

−di , v = ti ,0, otherwise,

for v ∈ V (flow conservation conditions).

Algorithms. The problem can be solved in strongly polynomial time by means oflinear programming [T], since the polytope of all real-valued solutions is integral. Onthe other hand, Okamura and Seymour proved apurely combinatorialduality theorem[OS], which states that an instance is solvable if and only if no cut is oversaturated. Thatis, for every cut, the sum of all demands of source–target pairs separated by this cutdoes not exceed the capacity of this cut. All purely combinatorial algorithms known sofar rely on this theorem. Hassin was the first to give a purely combinatorial algorithm[H2], which requiresO(n4) time, wheren = |V |. The fastest algorithm in the literatureis due to Matsumotoet al. [MNS]. This algorithm requiresO(kn+ nT(n)) time, whereT(n) is the asymptotic complexity of Dijkstra’s shortest-path problem (i.e., single root,nonnegative arc lengths) in a planar graph withn vertices. Very recently,T(n) ∈ O(n)has been proved [KRRS].

A completely new approach to problems like this, which does not make use of thetheorem of Okamura and Seymour, has been introduced in [WW]. There only the spe-cial case is considered whereC{v,w} = 1 for each edge{v,w} ∈ E anddi = 1 fori = 1, . . . , k. In other words, the problem is to find edge-disjoint paths fromsi to ti ,respectively, in a planar graph with the additional restriction that the underlying graphbecomes Eulerian, when we add all edges{si , ti } to G. This special case is there solvedin linear time. Clearly, that result immediately yields a pseudopolynomial algorithm forthe generally capacitated case, simply by replacing each edge{v,w} ∈ E with as manyasC{v,w} copies, and each pair{si , ti }, with as many asdi copies.

In this paper now, we show that astronglypolynomial algorithm for the general casecan be derived from that approach as well. This algorithm requiresO(k ·T(n)) = O(kn)

Page 3: Multicommodity Flows in Even, Planar Networks

Multicommodity Flows in Even, Planar Networks 365

time. (Note that|E| ∈ O(n) for planar graphs, which makes a subquadratic worst-casebound possible.) Since the size of the output is obviously2(kn) in the worst case, thisalgorithm is asymptotically optimal.

Overview. The paper is organized as follows. In Section 2 we give all terminology weneed to state the algorithm. Then, in Section 3, we introduce the new algorithm itself.The worst-case boundO(kn) will be immediate. Finally, correctness of the algorithm isproved in Section 4.

The main idea of the correctness proof is to show that the algorithm introduced inthis paper fails only if thepseudopolynomial algorithm derived from [WW] fails, andthat otherwise the solutions constructed by both algorithms are closely related, althoughthese algorithms runcompletelydifferently. Since the algorithm in [WW] is correct, thenew algorithm is correct as well. Moreover, we use results by Hassin [H], by Kleinet al.[KRRS], and by Khulleret al. [KNK]. Nonetheless, the exposition is self-contained asfar as possible.

2. Preliminaries

Edges and Arcs. An undirected graph hasedges, and a directed graph hasarcs. Theedge connecting the verticesv andw is denoted by{v,w}, whereas the arc thatleavesvandentersw is denoted by(v,w). Beyond that, edges are denoted bye, e1, e2, . . . , andarcs, bya,a1,a2, . . . .

Embeddings in the Plane. We assume thatG is combinatorially embedded in the planesuch that all sources and all targets are on the boundary of a common face, whichis without loss of generality the infinite fact.Combinatoriallymeans that no genuinegeometricembedding must be known, only the sorting of all cyclic adjacency listsaccording to such an embedding. Note that each pair(v,w), (w, v) ∈ A→ may beembedded in two different ways: either as a clockwise or as a counterclockwise cycle.We assume that all those pairs are embedded as counterclockwise cycles.

There are linear-time algorithms for embedding a planar graph combinatorially. See[HT] for example. It is easy to see that any such algorithm provides, in linear time, anembedding ofG with all sources and all targets on the same face, when it is applied tothe graph that arises fromG by adding an additional vertexv, say, toV and all edges{v, si }, {v, ti } to E.

Standard Form. We now give a “standard form” for input instances, which simplifiesnotation in what follows. See Figure 2. Letsi0 be an arbitrarys-terminal, which is fixed inthe following. We use “x ≺ y” to denote thatx is seen beforey, when we walk aroundGonce counterclockwise, starting withsi0. If we haveti ≺ si for i 6= i0, then we exchangesi with ti . This exchange does not matter, since the problem is inherently undirected.Moreover, if we haveti ≺ tj for i > j , we exchange thei th pair with the j th pair.

To complete the standard form, we assume that alls-terminals are different from allt-terminals, and that all terminals have degree 1. This can be ensured as follows. Foreach vertexv ∈ V wheres-terminals (resp.t-terminals) are located, we add a new vertexw to V and an edge{w, v} to E, placew and{w, v} in the infinite face, and shift allthose terminals fromv tow. If there ares-terminalsand t-terminals placed onv, we add

Page 4: Multicommodity Flows in Even, Planar Networks

366 K. Weihe

Fig. 2. An instance (solid) that is completely equivalent to the instance in Figure 1, but is in the “standardform” defined in Section 2. The dashed edges are added toG in order to obtainG=. In terms of the definitionof G=, we havev1 = si0 = s3, v2 = s1 = s6, v3 = t1, v4 = s2 = s5, . . . , v13 = v` = tk = t8.

two new vertices adjacent tov to guarantee that alls-terminals are different from allt-terminals. The capacity of such a new edge{w, v} is the sum of all demands of terminalsat w. Clearly, this construction does not change the asymptotic input size. Moreover,we assume thatG\{s1, . . . , sk, t1, . . . , tk} is (vertex-)biconnected, because otherwise wecould alternatively solve one auxiliary subproblem for each biconnected component.

Graphs G= = (V, E=) and G⇒ = (V, A⇒). The graphG= = (V, E=) is constructedfrom G as follows. Letv1, . . . , v` be the vertices where terminals are located, in coun-terclockwise ordering, starting withsi0. See Figure 2. Letn(v) = j for v = vj . Forj = 1, . . . , ` − 1, we add an edge{vj , vj+1} to E. The capacityC{vj ,vj+1} is defined to

be D − Dj , whereD = ∑ki=1 di andDj =

∑{di : i = 1, . . . , k ∧ n(si ) ≤ j < n(ti )}.Let G⇒ = (V, A⇒) denote the directed graph that arises fromG= by replacing eachundirected edge with the two directed opposite arcs connecting the same endvertices.Again we assume that all cycles(v,w), (w, v) ∈ A⇒ are embeddedcounterclockwise.ThenA→ ⊂ A⇒, and each single-commodity flowf(·,·),i of a feasible solutionf in G→

can be extended to an(si0, tk)-flow in G⇒ by sendingdi units throughA⇒\A→ fromsi0 to si and fromti to tk. The resulting multicommodity flowf in G⇒ is feasible withrespect to the extended undirected capacities(C{v,w}){v,w}∈E= . (In the algorithm we go“the other way round,” fromG⇒ back toG→.)

Dual Graph G∗ = (V∗, A∗). See Figures 3 and 4. For each inner face ofG⇒, we haveone vertex inV∗. This includes each face surrounded by a pair(v,w), (w, v) ∈ A⇒.For the outer face, we have two dual vertices,r ∗ andu∗. We say thatr ∗ is incident toall arcs(vj , vj+1), and thatu∗ is incident to all other boundary arcs ofG⇒. For each arca ∈ A⇒, we have an arc inA∗, which connects the dual vertices incident toa and crossesa “from right to left.” Note thatG∗ is connected, sinceG= is biconnected. Hence, wehave|V∗| ∈ O(|A∗|) = O(|A|) ⊆ O(n).

Page 5: Multicommodity Flows in Even, Planar Networks

Multicommodity Flows in Even, Planar Networks 367

Fig. 3. The graphG⇒ (solid) and its two-source dual graphG∗ (dashed) for the instance of Figure 2. Thedirections of the arcs are not displayed. See Figure 4 for that.

Normalized Dual Weightings. In [H1], Hassin has shown that there is a one-to-onecorrespondence between(si0, tk)-flows inG⇒ andnormalizedweightings ofV∗, that is,integral weightingsπ of V∗ with π(r ∗) = 0. More precisely, a primal(si0, tk)-flow gcorresponds to a normalized weightingπ if and only if we haveπ(x∗)−π(y∗) = g(v,w)for all (v,w) ∈ A⇒, where(y∗, x∗) ∈ A∗ denotes the dual arc crossing(v,w), seeFigure 4. Notice thatπ(u∗) is the total flow value ofg. For two dual weightingsπ andπ ′, expressions likeπ ≤ π ′, π = π ′, andπ − π ′ are always to be read vertexwise.

Shortest Distance Weighting. For a∗ ∈ A∗, let L forwa∗ ≥ 0 and Lbackw

a∗ ≥ 0 be theforward and thebackward lengthof a∗. The shortest distancesπ from the rootr ∗ toall dual verticesz∗ ∈ A∗ with respect to these lengths can be determined in linear time[KRRS]. Clearly, this weightingπ is normalized. Since we have forwardandbackwardlengths, a shortest path fromr ∗ to z∗ may contain arcs in a forwardand a backwarddirection. It is well known thatπ is the vertexwisemaximumnormalized weighting with−Lbackw

(y∗,x∗) ≤ π(x∗) − π(y∗) ≤ L forw(y∗,x∗) for all (y∗, x∗) ∈ A∗ (see [AMO]). Moreover,

these conditions hold with equality along each shortest path fromw∗ to anyz∗ ∈ A∗,

Fig. 4. A single 2-cycle(v,w), (w, v) ∈ A⇒ and the two dual arcs crossing(v,w) and(w, v). Rememberthat all 2-cycles(v,w), (v,w) are embedded such that they form counterclockwise cycles.

Page 6: Multicommodity Flows in Even, Planar Networks

368 K. Weihe

which meansπ(x∗) − π(y∗) = L forw(y∗,x∗) for each forward arc(y∗, x∗) on such a path,

andπ(y∗)− π(x∗) = Lbackw(y∗,x∗) for each backward arc(y∗, x∗).

3. The Algorithm. A formal description is given in Table 1. Here we give aninformalexplanation. Essentially, the algorithm is a loop 1, . . . , k where in thei th iteration theflow f(·,·),i is determined. However, our algorithm works mainly onG⇒ andG∗, and theresults are restricted toG→ only afterwards. That is, we determinek single-commodity(si0, tk)-flows in G⇒, f = ( f(·,·),1, . . . , f(·,·),k), such thatf(·,·),i satisfies the followingProperties 3.1i with C{v,w} = C{v,w} −

∑i−1j=1( f(v,w), j + f(w,v), j ) for {v,w} ∈ E=.

PROPERTIES3.1. An integral weighting g of A⇒ satisfies Properties3.1i with respectto (C{v,w}){v,w}∈E= , if the following conditions are fulfilled:

1. The weighting g forms an(si0, tk)-flow.2. The total flow value of g is at most di .3. For (v,w) ∈ A⇒, we have g(v,w) ≥ 0.4. For {v,w} ∈ E=, we have g(v,w) + g(w,v) ≤ C{v,w}.5. The flow g sends all units of flow through A⇒\A→ from si0 to si and from ti to tk, and

through A→ from si to ti .

A normalized dual weighting is said to satisfy Properties3.1i , if the corresponding(si0, tk)-flow does so.

Clearly, if each single-commodity flowf(·,·),i satisfies these conditions withC asdefined above and has total flow valueexactly di , then f restricted toG→ is a solution tothe original problem inG. We will see that the flowf(·,·),i satisfies Properties 3.1i in anycase. So for correctness, it suffices to prove that the total flow value off(·,·),i equalsdi ,unless the input instance is unsolvable. It might be worth noticing that, in the correctnessproof, the evenness condition is used only for the latter task, namely, only to ensure thatthe pseudopolynomial algorithm from [WW] works correctly.

The idea for the construction off is to determine, in thei th iteration of the loop inthe main routine in Table 1, the normalized weightingπi of V∗ which corresponds tof(·,·),i . As a nice by-product, it is very easy to test for failure: The algorithm fails in thei th iteration if and only ifπi (u∗) < di (see main routine, statement no. 6b). To constructall weightingsπi , we first compute an auxiliary weightingπ in an overall preprocessingstep and, in thei th iteration, an auxiliary weightingπi .

Weightingπ and FlowF . Forz∗ ∈ V∗, the weightπ(z∗) is first initialized as the shortestdistance inG∗ from r ∗ to z∗ subject to the following arc lengths. For(y∗, x∗) ∈ A∗, weset Lbackw

(y∗,x∗) = 0 andL forw(y∗,x∗) = C{v,w}, where(v,w) ∈ A⇒ is the primal arc crossing

(y∗, x∗), see Figure 4. This weighting can be computed in linear time [KRRS]. Then,in view of Property 3.1i (4), we further reduce theπ -values of some vertices. Moreprecisely, let{v,w} ∈ E= and assume the situation in Figure 4. If necessary, we thenreduce the weight ofx∗ until [π(x∗)−π(y∗)]+[π(x∗)−π(z∗)] ≤ C{v,w}. In other words,we setπ(x∗) = min{π(x∗), b 1

2(C{v,w} + π(y∗) + π(z∗))c}. Applying this operation to

Page 7: Multicommodity Flows in Even, Planar Networks

Multicommodity Flows in Even, Planar Networks 369

every{v,w} ∈ E= gives the weightingπ . Henceforth, letF denote the(si0, tk)-flowcorresponding toπ .

Weightingπi . In thei th iteration, we first determine themaximumnormalized weight-ing πi that satisfies the following slight relaxation of Properties 3.1i with respect tocertaindirectedcapacitiesC, namely, withC(·,·) = F(·,·) −

∑i−1j=1 f(·,·), j .

PROPERTIES3.2 (Relaxation of Properties 3.1).An integral weighting g of A⇒ satisfiesthe relaxed Properties3.2i with respect todirected capacities(C(v,w))(v,w)∈A⇒ , if itsatisfies Properties3.1i (1)–(3) and (5), and a slight relaxation of Property3.1i (4),namely:

4′. For (v,w) ∈ A⇒, we have g(v,w) ≤ C(v,w).

Clearly, if πi satisfies Properties 3.2i with these directed capacities, thenπi alsosatisfies the properties we aim at, namely, Properties 3.1i with C{v,w} = C{v,w} −∑i−1

j=1( f(v,w), j + f(w,v), j ) for {v,w} ∈ E=, because we have reducedπ right so far

that F satisfies Property 3.1i (4) with C = C.To determineπi , we first compute the shortest distances fromr ∗ in G∗ subject to

certain backward and forward lengths of all arcs; since all these lengths are nonnegative,this can be done in linear time [KRRS]. More precisely, we setLbackw

(y∗,x∗) = 0 for each dualarc(y∗, x∗) ∈ A∗. To define the forward lengthL forw

(y∗,x∗) of (y∗, x∗), let (v,w) ∈ A⇒ bethe primal arc crossing(y∗, x∗), see Figure 4. ThenL forw

(y∗,x∗) is defined according to thecase distinction on(v,w)made in step 2 of Functionauxiliary weighting πi in Table 1.This case distinction implements Properties 3.1i (2) and (5) and Property 3.2i (4′).

After we have solved the shortest-path problem with rootr ∗ and with these lengths,each dual weight exceedingdi is reduced todi . The result is the weightingπi . Sinceπi

is determined from a shortest distance weighting by reducing all exceeding weights to aconstant, we still may conclude−Lbackw

(y∗,x∗) ≤ πi (x∗)−πi (y∗) ≤ L forw(y∗,x∗) for (y∗, x∗) ∈ A∗.

This means thatπi actually fulfills Properties 3.1i (3) and (5) and Property 3.2i (4′) withC(·,·) = F(·,·) −

∑i−1j=1 f(·,·), j for (v,w) ∈ A⇒. (Properties 3.1i (1)–(2) are trivial.)

The weightingπi , which we aim at, is vertexwise overestimated byπi . More precisely,πi is the vertexwise maximummonotonousweighting subject to Property 3.2i withC(·,·) = F(·,·) −

∑i−1j=1 f(·,·), j , where monotonous weightings are defined as follows.

Monotonous Dual Adjacency Sequences and Weightings. Anadjacency sequence(x∗1−x∗2 − · · · − x∗m) is an ordered sequence of dual vertices such that(x∗j , x∗j+1) ∈ A∗ or(x∗j+1, x∗j ) ∈ A∗ for j = 1, . . . ,m− 1. This adjacency sequence is calledmonotonouswith respect to a normalized weightingπ , if we haveπ(x∗j+1) ≥ π(x∗j ) for j = 1, . . . ,m− 1. The weightingπ is monotonous, if there is a monotonous adjacency sequencefrom r ∗ to x∗ and fromx∗ to u∗ for each dual vertexx∗ ∈ V∗.

Reduction Processπi → πi . The weightingπi is initialized equal toπi . We makeπi

the desired weighting by reducing the weights of a few dual vertices afterward. Note that,for eachx∗ ∈ V∗, there is a monotonous adjacency sequence fromr ∗ to x∗ with respectto πi , namely, any shortest path will do. (Recall thatπi (y∗) − πi (x∗) = Lbackw

(y∗,x∗) = 0for each backward arc(y∗, x∗) on such a path.) In Section 4.1 we show that, during the

Page 8: Multicommodity Flows in Even, Planar Networks

370 K. Weihe

reduction process, we make no monotonous adjacency sequence nonmonotonous. So,intuitively, it suffices to reduceπi until there is also a monotonous adjacency sequencefrom x∗ to u∗ for eachx∗ ∈ V∗. A vertex x∗ ∈ V∗ is said to beadjusted, onceπi isreduced so far that there is a monotonous adjacency sequence fromx∗ to u∗. Once avertex is adjusted, it never again becomes unadjusted. We reduce the weight of a vertex atmost once, namely, when we adjust it. (In general, reducing the weights ofsomeverticesalso adjustsothervertices, so we need not reduce the weights ofall vertices we adjust.)Obviously,r ∗ andu∗ and all dual vertices on each shortest(r ∗, u∗)-path are alreadyadjusted after the initialization (possibly other vertices, too).

Single Major Reduction Step forπi → π . Consider any stage of the reduction processwhere some vertices are not adjusted yet. For this stage, we choose an inclusion-maximalconnected componentC∗ of unadjusted dual vertices in the sense that two unadjusteddual verticesx∗ andy∗ belong to the same componentC∗ if and only if x∗ andy∗ areconnected by an adjacency sequence which consists entirely of unadjusted vertices. Letz∗ ∈ V∗ be an adjusted vertex that is adjacent to at least one vertex in the componentC∗ chosen. In particular, letz∗ be chosen such that no other adjusted vertex adjacent toC∗ has a largerπi -value. Then we determine two disjoint subsets ofC∗, sayC∗1 andC∗2.Intuitively, the setC∗1 is the “cluster” of all dual verticesx∗ ∈ C∗ with πi (x∗) ≥ πi (z∗)that “hangs on”z∗. More formally, this means thatC∗1 is inclusion-maximal such thatπi (x∗) ≥ πi (z∗) for x∗ ∈ C∗, and such thatC∗1 ∪ {z∗} is connected with respect toadjacency sequences. Note that each vertexx∗ ∈ C∗ that is adjacentto z∗ currentlyfulfills πi (x∗) > πi (z∗) and belongs, hence, toC∗1, because otherwisex∗ were alreadyadjusted viaz∗. The setC∗2 ⊆ C∗\C∗1 is the set of all dual verticesx∗ in C∗\C∗1 such thatthere is amonotonousadjacency sequence fromx∗ to some vertexy∗ ∈ C∗1 ∪ {z∗} whichbelongs entirely toC∗ ∪ {z∗}.

Once we have determinedC∗1 andC∗2 with respect toz∗, we reduce the weightπi (x∗)for eachx∗ ∈ C∗1 down toπi (z∗). This concludes one major reduction step. Obviously,all vertices inC∗1 and in C∗2 are now adjusted, and all vertices inC∗\(C∗1 ∪ C∗2) remainunadjusted. In particular, the weights of the dual vertices inC∗2 need not be reducedin this major reduction step, nor in any further one. Moreover, by choice ofz∗, thisprocedure obviously preserves another property forπi , which πi “inherits” from πi ,namely, that the weightingπi vertexwiseoverestimates all monotonous weightings thatsatisfy Properties 3.2i with C(·,·) = F(·,·) −

∑i−1j=1 f(·,·), j .

In Section 4.1 we show that, eventually, the weightingπi is monotonous, satisfiesProperties 3.2i (and hence Properties 3.1i ), and is vertexwise maximum subject to theseconditions. Here it remains to show how to implement the reduction process to run inlinear time.

Efficient Implementation of the Reductionπi → πi . Once a connected componentC∗ and a neighbored vertexz∗ with maximumπi -value are chosen, the setsC∗1 andC∗2with respect toz∗ can obviously be determined using an arbitrary graph search algorithm,which is linear in|C∗1∪C∗2| plus the number of arcs connectingC∗1∪C∗2 with V∗\(C∗1∪C∗2).As the setsC∗1 ∪ C∗2 are disjoint for the different major reduction steps, determiningC∗1andC∗2 and reducing the weights inC∗1 can be done in linear time forall the majorreduction stepsin total. Hence, it remains to show how to manage all theC∗ andz∗ forthe individual major reduction steps in linear time in total.

Page 9: Multicommodity Flows in Even, Planar Networks

Multicommodity Flows in Even, Planar Networks 371

Fig. 5. A connected componentC∗ of currently unadjusted dual vertices, the primal cyclew0 − w1 − · · · −wm−1−w0 with m= 7, and the verticesx∗j ∈ C∗ andy∗j ∈ V∗\C∗ incident towj andwj+1, for j = 1, . . . ,6.Orientations of primal and dual arcs are not displayed, since they do not matter. (It is not hard to see that(wj , wj+1) ∈ A⇒ and(y∗j , x∗j ) ∈ A∗ for j = 0, . . . ,m− 1.)

Let C∗ be a fixed maximal connected component of currently unadjusted vertices.As neitherr ∗ nor u∗ belongs toC∗, C∗ is separated fromV∗\C∗ by a closed adjacencysequencew0−w1− · · · −wm−1−w0 of G⇒. See Figure 5. Without loss of generality,we assume that the orderingw0, w1, . . . , wm−1, w0 is counterclockwise. Moreover, thissequence issimple, that is, any two verticeswj1 andwj2 with j1 6= j2 are different. Forconvenience, we always identifyj with ( j modm) around the cycle. Forj = 0, . . . ,m−1, letx∗j ∈ C∗ andy∗j ∈ V∗\C∗ denote the two dual vertices incident towj andwj+1.Without loss of generality, we haveπi (y∗0) ≥ πi (y∗j ) for j = 1, . . . ,m− 1.

For the connected componentC∗, we maintain this separating closed sequence as acyclic list with w0 being the entry point, and all these lists are collected in an objectS of an arbitrary data structure which allowsO(1) access to one of these lists withouthaving a choice (“blind” access; e.g., a stack or queue will do). So, it is trivial to access aconnected componentC∗ and a vertexz∗ suitable forC∗, namely, we may simply choosez∗ = y∗0. The real problem is how to maintain these cyclic lists and the entry pointsthroughout the individual major reduction steps. When we apply a major reduction stepto adjust some vertices in a connected componentC∗, say, then the vertices ofC∗ thatremain unadjusted partition into several connected components (possibly one or evenzero, ifall vertices ofC∗ are adjusted in this major reduction step).

To update the collection of cyclic lists, we have to remove the cycle representingC∗and then to insert each cycle that separates a connected component ofC∗\(C∗1 ∪C∗2) fromits complement. For this aim, consider the set of primal closed adjacency sequences thatseparateC∗1 ∪ C∗2 from its complement. (Clearly, in general,C∗1 ∪ C∗2 is separated from itscomplement by more than one cycle, because in contrast toC∗1∪C∗2 itself, the complementneed not be connected.) Then the set of cycles we have to insert is simply the symmetricdifference of the cycle separatingC∗ and, on the other hand, the set of cycles separatingC∗1 ∪ C∗2. Clearly, the set of cycles separatingC∗1 ∪ C∗2 from its complement come as aby-product of the graph searches that determineC∗1 andC∗2, and the symmetric differencewith the cycle aroundC∗ can be constructed by one pass through each cycle that separatesC∗1 ∪ C∗2 from some connected component of its complement. In summary, updating thecollection of cyclic lists between adjusted and unadjusted vertices takes additional time

Page 10: Multicommodity Flows in Even, Planar Networks

372 K. Weihe

linear in the number of arcs connectingC∗1∪C∗2 with V∗\(C∗1∪C∗2). Hence, the additionaloverhead for this task isO(|A∗|) ⊆ O(n) in total.

It remains to show how to find, for each new cyclic list, the appropriate entry point.The crucial fact for this task is proved in Section 4.1, Lemma 4.4. There we show thatthere is j0 ∈ {1, . . . ,m− 1} such thatπi (y∗0) ≥ πi (y∗1) ≥ · · · ≥ πi (y∗j0−1) ≥ πi (y∗j0)andπi (y∗j0) ≤ πi (y∗j0+1) ≤ · · · ≤ πi (y∗m−1) ≤ πi (y∗0). We use this fact as follows.Let w′0 − w′1 − · · · − w′µ−1 − w′0 be one of the new cyclic lists, separating one of theconnected components ofC∗\(C∗1 ∪ C∗2) from its complement. AsC∗1 ∪ C∗2 is connected,the verticesw′j shared with the cycle separatingC∗ form one (possible empty) intervalof the latter cycle, saywj1 − · · · − wj2. In this interval there are only three candidatesfor the entry point of the new cyclic list, namely,wj , wj2−1, andwj2. To see this, recallfrom the description of a single major reduction step that all immediate neighbors ofy∗0in C∗ belong toC∗1. Therefore, Lemma 4.4 implies that there is no “localπi -maximum”in y∗j1+1, . . . , y∗j2−2. More precisely, the maximumπi -value in the set{y∗j1, . . . , y∗j2−1} isattained aty∗j1 or at y∗j2−1. Consequently, to determine the entry points ofall new cycliclists simultaneously, we must, essentially, pass once again through the cycles separatingC∗1 ∪ C∗2. This can be done in linear timein total, too.

This completes the informal explanation of the algorithm. A formal description isgiven in Table 1. There we assume for convenience thatG,G→, E=, A⇒,G∗, etc., areglobal to all functions. Moreover, we use the terminology of Figure 4, wherever this

Table 1.Formal description of the algorithm (first page).

FUNCTION corresponding flow(π :normalized weighting);

1. FOR(v,w) ∈ A⇒ DOf(v,w) := π(x∗)− πi (x∗); // see Figure 4

2. return f ;

PROCEDUREextend capacities ();

1. D :=∑k

i=1 di ;2. D0 := 0;3. FOR j ∈ {1, . . . , `− 1} DO

(a) Dj := Dj−1+∑

i :si=vjdi −

∑i :ti=vj

di ;

(b) C{vj ,vj+1} := D − Dj ;

FUNCTION auxiliary weighting π ();

1. FOR(y∗, x∗) ∈ A∗ DO(a) Lbackw

(y∗,x∗) := 0;

(b) L forw(y∗,x∗) := C{v,w}; // see Figure 4

2.π := shortest distances(G∗, r ∗, L forw, Lbackw);

3. FOR{v,w} ∈ E= DO π(x∗) :=min{π(x∗), b 1

2(C{v,w}+π(y∗)+π(z∗))c};// see Figure 4

4. returnπ ;

FUNCTION auxiliary weighting πi (i :Integer);

1. FOR(y∗, x∗) ∈ A∗ DO Lbackw(y∗,x∗) := 0;

2. FOR(v,w) ∈ A⇒ DO // see Figure 4IF (v,w) = (vj , vj+1) for some

j ∈ {1, . . . , `− 1} THENIF n(si ) ≤ j < n(ti )

THEN L forw(y∗,x∗) := 0

ELSEL forw(y∗,x∗) := di

ELSEIF(v,w) = (vj+1, vj ) for somej ∈ {1, . . . , `− 1}

THEN L forw(y∗,x∗) := 0

ELSEIFv = si ORw = tiTHEN L forw

(y∗,x∗) := di

ELSEIFv ∈ {v1, . . . .v`} ORw ∈ {v1, . . . , v`}

THEN L forw(y∗,x∗) := 0

ELSE

L forw(y∗,x∗) := F(v,w) −

∑i−1j=1 f(v,w), j ;

3.π := shortest distances(G∗, r ∗, L forw, Lbackw);

4. FORx∗ ∈ V∗ DO π(x∗) := min{π(x∗), di };5. returnπ ;

Page 11: Multicommodity Flows in Even, Planar Networks

Multicommodity Flows in Even, Planar Networks 373

Formal description of the algorithm (second page).

FUNCTION initial separating lists(π :normalized nonnegative dual weighting);

1. S := ∅;2. apply a graph search fromu∗ in G∗ to label all

x∗ ∈ V∗ that can be reached fromu∗ by de-scendingmonotonous adjacency sequences;

3. FOR each inclusion-maximal componentC∗of unadjusted dual vertices connected with re-spect to adjacency sequences DO(a) let L be the cyclic adjacency sequence

separatingC∗ from V∗\C∗;(b) let z∗ ∈ V∗\C∗ be adjacent toC∗ and

have maximumπ -value among ally∗ ∈V∗\C∗ adjacent toC;

(c) let entry point(L) ∈ L be such thatz∗is incident toentry point(L) and to itscounterclockwise successor onL;

4. returnS;

PROCEDUREapply major reduction step(π :normalized nonnegative dual weighting);

1. choose listL ∈ Sblindly;2. extractL from S;3. let C∗ be the set of dual vertices surrounded

byL;4. let z∗ ∈ V∗\C∗ such thatz∗ is incident to

entry point(L) and to its counterclockwisesuccessor onL;

5. apply a graph search fromz∗ in {z∗} ∪ C∗ todetermine the inclusion-maximal setC∗1 ⊆ C∗such thatπ(x∗) ≥ π(z∗) for x∗ ∈ C andC∗1 ∪{z∗} is connected with respect to adjacencysequences;

6. apply a graph search inC∗\C∗1 simultaneouslyfrom all elements ofC∗1 that are adjacent toC∗\C∗1 to determine the setC∗2 of all x∗ ∈C∗\C∗1 that can be reached fromC∗1 by de-scendingmonotonous adjacency sequences;

7. FORx∗ ∈ C∗1 DO π(x∗) := π(z∗);8. letL1, . . . ,Lµ be the adjacency sequences of

G⇒ separatingC∗1 ∪ C∗2 from V∗\(C∗1 ∪ C∗2);

9. letL′1, . . . ,L′ν be the noncrossing, simple cy-

cles forming the symmetric difference ofLwith

⋃Lj ;

10. insertL′1, . . . ,L′ν in S;

11. FOR j = 1, . . . , ν DO// L′j ∩ L andL′j \L are intervals ofL′j .

(a) letz∗1 ∈ (V∗\C∗) ∪ C∗1 ∪ C∗2 be incidenttoL′j \L such thatπ(z∗1) is maximum;

(b) let z∗2 ∈ (V∗\C∗) ∪ C∗1 ∪ C∗2 be incidentto one of the endvertices ofL′j ∩ L such

thatπ(z∗2) is maximum;(c) IF π(z∗1) ≥ π(z∗2) THEN z∗ := z∗1

ELSEz∗ := z∗2;(d) let entry point(L′j ) ∈ L′j such thatz∗

is incident toentry point(L′j ) and to its

counterclockwise successor onL′j ;FUNCTION reduced weighting

(π :normalized nonnegative dual weighting):

1. S := initial separating lists(π);2. WHILE S 6= ∅ DO

apply major reduction step (π);3. returnπ ;

MAIN ROUTINE

1. transformG = (V, E) into standard form;// see Section 2

2. constructG→ = (V, A→), G= = (V, E=),andG⇒ = (V, A⇒) from G;

3. extend capacities ();4. construct the two-source dual graphG∗ =(V∗, A∗) from G⇒;

5. π := auxiliary weighting π ();6. FORi := 1, . . . , k DO

(a) π := auxiliary weighting πi (i );(b) IF πi (u∗) < di

THEN return “unsolvable”;(c) πi := reduced weighting(πi );(d) F(·,·),i := corresponding flow(πi );

7. return f ;END MAIN ROUTINE.

simplifies the presentation. Theorem 3.3 following is an immediate consequence of theinformal explanation.

THEOREM3.3. Using the algorithm from[KRRS] for the shortest path computations,the preprocessing and each iteration of the loop in the main routine in Table1 requiresO(n) time. In particular, the entire algorithm takesO(kn) time.

Page 12: Multicommodity Flows in Even, Planar Networks

374 K. Weihe

4. Correctness. The proof consists of three parts. First, we prove that, fori = 1, . . . , k,the dual weightingπi is actually vertexwise maximum among all normalized dual weight-ings that are monotonous and satisfy Properties 3.2i with C(·,·) = F(·,·) −

∑i−1j=1 f(·,·), j .

(Recall that this suffices forπi to satisfy Properties 3.1i with C{v,w} = C{v,w} −∑i−1

j=1( f(v,w), j + f(w,v), j ) for {v,w} ∈ E=.) Second, we use this result to characterize the cor-responding(si0, tk)-flow f(·,·),i itself uniquely. Third, we show thatf(·,·),i is intimatelyrelated to the flowf ∗(·,·),i constructed for thei th commodity by the pseudopolynomialalgorithm from [WW] (see the Introduction, discussion of algorithms), and we concludecorrectness of theO(kn) algorithm from the fact that the algorithm in [WW] is correct.Each of the following three subsections is devoted to one of these tasks.

4.1. Characterization of the Dual Weightingπi . We have to show two things: Firstly,the repeated application of major reduction steps as described in the informal explana-tion in Section 3 actually yields the maximum monotonous weighting satisfying Proper-ties 3.2i with C(·,·) = F(·,·) −

∑i−1j=1 f(·,·), j for (v,w) ∈ A⇒; this is finally concluded in

Corollary 4.3. Secondly, the efficient implementation of the reduction process correctlyimplements the repeated application of major reduction steps; this is done in Lemma 4.4.

We need the following two auxiliary lemmas to prove thatπi is monotonous.

LEMMA 4.1. For each(y∗, x∗) ∈ A∗, the differenceπi (x∗) − πi (y∗) is monotonouslydecreasing during the reduction process, but does not become negative.

PROOF. By induction on the major reduction steps. The basis of the induction followsfrom Property 3.1i (3) for πi . So suppose the claim is true in the situation immediatelybefore some major reduction step. LetC∗, vertexz∗, C∗1 andC∗2 be defined for this, fixed,step according to the informal explanation of major reduction steps in Section 3. Forthe remainder of this proof,πi refers to the current weights in the situation immediatelybefore the major reduction step we are focusing on. We have to prove that the claim isalso true immediatelyafter this major reduction step, that is, when the weights of allverticesx∗ ∈ C∗1 are reduced down toπi (z∗). We make a case distinction.

Case1: x∗ ∈ C∗1 and y∗ ∈ C∗1. Thenx∗ and y∗ have equalπi -value after the majorreduction step we are focusing on (namely, equal toπi (z∗)), which trivially implies theinduction step.

Case2: x∗ 6∈ C∗1 and y∗ 6∈ C∗1. Then nothing has changed for(y∗, x∗) at all.

Case3(a): x∗ ∈ C∗1 and y∗ ∈ C∗\C∗1. By definition ofC∗1, we haveπi (x∗) ≥ πi (z∗).Moreover, inclusion-maximality ofC∗1 impliesπi (y∗) < πi (z∗), and hence 0≤ πi (z∗)−πi (y∗) ≤ πi (x∗) − πi (y∗). As the weight ofx∗ is reduced toπi (z∗) and the weight ofy∗ is not changed, the induction step follows.

Case3(b): x∗ ∈ C∗1 and y∗ 6∈ C∗. Then y∗ is one of the vertices outsideC∗ thatare adjacent to at least one vertex insideC∗. By the specific choice ofz∗, we have

Page 13: Multicommodity Flows in Even, Planar Networks

Multicommodity Flows in Even, Planar Networks 375

πi (y∗) ≤ πi (z∗), and by definition ofC∗1, we haveπ(x∗) ≥ πi (z∗). Again, this yields0≤ πi (z∗)− πi (y∗) ≤ πi (x∗)− πi (y∗).

Case4(a): y∗ ∈ C∗1 and x∗ ∈ C∗/C∗1. By induction hypothesis, we haveπi (x∗) ≥πi (y∗). Hence, the assumptiony∗ ∈ C∗1 impliesπi (x∗) ≥ πi (z∗), and since(y∗, x∗) isan adjacency sequence,x∗ 6∈ C∗1 contradicts inclusion-maximality ofC∗1.

Case4(b): y∗ ∈ C∗1 and x∗ 6∈ C∗. Again, we concludeπi (x∗) ≥ πi (y∗) from theinduction hypothesis andπi (y∗) ≥ πi (z∗) from the assumptiony∗ ∈ C∗1. However,the specific choice ofz∗ now impliesπi (z∗) ≥ πi (x∗). In summary, we obtain 0=πi (z∗)− πi (y∗) = πi (x∗)− πi (z∗).

LEMMA 4.2. At any stage of the reduction processπi → πi , there is a monotonousadjacency sequence from any adjusted vertex to u∗ that consists solely of adjustedvertices.

PROOF. By an easy induction on the major reduction steps. The basis of the inductionmight be immediate. For the induction step, consider the situation immediately afteran arbitrary, but fixed major reduction step. For a dual vertex that has been adjusted inan earlier major reduction step or even in the beginning of the reduction process, theinduction step is trivial, since theπi -values of adjusted vertices are never changed again.So consider a dual vertexx∗ ∈ V∗ that is adjusted right in this major reduction step.Let the setC∗, the vertexz∗, and the setsC∗1 andC∗2 be defined for this step accordingto the informal explanation of major reduction steps in Section 3. Thenx∗ ∈ C∗1 ∪ C∗2.Obviously, after this major reduction step, there is a monotonous adjacency sequencefrom x∗ to z∗ which goes entirely throughC∗1 ∪C∗2 ∪{z∗}. Clearly, this sequence consistssolely of adjusted vertices. By induction hypothesis, this sequence can be continued fromz∗ to u∗. This proves the induction step.

COROLLARY 4.3. The final weightingπi is monotonous and satisfies Properties3.2i

with C(·,·)= F(·,·) −∑i−1

j=1 f(·,·), j , and is maximum subject to these conditions.

PROOF. Everynormalized weighting trivially satisfies Properties 3.1i (1), and so doesthe final weightingπi . Moreover, because ofπi (u∗) = πi (u∗), the weightingπi “inherits”Property 3.1i (2) from πi . Furthermore, Lemma 4.1 immediately implies thatπi inheritsProperties 3.1i (3) and (5) and Property 3.2i (4′) from πi , too.

Note that Lemma 4.1 also implies that the final weightingπi inherits all monotonousadjacency sequences fromπi . In particular, there is a monotonous adjacency sequencefrom r ∗ to any dual vertexx∗ ∈ V∗ with respect toπi , namely, any shortest(r ∗, x∗)-pathwith respect to the forward and backward lengths defined to determineπi . Eventual ex-istence of a monotonous adjacency sequence fromx∗ to u∗ is an immediate consequenceof Lemma 4.2.

By the respective choice ofz∗ in each major reduction step,πi obviously overesti-mates, vertexwise, all monotonous weightings that satisfy Properties 3.2i . This provesmaximality.

Page 14: Multicommodity Flows in Even, Planar Networks

376 K. Weihe

At this point of the proof, we know that repeated application of major reduction steps,as explained informally in Section 3, actually results in the weightingπi we want toconstruct. It remains to show that the efficient implementation discussed afterward inSection 3 is correct. Remember that this discussion has left only one gap to fill in, namely,Lemma 4.4 following.

LEMMA 4.4. At any fixed stage of the reduction process, letC∗ be an inclusion-maximalconnected component of unadjusted vertices. Assume the situation in Figure5, andassumeπi (y∗0) ≥ πi (y∗j ) for j = 1, . . . ,m− 1. Then there is j0 ∈ {1, . . . ,m− 1} suchthat πi (y∗0) ≥ πi (y∗1) ≥ · · · ≥ πi (y∗j0−1) ≥ πi (y∗j0) andπi (y∗0) ≥ πi (y∗m−1) ≥ · · · ≥πi (y∗j0+1) ≥ πi (y∗j0).

PROOF. Suppose for a contradiction that no suchj0 exists. Then there arej1, j2, j3, j4 ∈{0, . . . ,m− 1} such thatj1 < j2 < j3 < j4, andπi (y∗jµ) > πi (y∗jν ) for µ ∈ {1, 3} andν ∈ {2, 4}. (Just choosej1 = 0.) Forµ = 1, . . . ,4, there is a monotonous adjacencysequencepµ from r ∗ to y∗jµ with respect to the current weightingπi ; this follows fromLemma 4.1 (namely, any sequence monotonous with respect toπi .) Moreover, there isa monotonous adjacency sequenceqµ from y∗jµ to u∗ because of Lemma 4.2.

First note that none of the sequencesp1, . . . , p4,q1, . . . ,q4 goes throughC∗, for thefollowing reason. Suppose, for example, thatp1 contains a vertexx∗ ∈ C∗. (For theother paths, the argument is analogous.) Then the concatenation of the subsequence ofp1 from x∗ to y∗j1 with the whole sequenceq1 yields a monotonous adjacency sequencefrom x∗ to u∗, and the other subsequence ofp1 is a monotonous adjacency sequencefrom r ∗ to x∗. This contradicts the assumptionx∗ ∈ C∗.

Now we know that none of these eight adjacency sequences goes throughC∗. Bydefinition ofC∗ and of the verticesy∗j , there is an adjacency sequencep that connectsy∗j2with y∗j4 and goes entirely throughC∗. The concatenation ofp2, p, andp4 forms a cycle,which separatesy∗j1 from y∗j3. In particular, this cycle separates one ofy∗j1 andy∗j3 from u∗,sayy∗j1. As q1 does not go throughC∗, q1 crosses at least one ofp2 andp4, sayq1 meetsp2 at vertexx∗. Sinceq1 and p2 are monotonous, we haveπi (y∗j1) ≤ πi (x∗) ≤ πi (y∗j2),which contradicts the choice ofj1 and j2.

4.2. Characterization of the Primal Flow f(·,·),i . The aim of this subsection is to proveTheorem 4.5, which we state after all necessary terminology is given.

More Right. Remember that a path is calledsimpleif it meets no vertex more thanonce. Letp andq be two simple paths fromsi0 to tk in G⇒. Then each ofp andq,respectively, dividesG∗ and the rest ofG⇒ into a left side(or u∗-side) and aright side(or r ∗-side), where the paths are seen fromsi0 to tk. The pathp is said to bemore rightthanq, if p 6= q and p is disjoint from the left side ofq. In other words, the right sideof p is a proper subset of the right side ofq. Note that, nonetheless,p andq may havevertices and even arcs in common. In particular, the pathsp andq do not cross eachother if and only ifp is more right thanq or vice versa.

Simple Path Packings. Let g be an(si0, tk)-flow in G⇒. It is well known (see [AMO])thatg can be decomposed into a set of(si0, tk)-paths and a set of cycles in the sense thatg(v,w) is the total number of paths and cycles containing arc(v,w). We callg a simple

Page 15: Multicommodity Flows in Even, Planar Networks

Multicommodity Flows in Even, Planar Networks 377

path packingif g can be decomposed into a set of simple(si0, tk)-paths that do not crosseach other. It is easy to see that this decomposition is unique (except for permutationsof the paths, of course). Letg1 andg2 be two simple path packings fromsi0 to tk, andlet p1, . . . , pm1 andq1, . . . ,qm2 be the decompositions ofg1 andg2 into simple(si0, tk)-paths, respectively. Without loss of generality, each pathpj (resp.qj ) is equal to or moreright thanpj+1 (resp.qj+1). We say thatg1 is more rightthang2, if g1 6= g2, m1 ≥ m2,and each pathqj is equal to or more left than the corresponding pathpj .

Now we are able to formulate the heart of this subsection.

THEOREM4.5. For i = 1, . . . , k, the weighting f(·,·),i of A⇒ is the rightmost simplepath packing in G⇒ from si0 to tk among all(si0, tk)-flows which fulfill Properties3.2i

with C(·,·) = F(·,·) −∑i−1

j=1 f(·,·), j . In particular, f(·,·),i satisfies Properties3.1i with

C{v,w} = C{v,w} −∑i−1

j=1( f(v,w), j + f(w,v), j ) for {v,w} ∈ E=.

The proof of Theorem 4.5 is divided into several lemmas, but first we need thefollowing notion.

Borderline of Crucial Partition. Let(V∗1 ,V∗\V∗1 ) be a partition ofV∗ into two disjointsubsets. We call this partitioncrucial if r ∗ ∈ V∗1 and u∗ ∈ V∗\V∗1 , and if we have(y∗, x∗) ∈ A∗ for any two adjacent verticesy∗ ∈ V∗1 andx∗ ∈ V∗\V∗1 (i.e., we donothave(x∗, y∗) ∈ A∗). If (V∗1 ,V∗\V∗1 ) is crucial,V∗1 andV∗\V∗1 are separated from eachother by exactly one directed(si0, tk)-path inG⇒ and, possibly, some additional directedcycles inG⇒, which are edge-disjoint from this(si0, tk)-path and from each other. Wecall the union of this path and these cycles theborderlinebetweenV∗1 andV∗\V∗1 .

LEMMA 4.6. For any crucial partition (V∗1 ,V∗\V∗1 ), the borderline is one simple(si0, tk)-path if and only if each of V∗1 and V∗\V∗1 is connected in the sense that any twodual vertices in the same partition set, V∗1 or V∗\V∗1 , are connected by an adjacencysequence that does not cross the borderline.

PROOF. For theonly if part, note that each dual vertex on ther ∗-side of a simple(si0, tk)-path p is connected withr ∗ by an adjacency sequence that does not crossp, and thatlikewise each dual vertex on theu∗-side is connected withu∗ by an adjacency sequencethat does not crossp. For theif part, let p be a simple(si0, tk)-path in the borderlinebetweenV∗1 and V∗\V∗1 . If each vertex ofV∗1 is connected withr ∗ by an adjacencysequence, the borderline cannot contain cycles on theu∗-side of p; and, analogously, ifeach vertex ofV∗\V∗1 is connected withu∗ by an adjacency sequence, the borderlinecannot contain cycles on ther ∗-side ofpeither. Hence, in this case the borderline containsno cycles at all, which proves the claim.

LEMMA 4.7. Any dual monotonous weightingπ withπ(x∗) ≥ π(y∗) for (y∗, x∗) ∈ A∗

corresponds to a simple path packing.

PROOF. Letπ be monotonous. Then 0= π(r ∗) ≤ π(x∗) ≤ π(u∗) for all dual verticesx∗ ∈ V∗. For j = 1, . . . , π(u∗), let V∗j denote the set of all dual verticesx∗ ∈ V∗ such

Page 16: Multicommodity Flows in Even, Planar Networks

378 K. Weihe

thatπ(x∗) < j . Then(V∗j ,V∗\V∗j ) is a crucial partition, becauseπ(x∗) > π(y∗) foradjacent verticesy∗ ∈ V∗j , x∗ ∈ V∗\V∗j . Asπ is monotonous,r ∗ is connected with eachx∗ ∈ V∗j by an adjacency sequence that belongs entirely toV∗j , and eachx∗ ∈ V∗\V∗jis connected withu∗ by an adjacency sequence that belongs entirely toV∗\V∗j . ByLemma 4.6, the borderline betweenV∗j and V∗\V∗j is a simple(si0, tk)-path pj , say.All paths p1, . . . , pπ(u∗) together form a decomposition of the flow corresponding toπ ,which proves the claim.

LEMMA 4.8. Any simple path packing from si0 to tk in G⇒ corresponds to a monotonousdual weightingπ with π(x∗) ≥ π(y∗) for (y∗, x∗) ∈ A∗.

PROOF. Letg be a simple path packing, letπ be the dual weighting corresponding tog,and letp1, . . . , pm be the (unique) decomposition ofg into simple paths such that no twopaths cross each other. Without loss of generality, each pathpj is equal to or more rightthanpj+1. LetV∗j denote the set of all dual vertices on ther ∗-side ofpj . A straightforwardinduction onµ = 1, . . . , j shows thatV∗j is exactly the set of all dual verticesx∗ ∈ V∗

such thatπ(x∗) < j . By Lemma 4.6, each vertexx∗ ∈ V∗j is connected withr ∗ byan adjacency sequence which entirely belongs toV∗j . Forµ = 1, . . . , j − 1, let x∗µ bethe last vertex of this adjacency sequence seen fromr ∗. Applying Lemma 4.6 to eachµ = j − 1, . . . ,1 in thisorder yields that without loss of generality the subsequence ofthis adjacency sequence betweenr ∗ andx∗µ belongs entirely toV∗µ . However, this meansthat the sequence is monotonous in the direction fromr ∗ to x∗. Analogously, we canconstruct a monotonous sequence fromx∗ to u∗. This proves the claim.

LEMMA 4.9. Let g1 and g2 be two simple path packings from si0 to tk, and let the dualmonotonous weightingsπ1 andπ2 correspond to g1 and g2, respectively. If π1 ≥ π2,then g1 is more right than g2.

PROOF. Let p1, . . . , pm1 andq1, . . . ,qm2 be the (unique) decompositions ofg1 andg2

into simple paths. Without loss of generality, each pathpj is equal to or more right thanpj+1, and each pathqj is equal to or more right thanqj+1. A straightforward inductionon j = 1, 2, 3, . . . shows that the pathsp1, . . . , pπ1(x∗) havex∗ on their left sides, andthat the pathspπ1(x∗)+1, . . . , pm1 havex∗ on their right sides. Analogously, all pathsq1, . . . ,qπ2(x∗) havex∗ on their left sides, and all pathspπ2(x∗)+1, . . . ,qm2 havex∗ ontheir right sides. This immediately givesm1 = π1(u∗) ≥ π2(u∗) = m2. Moreover,suppose for a contradiction that, for somej ∈ {1, . . . ,m2}, qj is not equal to or moreleft than pj . Then there isx∗ ∈ V∗ such thatpj hasx∗ on its right side, andqj hasx∗

on its left side. This impliesπ1(x∗) < j ≤ π2(x∗), which contradicts the assumptionπ1 ≥ π2.

COROLLARY 4.10. Theorem4.5 is an immediate consequence of Corollary4.3 andLemmas4.7–4.9.

4.3. Relation to the Pseudopolynomial Algorithm. Remember from the Introductionthat the algorithm in [WW] can be extended to the capacitated case (at the cost of losing

Page 17: Multicommodity Flows in Even, Planar Networks

Multicommodity Flows in Even, Planar Networks 379

Fig. 6.A directed path that does not cross itself, but is not simple either. The interiors of the cycles on the rightside belong to the left side of the path and vice versa.

proper polynomiality, though). In this, final, subsection, we conclude correctness oftheO(kn) algorithm introduced in this paper from correctness of the pseudopolynomialalgorithm, which in turn immediately follows from correctness of the algorithm in [WW]for the unit case.

First we briefly review the pseudopolynomial algorithm. This algorithm consists oftwo phases, too. We only describe theresultsof the two phases (Propositions 4.11 and4.12). The pseudopolynomial algorithm works onG. However, for a more uniformexposition, we “translate” the results of the two phases intoG⇒. In the first phase an(si0, tk)-flow F∗ is constructed, and, usingF∗ as an additional, auxiliary input, the secondphase either detects that the input instance is insolvable, or returns one(si0, tk)-flow f ∗(·,·),ifor each commodityi = 1, . . . , k. (F∗ is the capacitated version of what is called theauxiliary graphin [WW]). To characterize these flows, we need some more terminology.

Noncrossing Paths and Path Packings. A directed(si0, tk)-path is callednoncrossing,if it does not cross itself. An(si0, tk)-flow is anoncrossing path packingif it decomposesinto (si0, tk)-paths that cross neither themselves nor each other. It is important to realizethat a path that does not cross itself may not be simple. However, the vertex where acycle of such a path is closed isno crossing of this path. See Figure 6. Since the rightand left sides of a noncrossing path are well defined, the definition “more right” literallyextends from simple paths and path packings to noncrossing ones.

A path that does not cross itself may even contain cycles of length 2, that is, pairs(v,w), (w, v). Whether or not such a pair may be inserted in a noncrossing path withoutenforcing a crossing, depends highly on the common embedding of the pair. Rememberfrom Section 2 that all such pairs inA⇒ are assumed to be commonly embedded suchthat they form counterclockwise cycles. Proposition 4.11 following is the only point inour proof where we need this assumption.

PROPOSITION4.11. The flow F∗ constructed in the first phase of the pseudopolynomialalgorithm is the rightmost noncrossing path packing from si0 to tk with total flow valueat most

∑li=1 di subject to the restriction F∗(v,w) + F∗(w,v) ≤ C{v,w} for {v,w} ∈ E=.

Note that the following proposition parallels Theorem 4.5.

PROPOSITION4.12. For i = 1, . . . , k, the flow f∗(·,·),i returned by the pseudopolynomialalgorithm for the ith commodity is the rightmost noncrossing path packing among all(si0, tk)-flows that satisfy Properties3.2i with C(·,·) = F∗(·,·) −

∑i−1j=1 f ∗(·,·), j .

Page 18: Multicommodity Flows in Even, Planar Networks

380 K. Weihe

In [WW] it is shown thatF∗ contains no clockwise cycle, which means that anyclockwise directed cycle inG⇒ contains at least one arc(v,w) with F∗(v,w) = 0. Thecrucial point for our purposes (Proposition 4.13) is that the second phase also workswhen it gets another flowF as auxiliary input, providedF shares this and the followingproperty withF∗.

Cuts and Cut Condition. A setV ′ ⊂ V of vertices such thatV ′ 6= ∅ andV\V ′ 6= ∅is called acut (and often identified with the set of arcs pointing fromV ′ to V\V ′). Thecapacityof cutV ′ with respect to an(si0, tk)-flow F is the sum of the valuesF(v,w) of allarcs ofA→ (not of A⇒!) that point fromV ′ to V\V ′. Thedensityof cut V ′ is the sumof all valuesdi such thatsi ∈ V ′ andti ∈ V\V ′. A cut is calledsaturatedwith respectto flow F if its density equals its capacity, andoversaturatedif its density even exceedsits capacity. An(si0, tk)-flow F fulfills the cut condition, if no cut is oversaturated withrespect toF .

PROPOSITION4.13. Let F be an(si0, tk)-flow that contains no clockwise cycles. Whenthe second phase of the pseudopolynomial algorithm gets F(instead of F∗) as theadditional auxiliary input, then it returns a feasible solution f∗(·,·),1, . . . , f ∗(·,·),k if and onlyif F fulfills the cut condition. More precisely, each single-commodity flow f∗(·,·),i is therightmost noncrossing path packing among all(si0, tk)-flows that satisfy Properties3.2i

with C(·,·) = F(·,·) −∑i−1

j=1 f ∗(·,·), j .

PROOF. If the second phase of the pseudopolynomial algorithm fails to produce afeasible solution, it returns a cut inG as a certificate for unsolvability [WW]. The originalintent of this procedure is to certify that the original undirected instance is unsolvable.For this purpose, a cut is returned that is oversaturated in theundirectedsense. However,the cut constructed in [WW] is first of all adirectedcut in G→, and the fact that the cutis oversaturated in theundirectedsense is only concluded from the fact that the cut isoversaturated in thedirectedsense defined above. The only property ofF needed for theproof is that it contains no clockwise cycle.

This completes our brief description of the algorithm in [WW]. The following lemmastarts filling in the gap between the pseudopolynomial algorithm and theO(kn) algo-rithm.

LEMMA 4.14. For (v,w) ∈ A⇒, we haveF(v,w) ≥ F∗(v,w).

PROOF. Let F∗∗ be the rightmost noncrossing path packing fromsi0 to tk with totalflow value at most

∑ki=1 di subject toF∗∗(v,w) ≤ F(v,w) for (v,w) ∈ A⇒. We will show

F∗ = F∗∗, which clearly proves the claim. Note thatF∗ 6= F∗∗ means thatF∗ is moreright thanF∗∗, because the conditions subject to whichF∗ is rightmost are a relaxationof the corresponding conditions forF∗∗.

Let p1, . . . , pm1 andq1, . . . ,qm2 be decompositions ofF∗ andF∗∗, respectively, intopaths that cross neither themselves nor each other. Without loss of generality, each pathpj (resp.qj ) is equal to or more right thanpj+1 (resp.qj+1). Moreover, letπ∗ be thenormalized dual weighting corresponding toF∗. In the situation of Figure 4, we have

Page 19: Multicommodity Flows in Even, Planar Networks

Multicommodity Flows in Even, Planar Networks 381

[π∗(x∗) − π∗(y∗)] + [π∗(x∗) − π∗(z∗)] ≤ C{v,w}. This impliesπ∗ ≤ π , becauseπ isobviously the vertexwise maximum normalized dual weighting fulfilling this propertyfor all {v,w} ∈ E=. It suffices to show thatm1 ≤ m2, and that no pathpj is moreright thanqj . First note thatm2 ≥ min{π(u∗),∑k

i+1 di }, because we can find as manyasπ(u∗) paths fromsi0 to tk in any decomposition ofF , and the induced packing canbe reduced to a noncrossing path packing consisting of as many as min{π(u∗),∑k

i+1 di }paths, which isnot more left thanF∗∗ if m2 < min{π(u∗),∑k

i+1 di }, a contradictionto the definition ofF∗∗. This fact immediately givesm1 ≤ m2, because using the fact∑k

i+1 di ≥ π∗(u∗) = m1, the assumptionm1 > m2 would imply m2 <∑k

i+1 di , whichmeansm2 = π(y∗), and hence,π∗(u∗) = m1 > m2 = π(u∗). However, this resultcontradictsπ ≥ π∗.

It remains to show that no pathpj is strictly more right thanqj . Suppose for acontradiction that some pathpj is more right thanqj . Then there isz∗ ∈ V∗ such thatz∗

is on the right side ofqj and on the left side ofpj . The latter fact meansπ∗(z∗) ≥ j . Ofcourse, we may choosez∗ such thatz∗ is incident to an arc ofqj from the right side. Nowlet µ ≤ j be minimum such that there is a dual vertexz∗0 ∈ V∗ incident toqµ from theright side withπ∗(z∗0) ≥ µ. We will showπ(z∗0) < µ, which again contradictsπ ≥ π∗.

Assume for a contradiction thatπ(z∗0) ≥ µ. Let C∗ be the inclusion-maximal con-nected component with respect to adjacency sequences such that all verticesx∗ ∈ C∗ areon the right side ofqµ and fulfill π(x∗) ≥ µ, and such thatz∗0 belongs toC∗. Let V∗0 bethe set of all dual vertices on the right side ofqµ that do not belong toC∗. In particular,we haver ∗ ∈ V∗0 andu∗ ∈ V∗\V∗0 . Let y∗ ∈ V∗0 andx∗ ∈ V∗\V∗0 be adjacent. Ifx∗ ison the left side ofqµ, we have(y∗, x∗) ∈ A∗ (i.e., (x∗, y∗) 6∈ A∗), because we cross anarc ofqµ from right to left when we step over from the right side ofqµ to its left side.On the other hand, ifx∗ ∈ C∗, we have(y∗, x∗) ∈ A⇒, too, becauseπ(x∗) ≥ j , andinclusion-maximality ofC∗ implies π(y∗) < j , so(x∗, y∗) ∈ A∗ contradicts nonnega-tivity of F . In summary,V∗0 is separated fromV∗\V∗0 by a simple, directed(si0, tk)-pathq′µ, say, inG⇒ and, possibly, some directed cycles inG⇒ that are edge-disjoint fromq′µand from each other.

Note thatq′µ is strictly more right thanqµ, becauseq′µ hasC∗ 6= ∅ on its left side.Hence,q′µ crosses no pathqν with ν > µ. Moreover,q′µ crosses no pathqν with ν < µ,either, for the following reason. By the specific choice ofµ, no pathqν with ν < µ isincident from the right side to a dual vertexx∗ with π(x∗) ≥ ν. In particular,qν is notincident to any dual vertex inC∗ from the right side. Therefore,qν has all dual vertices inC∗ on its left side, because otherwiseqν must meet the left side ofqµ to avoid the contactwith C∗ from the right side. However, this contradicts the assumptionν < µ. Hence,C∗is on the left side ofqν , and thusq′µ does not crossqν .

At this point we know thatq1, . . . ,qµ−1,q′µ,qµ+1, . . . ,qm induces a noncrossing pathpackingF ′ that is more right thanF∗∗. So for our overall contradiction, it suffices to showthat F ′(v,w) ≥ F(v,w) for (v,w) ∈ A⇒. For this, we only have to showF∗∗(v,w) < F(v,w)for each arc ofq′µ that does not belong toqµ. To see this, let(v,w) be an arc belongingto q′µ, but not toqµ. Let (y∗, x∗) ∈ A∗ be the dual arc crossing(v,w). Then we havey∗ ∈ V∗0 and x∗ ∈ C∗, and we have to showF∗∗(v,w) < π(x∗) − π(y∗). As (v,w) ison the right side ofqµ, none of the pathsqµ+1, . . . ,qm2 contains(v,w). If none of thepathsq1, . . . ,qµ−1 contains(v,w) either, we haveF ′(v,w) = 1, and the claim follows

Page 20: Multicommodity Flows in Even, Planar Networks

382 K. Weihe

from π(x∗) ≥ µ andπ(y∗) < µ, which in turn follows from the definition ofC∗, andespecially the second inequality, from inclusion-maximality. So assume that some pathsqν with ν < µ contain(v,w). Letν be minimum such thatqν contains(v,w). Theny∗ isincident toqν from the right side, and by the specific choice ofµ, we haveπ(y∗) < ν andhence,π(x∗)− π(y∗) > µ− ν. However, the number of pathsqν, . . . ,qµ−1 containing(v,w), which equalsF∗∗(v,w), is at mostµ− ν. This proves the claim.

Finally, we are now able to prove the following theorem.

THEOREM4.15. If the input instance is solvable, theO(kn) algorithm returns a feasiblemulticommodity flow f, and otherwise, it returns “unsolvable.”

PROOF. By Theorem 4.5, each single-commodity flowf(·,·),i satisfies Properties 3.1i

with C{v,w} = C{v,w} −∑i−1

j=1( f(v,w), j + f(w,v), j ) for {v,w} ∈ E=. Moreover, if thealgorithm actually returns a multicommodity flow, then each flowf(·,·),i has total flowvaluedi , because of the break condition in the loop in the main routine. In summary,it remains to show that “unsolvable” is returned only if the input instance is actuallyunsolvable.

We prove this by induction on the minimum numberi = k + 1, . . . ,1 with di > 0.For i = k + 1 (to indicate thatall demands are zero), nothing is to show. So assumei ≥ k. In [KNK], Khuller et al. show in particular that a flow corresponding to ashortest distance weighting with respect to nonnegative arc lengths contains no clockwisecycle. Obviously, this implies thatF contains no clockwise cycle either, becauseF isconstructed from a flow corresponding to a shortest distance weighting by reducing someflow values. By Proposition 4.13 and Lemma 4.14, thei th phase of the pseudopolynomialalgorithm constructs a flowf ∗(·,·),i with total flow valuedi , when F replacesF∗ asthe additional, auxiliary input. More precisely,f ∗(·,·),i is the rightmost noncrossing path

packing with respect to Properties 3.2i with C(·,·) = F(·,·) (sinced1 = · · · = di−1 = 0).Theorem 4.5 implies thatf ∗(·,·),i is the rightmostsimplepath packing with respect

to these properties. Letp1, . . . , pm1 andq1, . . . ,qm2 be decompositions off(·,·),i intosimple paths and off ∗(·,·),i into noncrossing paths, respectively. Without loss of generality,each pathpj (resp.qj ) is more right than or equal to the pathpj+1 (resp.qj+1). Astraightforward induction onj = 1, 2, 3, . . . shows thatpj exists if and only ifqj exists,and thatpj andqj differ only in thatqj may contain some cycles thatpj does not contain.This fact has two important consequences. The first consequence is that the total flowvalue of f(·,·),i is equal to that off ∗(·,·),i , which means that theO(kn) algorithm doesnot return “unsolvable” in thei th iteration of the loop in the main routine, unless thepseudopolynomial algorithm does so, which certifies unsolvability.

The second consequence isF(v,w)− f ∗(v,w),i ≤ F(v,w)− f(v,w),i for (v,w) ∈ A⇒. As Ffulfills the cut condition, the pseudopolynomial algorithm eventually produces a feasiblesolution when proceeding with commoditiesi + 1, . . . , k. Clearly, this is possible onlyif F(·,·) − f ∗(·,·),i fulfills the cut condition for the demands(d′1, . . . ,d

′k), whered′i = 0

andd′j = dj for j 6= i . This implies thatF(·,·) − f(·,·),i obviously contains no clockwisecycle either, so we may apply the induction hypothesis to conclude that the loop in themain routine of theO(kn) algorithm does not return “unsolvable” when invoked for the

Page 21: Multicommodity Flows in Even, Planar Networks

Multicommodity Flows in Even, Planar Networks 383

instance with(d′1, . . . ,d′k) replacing(d1, . . . ,dk). However, this application is obviously

completely equivalent to proceeding with the remaining commodities,i +1, . . . , k, withrespect to(d1, . . . ,dk). Hence, the algorithm succeeds for(d1, . . . ,dk), too, which provesthe induction step.

Acknowledgments. I thank Stefanie Gehrke and Daniel John and the anonymousreferee for pointing out an error in an earlier version of this manuscript (not in the extendedabstract published in the ISAAC proceedings). Moreover, I thank the anonymous refereesfor useful hints, which improved the presentation of the paper. Finally, I thank oursecretaries, Barbara Derman and Andrea Ruhl, for proof-reading the manuscript.

References

[AMO] R.K. Ahuja, T.L. Magnanti, and J.B. Orlin.Network Flows. Prentice-Hall, Englewood Cliffs, NJ,1993.

[H1] R. Hassin. Maximum flows in(s, t) planar networks.Inform. Process. Lett., 13:107, 1981.[H2] R. Hassin. On multicommodity flows in planar graphs.Networks, 14:225–235, 1984.[HT] J.E. Hopcroft and R.E. Tarjan. Efficient planarity testing.J. Assoc. Comput. Mach., 21:549–568,

1974.[KNK] S. Khuller, J. Naor, and P. Klein. The lattice structure of flow in planar graphs.SIAM J. Discrete

Math., 6:477–490, 1993.[KRRS] P. Klein, S. Rao, M. Rauch, and S. Subramanian. Faster shortest-path algorithms for planar graphs.

Proceedings of the26th Annual ACM Symposium on Theory of Computing, STOC ’94, pp. 27–37.[MNS] K. Matsumoto, T. Nishizeki, and N. Saito. An efficient algorithm for finding multicommodity flows

in planar networks.SIAM J. Comput., 14:289–302, 1985.[OS] H. Okamura and P.D. Seymour. Multicommodity flows in planar graphs.J. Combin. Theory Ser. B,

31:75–81, 1981.[RWW] H. Ripphausen-Lipa, D. Wagner, and K. Weihe. Efficient algorithms for disjoint paths in planar

graphs. To appear in the DIMACS Volume from the Special Year on Combinatorial Optimization,1994.

[T] E. Tardos. A strongly polynomial algorithm to solve combinatorial linear programs.Oper. Res.,34:250–256, 1986.

[WW] D. Wagner and K. Weihe. A linear time algorithm for edge-disjoint paths in planar graphs.Combi-natorica, 15:135–150, 1995.


Recommended