A Scaling Algorithm for the Maximum Node ... - Semantic Scholar

1 downloads 0 Views 542KB Size Report
Jun 17, 2008 - Alexander V. Karzanov † ... †Institute for System Analysis, 9, Prospect 60 Let Oktyabrya, 117312 Moscow, Russia; Email: sasha@cs.isa.ru.
A Scaling Algorithm for the Maximum Node-Capacitated Multiflow Problem Maxim A. Babenko



Alexander V. Karzanov



June 17, 2008

Abstract We study the problem of finding a fractional node-capacitated multiflow of maximum value in an undirected network. Previously known methods for this problem are based on linear programming and the ellipsoid method. In this paper we apply a capacity scaling approach and develop a purely combinatorial weakly polynomial algorithm of time complexity O(Λ(n, m, U ) n2 log2 n log U ), where n, m, U are the number of nodes, the number of edges, and the maximum node capacity, respectively, and Λ(n, m, U ) denotes the complexity of finding a maximum integer flow in a digraph with n nodes, m edges, and integer edge capacities not exceeding U ∈ Z+ .

1

Introduction

In an undirected graph G, the sets of nodes and edges are denoted by V G and EG, respectively. When G is a directed graph, we speak of arcs rather than edges and write AG instead of EG. A similar notation is used for paths, cycles, and etc. We consider an undirected graph G and a distinguished subset T ⊆ V G of nodes, called terminals. Nodes in V G − T are called inner. A T -path is a path in G that connects a pair of distinct terminals and has all other (intermediate) nodes in V G − T . The set of T -paths is denoted by P(G, T ). A multiflow is a function F : P(G, T ) → R+ . Equivalently, one may think of F as a collection (1.1)

{(α1 , P1 ), . . . , (αq , Pq )} ,

where the Pi are T -paths and the αi are non-negative reals, called weights of paths. Sometimes (e.g., in [IKN98]) such a multiflow F is called free to emphasize that anyP pairs of distinct terminals are allowed to be connected by flows. The value val (F ) of F is the sum P F (P ). For a subset A of a set X, the incidence vector of A in RX is denoted by χA , i.e., χA (e) is 1 for e ∈ A and 0 for e ∈ X − A (usually X is clear from the context). Let c : V G → Z+ be a nonnegative integer function of node capacities. For a multiflow F , define the function ζ F on V G by X¡ ¢ ζ F := F (P ) · χV P : P ∈ P(G, T ) . We say that F is c-feasible if ζ F ≤ c. This paper deals with the following problem: ∗ Dept. of Mechanics and Mathematics, Moscow State University, Vorob’yovy Gory, 119899 Moscow, Russia; Email: [email protected]. † Institute for System Analysis, 9, Prospect 60 Let Oktyabrya, 117312 Moscow, Russia; Email: [email protected]. Supported by NWO–RFBR grant 047.011.2004.017 and by RFBR grant 05-01-02805 CNRSL_a.

1

(P) Given G, T, c as above, find a c-feasible multiflow F of maximum value val (F ). It is known that this problem has a half-integer optimal primal [Pap07] and dual solutions [Vaz01]. Also (P) is solvable in polynomial time by use of the ellipsoid method [Pap07]. However, no efficient combinatorial algorithm for (P) has been known so far. We present a combinatorial algorithm that solves (P) via capacity scaling. Our approach relies on earlier results of Ibaraki, Karzanov, and Nagamochi [IKN98] concerning an edge-capacitated analog of (P). As a result, the time complexity of our algorithm for (P) is O(Λ(n, m, U ) n2 log2 n log U ). Hereinafter n, m, U denote the number of nodes, the number of edges, and the maximum capacity, respectively, and Λ(n, m, U ) stands for the complexity of finding a maximum integer flow in a digraph with n nodes, m edges, and integer edge capacities not exceeding U ∈ Z+ . In particular, applying the algorithm of Goldberg and Rao [GR98], problem (P) can be solved in O(n2 m min(n2/3 , m1/2 ) log(n2 /m) log2 n log2 U ) time. The paper is organized as follows. Section 2 contains backgrounds. An outline of the algorithm and a (sketch of a) proof of its correctness are given throughout Section 3 and Section 4.

2

Preliminaries

Let A be a subset of nodes of a graph (or a digraph). We denote by γ(A) the set of edges of the graph (or arcs of the digraph) with both endpoints in A, and by δ(A) the set of edges (or arcs) with exactly one endpoint in A. Also in case of a digraph, δ in (A) (resp. δ out (v)) denotes the set of arcs that enter A (resp. leave A). When A is a singleton {v}, we use the abbreviated notation δ(v), δ in (v), and δ out (v). Clearly (P) is a linear program, with variables F (P ) associated to T -paths P . To state its dual program, we call a function π : V G → R+ a (fractional) cover if π(V P ) ≥ 1 holds P for each T -path P . 0 0 (As usual, for a function f on a set X and a subset X ⊆ X, f (X ) denotes 0 f (x); so π(V P ) x∈XP P means v∈V P π(v).) By the c-value of a cover π we mean the inner product cπ := v∈V G c(v)π(v). Then the program dual of (P) is: (C) Find a cover π whose c-value cπ is minimum. We will use standard definitions and some facts about flows and multiflows (for details, see, e.g., [Schr03]). Let G be a digraph with distinguished subsets S, T ⊂ V G, S ∩ T = ∅. The nodes in S (resp. T ) are regarded as sources (resp. sinks), and the other nodes are called inner. We assume that δ in (S) = δ out (T ) = ∅. A function f : AG → R+ is an S–T flow if: (i) divv (f ) ≥ 0 for all sources v, (ii) divv (f ) ≤ 0 for all sinks v, and (iii) divv (f ) = 0 for all inner nodes v, where divv (f ) := f (δ out (v)) − f (δ in (v)) P (the divergence of f at v). The value of f is val (f ) := (divv (f ) : v ∈ S). Given arc capacities c : AG → R+ , a flow f is c-feasible if f ≤ c. The max-flow problem is: (MF) Given G, S, T, c as above, find a c-feasible flow f of maximum value. Theorem 1 (Goldberg, Rao [GR98]) For integer arc capacities not exceeding U ∈ Z+ , an integer maximum flow can be found in O(m min(m1/2 , n2/3 ) log(n2 /m) log U ) time. Next, we will also deal with an analog of (MF) for node capacitated networks. For a flow f and a node v ∈ V G, define the value of flow through v as ¡ ¢ f [v] := max f (δ in (v)), f (δ out (v)) . Then for c : V G → R+ , f is said to be c-feasible if f [v] ≤ c(v) for all v ∈ V G. There are well-known facts about the node-capacitated max-flow problem. A set A ⊆ V G is called an S–T separator if each (directed) S–T path meets A. 2

Fact 2 (a version of Menger theorem) For c : V G → Z+ , one has max val (f ) = min c(A), where the maximum is taken over all integer c-feasible (node-capacitated) S–T flows f , and the minimum over all S–T separators A. Suppose that a c-feasible S–T flow f is not maximum. Then one can increase val (f ) by use of a standard construction. More precisely, a sequence (2.1)

R = (v0 , a1 , v1 , a2 , . . . , al , vl ),

where vi ∈ V G and ai ∈ AG, is called f -augmenting if the following conditions hold: 1. each arc ai connects nodes vi−1 and vi ; 2. if ai leaves vi , then f (ai ) > 0; 3. if ai leaves vi−1 and ai+1 leaves vi , then f [vi ] < c(vi ); 4. v0 ∈ S and vl ∈ T ; 5. f [v0 ] < c(v0 ) and f [vl ] < c(vl ). The arcs ai of R that leave vi−1 are called forward, and the other ones are called backward. The assumption that no arc of G enters a source and no arc leaves a sink implies that the arcs a1 and al are forward. An occurrence of node vi in R is called increasing if either i = 0, or i = l, or both ai and ai+1 are forward. We call R minimal if (i) all arcs in R are distinct; and (ii) each node occurs in R at most twice; and (iii) if vi = vj for i 6= j, then neither vi nor vj is an increasing occurrence. Fact 3 For c : V G → Z+ , let f be an integer f -augmenting sequence. Define   f (a) + 1 f 0 (a) := f (a) − 1   f (a)

c-feasible node-capacitated flow, and R a minimal if a is a forward arc, if a is a backward arc, otherwise.

Then f 0 is an integer c-feasible flow of value val (f ) + 1. Fact 4 A c-feasible node-capacitated flow f admits an f -augmenting sequence R if and only if val (f ) is not maximum. Moreover, in O(m) time, one can find either a minimal f -augmenting sequence or an S–T separator A such that c(A) = val (f ). Finally, some important facts and tools that will be extensively used throughout the paper are borrowed from the theory of edge- and arc-capacitated multiflows. Typically problems on such multiflows are somewhat “simpler” than their node-capacitated counterparts. Let G be a graph (or a digraph), and T = {t1 , . . . , tk } ⊆ V G be a set of terminals. For a multiflow F : P(G, T ) → R+ , define the function ξ F on EG as X¡ ¢ F (P ) · χEP : P ∈ P(G, T ) . ξ F := In case of a digraph G, the term EP in this definition is replaced by AP . Let, in addition, G be endowed with edge (resp. arc) capacities c. A multiflow F is c-feasible if ξ F ≤ c. The problem is: 3

(MMF) Given G, T, c as above, find a c-feasible (edge- or arc-capacitated) multiflow F whose value val (F ) is maximum. The function c is said to be inner Eulerian if c is integer-valued and c(δ(v)) is even, in the undirected case (resp. c(δ in (v)) = c(δ out (v)), in the directed case) for each inner node v ∈ V G − T . Consider a collection Q = {Q1 , . . . , Qk } of pairwise disjoint subsets of V G such that ti ∈ Qi for i = 1, . . . , k. Following terminology in [Bab07], the sets Qi are called islands, and Q an island collection. Theorem 5 (Lov´ asz [Lov76], Cherkassky [Che77]) In the undirected case of (MMF) with inner Eulerian capacities, one has max val (F ) =

X 1 c(δ(Qt )), min 2 t∈T

where the maximum is taken over all c-feasible multiflows F , and the minimum over all island collections Q = {Qt | t ∈ T }. Moreover, the maximum is attained by an integer multiflow F . Remark 6 When G is a digraph and c is inner Eulerian, a similar max-min relation, with the values c(δ(Qt )) replaced by c(δ in (Qt )) + c(δ out (Qt )), as well as the corresponding integrality result, also takes place. This is due to Lomonosov (unpublished manuscript, 1978); see also [Kar79, Fr89]. In the undirected case of (MMF), given a multiflow F , an island collection {Qt : t ∈ T } is called F -tight if ξ F (δ(t)) = c(δ(Qt )) holds for all t ∈ T . The following is immediate from Theorem 5. Corollary 7 A multiflow F is maximum if and only if there exists an F -tight island collection. Theorem 8 (Ibaraki, Karzanov, Nagamochi [IKN98]) In the undirected case of (MMF) with inner Eulerian capacities, a maximum integer multiflow can be found in O(Λ(n, m, U ) log |T |) time. In the directed case of (MMF) with inner Eulerian capacities, a maximum integer multiflow can be found in O(Λ(n, m, U ) log |T | + n2 m) time. In both cases, the maximum value of a multiflow and an optimal island collection can be found in O(Λ(n, m, U ) log |T |) time. We will also use the following corollaries of that result. Corollary 9 In the undirected case of (MMF) with an inner Eulerian c, the function ξ F for some maximum integer multiflow F can be constructed in O(Λ(n, m, U ) log |T |) time. Also, by spending additional O(mn log |T |) time, one can turn F into a path packing (of the form (1.1)). Remark 10 Strictly speaking, the time bounds figured in Theorem 8 are valid under some assumption concerning a lower bound for Λ(n, m, U ); see [IKN98] for details. Fortunately, this assumption is satisfied for reasonable max-flow algorithms, in particular, for the algorithm of Goldberg and Rao [GR98].

3 3.1

Algorithm Outline Scaling Step

The general scheme of our approach for solving (P) resembles that of Ford and Fulkerson’s capacity scaling algorithm [FF62]. Namely, let c0 : V G → Z+ be the original node capacities. We assume that c0 is even for all nodes and construct an integer-valued maximum c0 -feasible multiflow. Clearly, this is equivalent to constructing a half-integral multiflow for arbitrary integer capacities. The algorithm performs O(log U ) scaling steps. Each such step takes the previous even-valued capacity function c and the corresponding maximum c-feasible integer multiflow F . Initially c := 0 4

and F := 0. On each scaling step unit is added to capacities of some nodes (namely, to those having 1 at the corresponding position in the binary representation of c0 ) and then all capacities are multiplied by 2, thus producing an even-valued function c0 : V G → Z+ . Then a maximum c0 feasible integer multiflow F 0 is computed. To this aim, the current function F is replaced by 2F and a certain augmenting path approach is applied. The process stops when c = c0 , and the lastest c-feasible multiflow F is the answer. So O(log U ) scaling steps are needed to compute this F . Our algorithm does not store F explicitly as a path packing. Instead, it maintains certain edge capacities ω : EGP → Z+ . For v ∈ V G − T , put ω[v] := 12 ω(δ(v)), and for v ∈ T , put ω[v] := ω(δ(v)). 1 Define ω[T ] := 2 t∈T ω[t]. The function ω obeys the following conditions: (3.1) ω is inner Eulerian, (3.2) ω[v] ≤ c(v) for all v ∈ V G, (3.3) there exists an integer edge-capacitated ω-feasible multiflow in G of value ω[T ]. Note that (3.2) implies that any multiflow constructed from ω by (3.3) is c-feasible. Scaling step first puts ω := 2ω and then applies a number of augmentation steps that increase ω[T ]. When augmentation steps are complete, ω[T ] is equal to the value of a maximum c-feasible node-capacitated multiflow. The following lemma bounds the number of augmentation steps that are needed to turn 2F into a maximum c0 -feasible multiflow (call the latter F 0 ). Lemma 11 val (F 0 ) − val (2F ) ≤ 2n. Proof Since F is a maximum c-feasible multiflow there must be an optimal cover π : V G → R+ such that val (F ) = πc. Clearly, π(v) ≤ 1 for all v ∈ V G. By weak duality, for each c0 -feasible multiflow F 0 one has val (F 0 ) ≤ πc0 ≤ 2πc + 2n = 2 val (F ) + 2n = val (2F ) + 2n. ¥ When the scaling steps are complete, the final function ω is converted (with the help of Theorem 9) into the desired multiflow in the path-packing form, in O(Λ(n, m, U ) log n + mn log n) time.

3.2

Augmentation Step

The core of the algorithm is an augmentation procedure that either updates the current function ω to increase ω[T ] by 1 (while maintaining (3.1)–(3.3)) or detects that ω[T ] is equal to the value of a maximum c-feasible multiflow. In our approach we are forced to strengthen problem (P) by imposing certain conditions on T paths. For an island collection Q = {Q1 , . . . , Qk }, a T -path P is called Q-feasible if |EP ∩δ(Qi )| ≤ 1 for i = 1, . . . , k (in particular, P meets exactly two islands). Accordingly, we say that a c-feasible multiflow F is (Q, c)-feasible if each path P in the support supp (F ) = {P | F (P ) 6= 0} of P is Q-feasible. The needed strengthening of (P) is the following problem (which turns into (P) when the island collection is formed by single terminals): (QP) Given Q as above, find a (Q, c)-feasible multiflow F whose value val (F ) is maximum. Let us say that a function π : V G → R+ is a Q-cover if π(V P ) ≥ 1 holds for any Q-feasible T -path P . Then, similar to the duality of (P) and (C), the program dual of (QP) is: (QC) Find a Q-cover π whose c-value cπ is minimum. The complementary slackness conditions for (QP) and (QC) (giving an optimality criterion for solutions F and π to these programs) are viewed as:

5

(3.4) for a Q-feasible T -path P , f (P ) > 0 implies π(V P ) = 1; (3.5) for a node v ∈ V G, π(v) > 0 implies ζ F (v) = c(v). The augmentation step grows an island collection Q in G and consists of a sequence of extension steps. These steps deal with the refined problem (QP) rather than (P). The process starts with the trivial collection: Qi := {ti } for i = 1, . . . , k. Also two additional invariants concerning ω are maintained. Firstly, the algorithm handles ω-feasible multiflows F of value ω[T ] that consist of Q-feasible paths, and the collection Q is required to be F -tight. In terms of ω, this turns into the following condition: (3.6) ω[ti ] = ω(δ(Qi )) for all 1 ≤ i ≤ k. Secondly, let ν(c) (resp. ν(Q, c)) denote the value of a maximum c-feasible (resp. (Q, c)-feasible) multiflow in G. The algorithm ensures that problem (QP) remains equivalent, in a sense, to (P): (3.7) if ω[T ] = ν(Q, c) and if, moreover, there exists a half-integral Q-cover π obeying ν(Q, c) = πc, then ω[T ] = ν(c). (?? right?) Each extension step either (i) updates the current function ω so as to increase ω[T ] by 1 while maintaining (3.1)–(3.3), or (ii) updates both ω and Q while preserving ω[T ], increasing some island and non-decreasing the other ones, and maintaining (3.1)–(3.3), (3.6), (3.7). In case (i), the current augmentation step completes, and in case (ii), the algorithm proceeds with a next extension step.

3.3

Extension Step

A sketch of performing an extension step is as follows. In order to increase ω[T ], the algorithm tries to find a sort of “augmenting path” P for ω. This path connects a pair of (possibly coinciding) terminals. Also P may contain terminals as intermediate nodes and need not be node- or edgesimple. Each edge of P is marked as either “positive” or “negative”. The first and the last edges of P are always positive. (The function ω will be updated by increasing by 1 on the positive edges and decreasing by 1 on the negative ones.) Unfortunately some additional constraints that we have to impose on a desirable P do not seem to be easily expressible in terms of graph G. For this reason, P will be obtained as a projection b of an augmenting sequence (as in (2.1)) in a specially designed partially doubly covering digraph G (constructed from G and Q). This digraph was introduced in [Bab07] for solving the uncapacitated version of (P) and is close to the notion of doubly covering digraph that was used in [Kar94] to study b will be given later. the edge-capacitated min-cost multiflow problem. The precise definition of G The following three cases can occur: b exists; then the current scaling step completes; • Case (A): no augmenting sequence in G • Case (B): an augmenting sequence exists and, in a sense, can be “fully applied” to ω; then the current function ω updates with increasing ω[T ], and the current augmentation step completes; • Case (C): an augmenting sequence exists but cannot be “fully applied” to ω; then the function ω updates with preserving ω[T ], some island in Q increases, and the current extension step completes. b formally. Put Q = Q(Q) := Q1 ∪ . . . ∪ Qk Now we define the partially doubly covering digraph G and Z = Z(Q) := V G − Q; the elements of Q and Z are referred to as island and central nodes, b Each node v ∈ Z corresponds to respectively. Each node v ∈ Q is split into a pair v 1 , v 2 of nodes in G. 6

b Figure 1: Constructing the partially doubly covering digraph G. b we identify the latter node in G b with v. Each edge {u, v} ∈ γ(Z) generates a pair a unique node in G; b Each edge {u, v} ∈ γ(Qi ), 1 ≤ i ≤ k, generates four arcs (uj , v j ), (v j , uj ) of arcs (u, v), (v, u) in G. b j = 1, 2. Each edge {u, v} ∈ EG with u ∈ Q and v ∈ Z generates arcs (u1 , v) and (v, u2 ) in in G, b b G. Each edge {u, v} ∈ EG with u ∈ Qi and v ∈ Qj , i 6= j, generates arcs (u1 , v 2 ), (v 1 , u2 ) in G. 1 2 b is trimmed: all arcs entering nodes in T and all arcs leaving nodes in T are deleted. Finally, G © ª (We define Ai := v i | v ∈ A for any set A ⊆ Q.) An example is depicted in Fig. 1. b by We assign capacities b c to the nodes of G (3.8) b c(v) := c(v) for all v ∈ Z, and b c(v 1 ) := b c(v 2 ) := 12 c(v) for all v ∈ Q. Since the capacities c are even, b c is integer-valued. b and G. Each arc a in G b corresponds to We need some notation that relates objects in graphs G 1 2 b the uniquely defined edge Ω(a) in G. Next, let ϕ b be an arbitrary integer T –T flow in b ¢ G. Then, ϕ P¡ generates an inner Eulerian function ϕ := Ω(ϕ) b on EG by ϕ(e) := ϕ(a) b : Ω(a) = e . b rather than G. As mentioned earlier, the algorithm deals with augmenting paths in the graph G 1 2 b More precisely, the function ω is lifted to an integer b c-feasible T –T flow ω b in G of value ω[T ] that obeys ω = Ω(b ω ). This transformation is not straightforward and will be covered in Subsection 4.1. b The algorithm seeks for an ω b -augmenting sequence in G. Lemma 12 If ω b admits no augmenting sequence then ω[T ] = ν(c). Proof According to Fact 4 there©exists ªa T 1 –T 2 separator A of b c-capacity equal to val (b ω ) = ω[T ]. Construct the function π : V G → 0, 12 , 1 as follows: (i) for each v ∈ Z, put π(v) := 1 if v ∈ A, and © ª π(v) := 0 otherwise; (ii) for each v ∈ Q, put π(v) := 12 · |A ∩ v 1 , v 2 |. We claim that π is a Q-cover. Suppose, for a contradiction, that there is a Q-admissible T -path P b Since A ∩ V Pb 6= ∅, it follows in G such that π(V P ) ≤ 12 . Lift P to a directed T 1 –T 2 path Pb in G. 1 1 that π(V P ) ≥ 2 , therefore π(V P ) = 2 . Hence, all central nodes of Pb do not belong to A and there b is a unique island node of Pb belonging to A. Consider the reversed path P −1 . Its image Pb−1 in G does not contain nodes from A, which is a contradiction. From πc = b c(A) = ω[T ] and (3.7) it follows that ω[T ] = ν(c), as needed. ¥ Lemma 12 establishes correctness of the algorithm in case (A). b be an ω b We have to explain what we mean under “partial Now let R b -augmenting sequence in G. b b by merging, for each i = application” of R. First of all we construct another digraph G from G 1 2 1, . . . , k, nodes ti and ti back into node ti . Also we add an auxiliary terminal t0 with no incident arcs. Note that the above contractions do not remove any arcs since there are no arcs between nodes t1i and t2i . Nodes T := T ∪ {t0 } are regarded as terminals in G. The arcs of G are identified b and we regard ω with the corresponding arcs of G b as a capacity function in G. For each 1 ≤ i ≤ k j 1 2 j and j = 1, 2 put Qi to be the image of Qi in G, that is, Qji − {tji } ∪ {ti }. Also put Qi := Qi ∪ Qi . b in G b induces a sequence R = (v0 , a1 , v1 , a2 , . . . , al , vl ) of nodes and arcs in G. For The sequence R b i ∈ {1, . . . , l}, consider the first i arcs ARi := {a1 , . . . , ai } of R. Suppose we are going to increase ω by 1 on the forward arcs in ARi and simultaneously decrease by 1 on the backward arcs. This may result in arc capacities that are not inner Eulerian. To overcome this difficulty, we add an auxiliary arc (vi , t0 ) of capacity 1 unless i > 0 and vi ∈ T . The resulting digraph (resp. capacities function) b ) is denoted by Gi (resp. ω i ). It is easy to check that ω i is inner obtained from G (resp. from ω Eulerian (w.r.t. T ). 7

By taking trivial islands {ti }, i = 0, . . . , k, one can see that the maximum value of an ω i -feasible integer multiflow in Gi does not exceed ω[T ] + 1. If the latter is exactly ω[T ] + 1, we call index i good ; otherwise i is called bad. Clearly (3.9) index 0 is good. The algorithm examines index l by applying the algorithm of Ibaraki, Karzanov, and Nagamochi, see Theorem 8. First suppose that l is good; this corresponds to Case (B). There exists an integer ω l -feasible multiflow F in Gl = G of value ω[T ] + 1. The algorithm applies Theorem 9 to construct ξ F and updates ω by taking the projection ω := Ω(ξ F ). Thus, ω[T ] increases by 1. Invariants (3.1) b b and (3.2) follow from the construction of G, c and Fact 3. Invariant (3.3) follows from the existence of F . Finally, suppose that l is bad; this corresponds to Case (C). Consider the sequence of graphs G0 , . . . , Gl and the corresponding sequence of arc capacity functions ω 0 , . . . , ω l . Our aim is to find an index j such that j is good whereas j + 1 is bad. To make this quickly, the algorithm performs a binary search over the range {0, . . . , l}. At each step we maintain a pair of indices (j − , j + ), j − < j + such that j − is good while j + is bad (initially j − := 0, j + := l). Put i := b 21 (j − + j + )c, consider graph Gi , capacities ω i , and solve (MMF) for this pair. If i is good, put j − := i; otherwise put j + := i. This process converges to a required pair (j, j + 1) after O(log n) maximum multiflow computations. Then the function ω and the collection Q are updated as described in Subsection 4.2 (this is carried out in O(Λ(n, m, U ) log n) time).

4 4.1

Implementation Details Constructing an Auxiliary Flow

This subsection outlines the proof of the following Lemma 13 There exists, and can be found in O(Λ(n, m, U )) time, an integer b c-feasible T 1 –T 2 b flow ω b in G of value equal to ω[T ] and such that Ω(b ω ) = ω, where b c is defined by (3.8). First, for an edge e ∈ EG incident to a node v ∈ Q, we assign a direction µ(e, v) ∈ {+1, −1} to e at v. Hence, for each node v ∈ Q, the edges in δ(v) are partitioned into two disjoint subsets µ+ (v) := {e ∈ δ(v) | µ(e, v) = +1} and µ− (v) := {e ∈ δ(v) | µ(e, v) = −1}. These directions µ are chosen so as to satisfy the following conditions: (4.1) if e = {ti , v} ∈ EG for some 1 ≤ i ≤ k, then µ(e, ti ) = −1, (4.2) if e = {u, v} ∈ δ(Qi ) and u ∈ Qi for some 1 ≤ i ≤ k, then µ(e, u) = −1, (4.3) if e = {u, v} ∈ γ(Qi ) for some 1 ≤ i ≤ k, then µ(e, u) 6= µ(e, v), (4.4) ω(µ+ (v)) = ω(µ− (v)) for all v ∈ Q − T . Equivalently, µ determines a partial “bidirected” structure on G, where the positive (resp. negative) direction means that an edge is regarded as entering (resp. leaving) a given node. Condition (4.1) (resp. (4.2)) requires that an edge of the cut δ(t) for t ∈ T (resp. δ(Qi ) for 1 ≤ i ≤ k) leaves t (resp. leaves its endpoint in Qi ). Condition (4.3) ensures that the edges in γ(Qi ) are “standard directed edges”, that is, they leave one endpoint and enter the other. Condition (4.4) corresponds to flow conservation. Consider i ∈ {1, . . . , k}. To assign directions to edges at nodes in Qi , we contract the nodes V G − Qi in G into a new node z and find a maximum integer ti –z flow in the resulting graph. From (3.3) and (3.6) it follows that this flow has value ω[ti ] and saturates the incident edges of both ti 8

and z. (Note that one may need to split some edges in G into a pair of parallel copies and distribute capacity among them appropriately; we keep notation ω for the edge capacities in the obtained graph.) We assume that the flow saturates all edges; for we can efficiently find a circulation on the residual capacities and then add it to the flow. The total time needed to compute these directions is O(Λ(n, m, U )). Next, we split each node v ∈ Q into a pair of copies v + and v − ; the edges directed from v are assigned to be incident to v + , and the edges directed to v are assigned to be incident to v − . Let H denote the resulting graph. We keep notation ω for the edge capacities in H. As usual, for a subset A ⊆ Q, we write A+ (resp. A− ) to denote {v + | v ∈ A} (resp. {v − | v ∈ A}). For a node v ∈ Q − T , one has ω(δ(v + )) = ω(δ(v − )) (by (4.4)). If this value is odd, then, by technical reasons, we add an auxiliary edge {v + , v − } and put ω({v + , v − }) := 1. This makes ω inner Eulerian in H regarding T − as the terminal set. ~ by replacing each edge {u, v} of H by two opposite arcs (u, v) and Now form the digraph H (v, u). Our aim is to provide it with arc capacities η so that: (i) η(δ in (v)) = η(δ out (v)) for each v ∈ V H − T − ; (ii) |η(δ in (v)) − η(δ out (v))| ≤ 1 for each v ∈ T − ; (iii) ω({u, v}) = η(u, v) + η(v, u) for each {u, v} ∈ EH. This is carried out in O(m) time as follows. Initially, put η := 0. If ω({u, v}) ≥ 2 for some {u, v} ∈ EH, then put η(u, v) := η(v, u) := b 21 ω({u, v})c and decrease ω({u, v}) by η(u, v) + η(v, u). Let E1 be the set of edges e in H that still have ω(e) > 0. Each node v ∈ V H − T − is incident to an even number of edges in E1 . Hence, E1 is representable as a collection E of pairwise edge-disjoint cycles and paths, where the ends of the paths are different and belong to T − . Direct these cycles and paths in an arbitrary way and for each cycle/path P ∈ E and an arc a ∈ AP increase η(a) by 1. This preserves the inner Eulerianess of η. b as follows. Delete the auxiliary arcs of the form Now we transform η into the desired flow ω b in G, (v + , v − ) or (v − , v + ), where v ∈ Q. Note that η(δ in (v + )) = η(δ out (v − )) and η(δ in (v − )) = η(δ out (v + )) for all v ∈ Q − T (this follows from the inner Eulerianess of η and (4.4)). We change the ends of arcs by the following rule: for each v ∈ Q, the arcs leaving v − are rearranged to leave v + , and symmetrically, the arcs leaving v + are rearranged to leave v − . By the equalities above for nodes in Q and by the fact that η also obeys η(δ in (v)) = η(δ out (v)) for all v ∈ Z, we obtain a digraph with an inner Eulerian capacity function η (w.r.t. the set of terminals T + ∪ T − ). b Indeed, It remains to notice that the resulting digraph (call it K) is essentially equivalent to G. + 1 − 2 consider the correspondence v → v , v → v for v ∈ Q. The central nodes v ∈ Z are present in b and they are identified with the central nodes of the graphs G and H. both K and G, b each arc a ∈ We claim that under the above correspondence between the nodes of K and G, b supp (η) has a natural image in G. To see this, it suffices to check that there are no arcs a ∈ supp (η) out such that: (i) a ∈ δ in (t+ ) or a ∈ δ out (t− ) for v ∈ T ; or (ii) a ∈ δ in (Q+ (Q− i ) or a ∈ δ i ) for 1 ≤ i ≤ k; or (iii) a = (u+ , v − ) for u, v ∈ Qi , 1 ≤ i ≤ k; or (iv) a = (u+ , v + ) or a = (u+ , v + ) for u ∈ Qi , v ∈ Qj , 1 ≤ i 6= j ≤ k. This can be easily derived from conditions (4.1)–(4.3). b Therefore, ω b can be obtained from η by taking the G-images of arcs a ∈ supp (η). The function ω b 1 2 b − (T ∪ T ) (which follows from the corresponding property of η). obeys divv (b ω ) = 0 for all v ∈ V G The value of ω b is as required; indeed, val (b ω) =

4.2

1 2

X

| divv (b ω )| =

1X ω(δ(v)) = ω[T ]. 2 v∈T

v∈T 1 ∪T 2

Extension Step

Let j be an index such that Gj admits an integer ω j -feasible multiflow (denote it by F j ) of value ω[T ] + 1 whereas the value of a maximum integer ω j+1 -feasible multiflow in Gj+1 is at most ω[T ]. ¡ ¢ One can easily see that val F j = ω[T ] + 1 implies that F j saturates all terminals T (ξ F j (δ(ti )) = ω j (δ(ti )) for all 0 ≤ i ≤ k). 9

We shall use the following statement: Lemma 14 There exist, and can be found in O(Λ(n, m, U ) log n) time, a terminal tα ∈ T and a set Aα ⊆ V G such that: 1. Aα ∩ T = {tα }, 2. Qα ⊆ Aα , 3. Qβ ∩ Aα = ∅ for all β 6= α, 1

4. vj ∈ Aα − Qα , 5. ξ F j (δ out (Aα )) = ω j (δ out (Aα )) = ω j (δ out (tα )), 6. ξ F j (δ in (Aα )) = ω j (δ in (Aα )) = ω j (δ in (tα )). Applying Lemma 14 the algorithm finds tα and set Aα . Note that from property 4 in the above Lemma 14 and the construction of Gj it follows that vj ∈ / T , so arc (vj , t0 ) is present in Gj . The extension step consists of two phases. Firstly, one needs to update function ω to make it consistent with the upcoming extension of islands. This is achieved as follows. Consider graph Gj and contract the set V Gj −Aα −{t0 } into a new node w. Denote the resulting graph by H. It is endowed with inner Eulerian arc capacities ω j . Nodes {tα , t0 , w} are regarded as terminals in H. >From Lemma 14 it follows that ξ F j (δ(Aα )) = ω j (δ(Aα )). Hence, graph H also admits an integer multiflow that saturates all its terminals. Moreover, the latter multiflow can only contain tα –w, w–tα , and tα –t0 paths and, hence, may be represented by a collection {g 1 , g 2 , g 3 }, where g 1 is an integer tα –w flow, g 2 is an integer w–tα flow, and g 3 is an integer tα –t0 flow. These flows obey g 1 + g 2 + g 3 ≤ ω j and val (g 1 ) + val (g 2 ) + val (g 3 ) = ω j (δ(tα )). To compute g 1 , g 2 , g 3 as above the algorithm finds a maximum integer tα –{w, t0 } flow g 1 + g 3 (in O(Λ(n, m, U ) time) and then decomposes it into g 1 and g 3 . Since only a single unit of flow enters terminal t0 , this decomposition takes O(m) time. Next, the algorithm puts g 2 := ω j − (g 1 + g 3 ). Consider an inner Eulerian function ω 0 : AG → Z+ defined by   g 1 (a) + g 2 (a) for a ∈ γ(Aα ), 0 ω (a) := 0 for a = (vj , t0 ),   ω j (a) otherwise. 0

Replacing ω j by ω 0 eliminates the auxiliary tα –t0 component of F j , therefore ω 0 = ξ F holds for 0 some integer multiflow F in G of value ω[T ]. Put ω 0 := Ω(ω 0 ). Lemma 15 Function ω 0 is inner Eulerian and obeys ω 0 [v] ≤ c(v) for all v ∈ V G. This completes the description of the first phase. Now let us explain how the island collection Q is updated. Let Aα be the image of Aα in G (that is, Aα := Aα − Qα ∪ Qα ). Contract the set V G − Aα into a new node z and denote the resulting ~ obtained by replacing each edge {u, v} of H a pair of oppositely graph by H. Consider the digraph H directed arcs (u, v) and (v, u) and then dropping all arcs that enter tα or leave z. Function ω 0 in G ~ induces arc capacities in H. 0 Existence of a multiflow Ω(F ) in G implies that there is an integer ω 0 -feasible tα –z flow h ~ of value ω(δ(tα )) = ω(δ(z)). The algorithm constructs h by applying a max-flow algorithm. in H

10

Additionally, it adjusts h to ensure that supp (h) is acyclic (e.g. with the help of an O(m log n)-time algorithm from [ST83]). Since val (g 3 ) = 1, there exists (and can be found in O(m) time) a tα –t0 path L in H (and, 1 hence, in Gj ) such that χAL ≤ g 3 . By Lemma 14, vj ∈ / Qα , hence L contains at least one central node. Let us follow L from tα to t0 and denote the first central node on this path by q. Put L1 to ~ be the H-image of the tα –q prefix of L. ~ from x to q consisting of We call a node x ∈ Aα − Qα reachable if there exists a path in H ~ to Qα and denote the resulting set by Q0α . Put arcs in supp (h). Add all reachable nodes of H Q0 := Q − {Qα } ∪ {Q0α }. Lemma 16 h(δ out (Qα )) = h(δ out (Q0α )) = val (h). Proof Equality h(δ out (Qα )) = val (h) is obvious. It is sufficient to prove that h(δ in (Q0α )) = 0. ~ be an arc such that a ∈ δ in (Q0α ) and a ∈ supp (h). Since h(δ in (Qα )) = 0 Indeed, let a = (u, v) ∈ AH 0 it follows that v ∈ Qα − Qα and, hence, v is reachable. But then so is u, which is a contradiction. ¥ Corollary 17 There exists an integer ω 0 -feasible multiflow F 0 in G of value ω[T ] such that each path P ∈ supp (F 0 ) is both Q-feasible and Q0 -feasible. ~ Lemma 18 Let x be a reachable node. Then there exists an integer ω 0 -feasible tα –z flow h0 in H 0 0 of value val (h) and a tα –x path P in Qα such that h [v] < h[v] holds for all v ∈ V P − {x}. Proof Let L2 be a tα –x such that AL2 ⊆ supp (ω 0 ). Clearly, V L2 ⊆ Q0α . Also, since x is reachable there exists an x–z path L3 obeying AL3 ⊆ supp (ω 0 ). Acyclicity of supp (h) implies that AL2 ∩ AL3 = ∅. We decrease values of h by 1 on arcs AL2 ∪ AL3 and then increase its values by 1 on arcs AL1 , thus producing h0 . Clearly, divv (h) = divv (h0 ) for each node v. Also, h0 [v] ≤ h[v] − 1 holds for all nodes v along L2 except for (possibly) its end x. Hence, P := L2 is the desired path. ¥ Corollary 19 Let x be a reachable node. There exists an integer (Q0 , c)-feasible multiflow Fx0 in G 0 and a tα –x path P in Q0α that obey the following properties: (i) val (Fx0 ) = ω[T ]; (ii) ζ Fx (v) < c(v) for all v ∈ V P − {x}. Lemma 20 Let π be a half-integral Q0 -cover obeying ω 0 [T ] = πc. Then ω 0 [T ] = ν(c). Proof We claim that π is a half-integral Q-cover. Suppose the contrary: there exists a Q-feasible T -path P in G such that π(V P ) ≤ 21 . Path P cannot be Q0 -feasible. Therefore, |EP ∩ δ(Q0α )| ≥ 2. Clearly there is a part P1 of P that starts in a terminal tβ , β 6= α, passes through some nodes in Qβ , crosses the cut δ(Qβ ), then passes through some (possibly none) central nodes, and finally ends in a node x ∈ Q0α − Qα . By Corollary 19 there exists an integer (Q0 , c)-feasible multiflow Fx0 of value ω[T ] and an x–tα 0 path P2 in Q0α such that ζ Fx (v) < c(v) holds for all v ∈ V P2 − {x}. Put P := P1 ◦ P2 ; the latter is 0 a Q -feasible T -path in G. Since ω[T ] = ω 0 [T ] = val (Fx0 ) = πc, it follows that Fx0 is a maximum (Q0 , c)-feasible multiflow and π is a minimum Q0 -cover. Now by complementary slackness condition (3.5) one has π(y) = 0 for all y ∈ V P2 − {x}. Therefore, π(V P ) = π(V P1 ) = 21 contradicting that π is a Q0 -cover. By invariant (3.7) it follows that ω[T ] = ω 0 [T ] = ν(c), as required. ¥ The island extension completes by putting ω := ω 0 and Q := Q0 . Lemma 15, Corollary 17, and Lemma 20 imply that the above change of ω and Q preserves invariants (3.1), (3.2), (3.3), (3.6), and (3.7). 11

4.3

Running Time

The algorithm totally performs O(log U ) scaling steps; each of the latter consists of O(n) augmentation steps (by Lemma 11). Each augmentation step is a sequence of at most O(n) extension steps. To bound the complexity of a single extension step note the following. It takes Λ(n, m, U ) time b and flow ω to construct graph G b , see Subsection 4.1. The existence of an augmenting sequence is checked in O(m) time. Next, O(Λ(n, m, U ) log n) time is sufficient to check if the augmenting sequence is fully applicable. If it is not the case, the binary search is performed. The later executes O(log n) checks, each requires solving (MMF). Totally, it takes O(Λ(n, m, U ) log2 n) time. Next, islands Q are extended and function ω is updated, this takes another O(Λ(n, m, U ) log n) time. Finally, transforming ω into the desired multiflow in path packing form takes O(Λ(n, m, U ) log n + mn log n) time. Summing up the above estimates one concludes as follows: Theorem 21 Problem (P) can be solved in O(Λ(n, m, U ) n2 log2 n log U ) time.

References [Bab07] M.A. Babenko. A fast algorithm for path 2-packing problem. Lecture Notes in Computer Science, 4649:70–81, 2007. [Che77] B.V. Cherkassky. A solution of a problem on multicommodity flows in a network. Ekonomika i Matematicheskie Metody, 13(1):143–151, 1977. [FF62]

L. Ford and D. Fulkerson. Flows in Networds. Princeton University Press, 1962.

[Fr89]

A. Frank. On connectivity properties of Eulerian digraphs. Ann. Discrete Math., 41:179-194, 1989.

[GR98] A.V. Goldberg and S. Rao. Beyond the flow decomposition barrier. J. ACM, 45(5):783–797, 1998. [IKN98] T. Ibaraki, A.V. Karzanov, and H. Nagamochi. A fast algorithm for finding a maximum free multiflow in an inner Eulerian network and some generalizations. Combinatorica, 18(1):61–83, 1998. [Kar79] A.V. Karzanov. Combinatorial methods to solve cut-dependent multiflow problems. In: Combinatorial Methods for Flow Problems (Inst. for System Studies, Moscow, iss. 3), pp. 6-69, 1979, in Russian. [Kar94] Alexander V. Karzanov. Minimum cost multiflows in undirected networks. Math. Program., 66(3):313–325, 1994. [Lov76] L. Lov´asz. On some connectivity properties of Eulerian graphs. Acta Math. Akad. Sci. Hung., 28:129–138, 1976. [Lov80] L. Lov´asz. Matroid matching and some applications. J. Combinatorial Theory, Ser. B, 28:208–236, 1980. [Pap07] G. Pap. Some new results on node-capacitated packing of a-paths. In STOC ’07: Proceedings of the thirty-ninth annual ACM symposium on Theory of computing, pages 599–604, New York, NY, USA, 2007. ACM. [Schr03] A. Schrijver. Combinatorial Optimization, vol. A,C, Springer, 2003.

12

[ST83]

D. Sleator and R. Tarjan. A data structure for dynamic trees. J. Comput. Syst. Sci., 26(3):362–391, 1983.

[Vaz01] V. Vazirani. Approximation Algorithms. Springer, 2001.

13

Suggest Documents