A natural randomization strategy for multicommodity flow and related algorithms

A natural randomization strategy for multicommodity flow and related algorithms

Information Processing North-Holland Letters 3 July 1992 42 (1992) 249-256 A natural randomization strategy for multicommodity flow and related al...

622KB Sizes 1 Downloads 104 Views

Information Processing North-Holland

Letters

3 July 1992

42 (1992) 249-256

A natural randomization strategy for multicommodity flow and related algorithms Andrew

V. Goldberg

*

Department of Computer Science, Stanford UniL>ersity,Stanford, CA 94305, USA Communicated by M.J. Atallah Received 1 August 1991 Revised 30 March 1992

Abstract Goldberg, A.V., A natural Letters 42 (1992) 249-256.

randomization

strategy

for multicommodity

flow and related

algorithms,

Information

Processing

We consider the approximation natural randomization strategy related algorithms.

algorithm of Leighton et al. (1991) for the multicommodity flow problem. We give a more that is simpler and results in a better running time. This strategy also applies to several

Keywords: Algorithms,

flows, multicommodity

network

flows

1. Introduction The multicommodity j7ow problem is as follows: given a network with capacity constraints and commodity supplies and demands, find a flow that satisfies the demands without violating capacity constraints (feasible flow>. The multicommodity flow problem is a classical problem that has numerous applications. The concurrent Jlow problem is an optimization version of the multicommodity flow problem, where the goal is to maximize the fraction of the satisfied demands, i.e., to maximize z such that if the demands are multiplied by z, the resulting multicommodity flow problem is feasible.

Correspondence to: Professor A.V. Goldberg, Department of Computer Science, Stanford University, Stanford, CA 94305, USA. * Research partially supported by NSF Presidential Young Investigator Grant CCR-8858097 with matching funds from AT&T and DEC, ONR Young Investigator Award N0001491-J-1855, and a grant from Mitsubishi Corp. 0020-0190/92/$05.00

0 1992 - Elsevier

Science

Publishers

In this paper we work with the concurrent flow problem. We denote the number of nodes in the network by n, the number of arcs by m, the number of commodities by k, the largest capacity by U, the largest demand by D, and assume that capacities and demands are integral. The only known polynomial-time algorithms for the problem are based on polynomial-time methods for linear programming, either the ellipsoid method [7] or the interior-point method [5]. The fastest currently known algorithm, due to Vaidya 1131, takes advantage of the matrix structure to achieve improvement over the underlying interior-point method. This algorithm runs in 0( k3.5n3m0.s log( nDU)) time. For many applications it is sufficient to find an approximate solution to the problem, i.e., a feasible’ solution that ships (1 - E)Z* fraction of the demands, where z * is the optimal value. In these applications, E is a constant or a slowly decreas-

B.V. All rights reserved

249

Volume

42, Number

INFORMATION

5

PROCESSING

ing function of n (e.g. l/n). Shahrokhi and Matula [12] gave an approximation algorithm for a special case of the concurrent flow problem with uniform capacities. Their work motivated several other papers. A faster algorithm for the uniform capacity case was given by Klein et al. [S]. An algorithm for the general version of the concurrent flow problem was given by Leighton et al. [9]. Running time of the deterministic version of this algorithm is dominated by 0 (

k2 E- 2 log: + log II log k & ( 1)

minimum-cost flow computations time of the randomized version by log!

&

+ log y1 log k 1)

+ log IZ log k E

bound on the expected number of minimum-cost flow computations. From the theoretical viewpoint, the dependence on E is a major drawback of the algorithm of [9] since exponential precision is required to solve the multicommodity flow problem exactly. We reduce this dependence by a factor of F- ‘. Our results can also be applied in a straightforward way to improve the results of [S] on the uniform multicommodity flow problem, as well as in the generalizations of the multicommodity flow algorithm to other linear programming problems

[Ill. Grigoriadis and Khachiyan [4], independently of our work, extend the results of [9] to a wider class of problems. Their paper uses a randomization strategy similar to ours and, for the case of 250

and notation

running

minimum-cost flow computations. (For a survey of minimum-cost flow algorithms, see e.g. [2].) In this paper we give a modification of the algorithm that leads to a slightly simpler analysis and allows us to show that the simplest randomization strategy, which selects a commodity to be updated during the next iteration uniformly at random, works better than the more complicated strategy used in [93. We show an -2 log”

the multicommodity flow problem, they obtain the same bounds as we do. This paper is organized as follows. Section 2 gives definitions and notation used in the paper. Section 3 describes relaxed optimality conditions and the exponential length function used by the algorithm. Section 4 describes the algorithm and Section 5 analyses it. Section 6 discusses some aspects of the algorithm and general applicability of our techniques.

2. Definitions and

3 July 1992

LETTERS

In this paper we consider a directed version of the multicommodity flow problem; however, the results also hold for the undirected version with straightforward modifications. An input to the multicommodity flow problem is a graph G = (V, E), a capacity function u : V + R+, ’ and a demand specification for each of the commodities. For each commodity i, 1 < i < k, the specification contains the source si, the sink ti, and a nonnegative demand d,. Without loss of generality we assume that m 2 n and that G has no parallel arcs. We assume that capacities and demands are integers and denote the biggest capacity by U and the biggest demand by D. A multicommodity flow f is given by a set of functions f,, 1 < i < k, f, : E + R+. Each function f, must satisfy conservation constraints VvEV,

c fi(UYL’)- c fi(L’>w> (I.,W)EE (rr,r,)sE di =

-d,

i

0

if L:= ti, if c =si, otherwise.

We define f(v, w) = C, GiGkfi(v, w). A multicommodity flow is feasible if the capacity COIZstraints are satisfied: V(v, w) EE,

f(v,

The concurrent mization version

’ R+ denotes

w)
w).

j7ow problem [12] is an optiof the multicommodity flow

the set of nonnegative

reals.

Volume

42, Number

INFORMATION

5

PROCESSING

problem where the objective is to maximize z such that the problem with demands zd, is feasible. An equivalent problem is to minimize A such that the problem with demands d, and capacities Au is feasible. We define the congestion on arc(L), w) by A(L~,w) =f’(rl, w>/u(u, w), and let * = max(,.,,,, EA(u, w). Let A* denote the optimal value of A. A multicommodity flow f is e-optimal if A < (1 + &)A*. In this paper we consider the problem of finding an s-optimal solution to the problem; throughout the paper we assume that 0 < E G l/8. We also assume that epsilon is at least inverse polynomial in n. If F > l/8, we can run the algorithm with e = l/8. The length function 1: E + Rf is a nonzero, nonnegative function. Let dist,(c, w) denote the shortest path distance in G from 11 to w with respect to 1. To simplify notation, we sometimes view length, capacity, and flow functions as vectors indexed by arcs. Given two vectors a and b, let c

sob=

a(u, w)b(c,

w).

LETTERS

length function equal.

1 for which the above terms are

Lemma 2.3 [9]. For f, 1 as aborje,

C,*(A)

i i=l

uol is a lower bound on A*.

3. Relaxed function

optimality

Theorem 2.1. For a multicommodity flow f satisfying demands di and capacities Au and a length function 1 we have Al 0 u 2 5

dist,(s,,

t,)d;.

(1 +E)f(L’, or

W) >hu(P,

u(u, w)l(U,

length

W)

w) < t(u

0 1).

(1)

< CC:(h).

(2)

i

The first condition states that either an arc is close to being saturated, or its “volume” is small compared to the total “volume”. The second condition states that the total cost of f with respect to 1 is close to the optimal. 3.1. If f, 1, and E satisfy the relaxed conditions, then A is at most (1 + %)A*.

Theorem optima@

Proof. From condition

(l), we have

((

W)l(U, w) +A2

1-I

Given a length function 1, we define the cost of the flow of commodity i by Ci = f, 0 1. Let C,*(A) be the value of the minimum-cost flow f, satisfying the demands of commodity i with costs 1 and capacities Au.

exponential

V(r), w) EE

I

We also use the standard scalar-vector multiplication. The following theorem is a special case of linear programming duality.

and

We use the relaxed optimality conditions below. The second condition is different from that of [9] and is a key to the algorithm improvement.

(1 - 2E) CC,

(I’,W)EE

3 July 1992

= (I.,W)EE >Au

Rewriting, (1 +E)f

1 +&)f(C,

0

m

o1

i

1. we get 0 l>AU

0 l(1 -&)

or Lemma 2.2 [9]. For f, C;, and C*(A) AloLl>

&Ci> 1=1

as above,

1-E ~ALPl
&,*(A). i=l

A multicommodity flow f minimizes A iff there is a

i

,<

j&

Ccw.

(3) 251

Volume

42, Number

By Lemma

5

INFORMATION

2.3 and the previous

Fci*(*)

PROCESSING

l+&

l.401

3 July 1992

Improving the current solution. At each iteration, the algorithm iteratively improves the current flow, until the desired approximation precision is obtained. An iteration (rerouting step) works as follows.

inequality,

~ (1 -&)(1_2&)

A* >

LETTERS

A

> (1 - 4E)A. Since E G l/S,

this implies

Our algorithm uses function. Shahrokhi and first to use such a length of the uniform capacities. tion of this idea introduced Define

A =G(1 + %)A*.

0

an exponential length Matula [12] were the function in the context We use the generalizaby Leighton et al.

euA(‘,‘w) I( U, w) =

U( U, w) .

(4)

Lemma 3.2 [9]. Suppose 1 is defined by (4) and (Y > (1 + E)A-‘E-’ ln(m&-‘). Then the first relaxed optimal&y condition (1) is satisfied.

4. Algorithm

description

The algorithm maintains a multicommodity flow f satisfying the demands and the corresponding exponential length function 1. By Lemma 3.2, the first relaxed optimality condition is always satisfied. While the second condition is not satisfied, the algorithm picks a random commodity and, if the potential function u 0 1 decreases, replaces a fraction of its flow by the minimum-cost flow with respect to the cost function 1. The expected decrease in the potential function is large, ensuring quick termination of the algorithm with high probability. Finding an initial solution. The algorithm starts with an initial solution f such that A < kA*. Such a solution is obtained by finding, for each commodity i, a maximum flow g, in the network with source si, sink t,, and capacity function u, and setting fii(u, WI = gi(u, w)(dJ I gj I>, where I g, I denotes the value of gi. It is easy to see that for the resulting flow f, A G kA*. The length function 1 defined by the initial flow is also computed. 252

1. Compute the length function 1 for f. i from the set (1,. . . , k1 2. Select commodity uniformly at random. the network with capacity function 3. Consider AU and cost function 1. Compute the minimum satisfying decost flow f,* in this network mands for the commodity i. 4. Define fi’= (1 - a)fi + af;*, and let f’ be the multicommodity flow obtained from f by replacing f, by f;‘. 5. If u 0 I> u 0 I’, then replace f by f ‘. The parameters LYand (T are set as follows. Let A, be the value of A after initialization or during the last change in (Y and (T. The values are set to (Y= 2(1 + &)A,;‘&-’ ln(m&P’) and (T = &/4aA0, and updated when A decreases to A,/2 or less. Intuitively, an iteration of the algorithm replaces a u fraction of a random commodity by the same fraction of the optimal flow of this commodity. The flow is updated only if the potential function u 0 1 decreases.

Nonscaling and scaling algorithms. Suppose that an &‘-optimal solution is desired. A simple implementation of the algorithm is to set E to s’/5 at the very beginning, and improve the flow until it satisfies the relaxed optimality conditions. When the conditions are satisfied, the flow is &‘-optimal by Theorem 3.1. An alternative is to scale E. Note, however, that we assumed that E G l/S. Thus the scaling algorithm starts with a constant E (E = l/8) and finds an &-optimal solution f(O). Then at the jth scaling iteration, E is reduced by a factor of two and a new &-optimal solution f(j) is computed starting from f (I- ‘), until the desired precision is reached. As we shall see later, the use of scaling improves the running time of the algorithm by a factor of E- ’ if E is small enough.

Volume

42, Number

5

INFORMATION

PROCESSING

Termination detection. The above description assumes that we know when the current flow satisfies the second relaxed optimality condition (2). This is not the case; however, we can test if the condition is satisfied by computing minimum-cost flows of all commodities. The testing involves k minimum-cost flow computations. We-do the testing at the beginning of every iteration of the algorithm with probability l/k. This increases the worst-case running time bound by only a constant factor.

LETTERS

3 July 1992

we obtain I’( L’, w) ,
w)

u(;yw) (fii*(4

+

WI-hfi(L’, w))44 w)

FCYu Jfi*(vY w)-fj(U, + 2U(V, w)

W)lf(v>

w)’

We have @ - @a =(I-/‘)

5. Algorithm

analysis

Effo-

B aa( For the purpose of the analysis, we define the potential function @ by @ = u 0 1. The next lemma shows that when f, is rerouted, @ decreases by almost aa(Ci - C,*(h)). The proof of this lemma is similar to the proof of [9] showing that @ decreases significantly if a “bad” commodity is rerouted. Let @ and Q0 be the values of the potential function before and after the rerouting, respectively.

Lemma 5.1. @-@O,>,acT(C,-ci*(A)

_&Ci).

Proof. Let I and I’ be the length functions before and after the rerouting. By Taylor’s theorem, for ItI < ~/4 < l/4 we have e”+t

<

0U

ex + t ex + t 1t (

fj -f*)

cl l--

2

Ifi*-fil

O1

>cYu(C,-C,*(A))-&ad,. The last line follows by definition of C, and C,*(A) and by the fact that C, > CT(A) > 0. 0 Note that if the current flow does not satisfy the second relaxed optimality condition, then the expected value of C, - Cj*(A) is large and @ decreases significantly. The following lemma formalizes this statement. Lemma 5.2. Suppose u = @(E/Q!/\) and f does not satisfy the second relaxed optimal@ condition. Then the expected decrease in @ due to a rerouting step is f’I((e2/k>@). Proof. Since the algorithm selects uniformly at random, we have J3@ -

a commodity

@al

ex.

Taking

and

=n

$D. i I

The third line follows from the assumption

that f 253

Volume

42, Number

5

INFORMATION

does not satisfy the second condition and since by (3) l--E IfeA@

relaxed

PROCESSING

optimality

< cc,. i

The last line follows

from the assumption

on u. 0

Note that the algorithm maintains ant A > h,,/2. Also a rerouting can but we claim that A < 2A,,. This is monotonically decreases while A,, change, immediately after a change value of @ is

the invariincrease A, because @ does not of A,, the

and if A > 2A,, then the contribution congested arc to @ is

of the most

e4(1+E)F-‘ln(m-‘) >

@Cl

since F < l/S. Thus the conditions and 5.2 are always satisfied. Next we analyze the nonscaling

of Lemma

3.2

algorithm.

Lemma 5.3. In expected O(ep.iklog(n/e)) iterutions, either the algorithm terminates or A decreases to A,,/2 or less. Proof. We say that an iteration of the algorithm is special if at the beginning of the iteration both relaxed optimality conditions are satisfied. Since we check for termination with probability l/k at the beginning of every iteration, the expected number of special iterations is O(k). Recall that no iteration of the algorithm decreases the value of @. If an iteration is not special, then Lemma 5.2 applies, and the expected decrease in @ during the iteration is fi((~‘/k)@>. We use this fact to bound the number of such iterations. Let f. be the flow immediately after A,, has been changed. At this point, @ < mea’0 since the congestion on any arc is at most A,,. Note that until A decreases by a factor of two, the congestion on some arc is at least A,,/2, so @ > eaAo/*. Thus Cp cannot decrease by more than a factor of meahu/2 without A getting below A,,/2. 254

LETTERS

3 July 1992

Suppose the algorithm were deterministic, with the improvement at every iteration equal to the expected improvement. By Lemma 5.2, O(F-*k) iterations reduce @ by a factor of two. @ can be halved at most O(log(me”A0/2)) = O(C’ . log(n/e)) times before A is halved. Therefore in O(E-‘klog(n/e)) iterations the algorithm terminates or A is halved. Let

be the number of iterations of the hypothetical deterministic version. Next we show the O(t) bound on the expected number of iterations of our randomized algorithm. Such a result is common in analysis of randomized algorithms; see Karp [6] for a summary of the relevant techniques. Let f be the multicommodity flow before an iteration of the algorithm, and let T(f) be the expected number of iterations until the desired decrease in A is achieved. Let h(f) be the random variable corresponding to the flow after the iteration. Note that f determines the distribution of h(f). Then T(f) is given by the probabilistic recurrence relation T(f)

=

Define

i

1 + T( h(f)) o

size(f)

E[ size( h( f))]

if A > A,,/2, otherwise.

= @. By Lemma

5.2,

<

for some constant c > 0. Note that for II large enough, Ee2ck G t and (1 - e’/ck)’ < l/2. By Theorem 3 of [6], for any integer i > 1 and II large enough, (I -

Pr[T(f,,) Therefore,

> ti] G

Ik

G 2-“-l),

1- 2 (

i

E[T(f,,)]

= O(t).

0

Note that the work done by an iteration of the algorithm is dominated by a minimum-cost flow computation. Combined with the above lemma and the fact that initially A G kh*, this yields the following result.

Volume

42, Number

Theorem expected

5.4.

The nonscaling

&-3k log k log:

0 (

minimum-cost

INFORMATION

5

algorithm

PROCESSING

runs in

& 1)

jlow computations.

To analyze the scaling algorithm, following version of Lemma 5.3.

we need

the

Lemma 5.5. Suppose the parameters (Y and (T are set when the congestion is A,,, and the initial flow is O(e)-optimal. Then in expected O(e-*klog(n/e)) or A iterations , either the algorithm terminates decreases by at ieast a factor of two. Proof. Recall that E < l/8, so A,, = O(h*). proof is similar to that of Lemma 5.3, except the upper bound on @ is me”(‘+“(‘)“*) and lower bound is em”*, so @ needs to decrease factor of meaoCE)‘“. 0

The that the by a

The scaling algorithm starts with F = O(l), and obtains an O(l)-optimal solution in O(k log k log m) iterations by Theorem 5.4. Then the scaling process starts. Since the number of rerouting steps needed to reduce E by a factor of two is proportional to E-‘, the last scaling iteration dominates. This iteration terminates in O(E ~ ‘k . log(n/&)) rerouting steps. Theorem pected

5.6. The scaling

E-’

log:

minimum-cost

&

algorithm

runs in ex-

+ log k log n

flow computations.

6. Remarks First, we would like to address the selection of a minimum-cost flow subroutine. Since the costs in the minimum-cost subproblems can be big due to the use of the exponential length function, Orlin’s strongly polynomial algorithm [lo] appears to be the best choice. However, it is enough

LETTERS

3 July 1992

to solve the subproblems approximately; in particular, the cost can be rounded to integers of O(log(nU>> bits long (see [91X When this is done, the cost scaling algorithm of Goldberg and Tarjan [3] or the double scaling algorithm of Ahuja et al. [l] become a better choice. See [91 for more detail. The deterministic version of the algorithm of Leighton et al. [9] finds a commodity i with the biggest C, - C:(h) and reroutes this commodity. Our variant of the relaxed optimality conditions also can be used to analyze this algorithm. Since the maximum of a set of numbers is at least as big as the average, the deterministic choice of i gives an improvement in @ that is at least as big as the expected improvement. Thus the bound on the number of rerouting steps apply for the deterministic version of the algorithm. Each deterministic rerouting step, however, requires k minimum-cost flow computations (to compute C,*(A) for every commodity j); in contrast, a randomized rerouting step requires a single minimum-cost flow computation. Our randomization strategy can also be applied to the algorithm of Klein et al. [8]. This improves the running time bound of the randomized algorithm of [S] by a factor of E-‘. We omit the details, which are straightforward given those of [8,9], and this paper. A recent paper of Plotkin, Shmoys, and Tardos [ll], that extends the results of [9] to a more general class of linear programming problems, also extends our randomization strategy to the more general framework.

Acknowledgment The author would like to thank I&a Tardos and Serge Plotkin for helpful discussions, and Michael Grigoriadis, Robert Kennedy and Tomasz Radzik for comments on a draft of this paper.

References 111 R.K. Ahuja, A.V. Goldberg, J.B. Orlin and R.E. Tarjan, Finding minimum-cost flows by double scaling. Tech. 255

Volume

[2]

[3]

[4]

[S] [6]

[7]

2.56

42, Number

5

INFORMATION

PROCESSING

Rept. STAN-CS-88-1227, Dept. of Computer Science, Stanford University, 1988. A.V. Goldberg, E. Tardos and R.E. Tarjan, Network flow algorithms, in: B. Korte, L. Lovasz, H.J. Prdmel and A. Schrijver, eds., Flows, Paths, and VLSI Layout (Springer, Berlin, 1990) 101-164. A.V. Goldberg and R.E. Tarjan, Finding minimum-cost circulations by successive approximation, Math. Oper. Res. 15 (1990) 430-466; A preliminary version appeared in: Proc. 19th ACM Symp. on Theory of Computing (1987) 7-18. M.D. Grigoriadis and L.G. Khachiyan, Fast approximation schemes for convex programs with many blocks and coupling constraints, Tech. Rept. DCS-TR-273, Dept. of Computer Science, Rutgers University, 1991. N. Karmarkar, A new polynomial-time algorithm for linear programming, Combinatorics 4 (1984) 373-395. R.M. Karp, Probabilistic recurrence relations, in: Proc. 23st Ann. ACM Symp. on Theory of Computing (1991) 190-197. L.G. Khachian, Polynomial algorithms in linear programming, Zh. Vychisl. Mat. i Mat. Fiz. 20 (1980) 53-72.

LETTERS

3 July 1992

[8] P. Klein, S.A. Plotkin, C. Stein and 8. Tardos, Faster approximation algorithms for the unit capacity concurrent flow problem with applications to routings and finding sparse cuts, Tech. Rept. 961, School of ORIE, Cornell University, 1991. [9] T. Leighton, F. Makedon, S. Plotkin, C. Stein, E. Tardos and S. Tragoudas, Fast approximation algorithms for multicommodity flow problems, in: Proc. 23st Ann. ACM Symp. on Theory of Computing, 1991. [lo] J.B. Orlin, A faster strongly polynomial minimum cost flow algorithm, in: Proc. 20th Ann. ACM Symp. on Theory of Computing (1988) 377-387., [ll] S.A. Plotkin, D. Shmoys and E. Tardos, Fast approximation algorithms for fractional packing and covering, in: Proc. 32nd IEEE Ann. Symp. on Foundations of Computer Science (1991), to appear. [12] F. Shahrokhi and D. Matula, The maximum concurrent flow problem, J. ACM 37 (1990) 318-334. [13] P.M. Vaidya, Speeding up linear programming using fast matrix multiplication, in: Proc. 30th IEEE Ann. Symp. on Foundations of Computer Science, 1989.