39
Ž . JOURNAL OF ALGORITHMS 26, 48]86 1998 ARTICLE NO. AL970904 Algorithms for Graphic Polymatroids and Parametric s-Sets Harold N. Gabow* Department of Computer Science, Uni ¤ ersity of Colorado, Boulder, Colorado 80309 Received August 10, 1994; revised September 22, 1997 We present efficient algorithms for finding the covering number, finding a base, and finding the packing number, all in graphic polymatroids. The integral covering number is the arboricity of an undirected graph; computing it is suggested as an Ž open problem by Gallo et al. G. Gallo, M. D. Grigoriadis, and R. E. Tarjan, SIAM Ž. Ž . . J. Comput. 18 1 1989 , 30 ] 55 . We compute the arboricity in time Ž Ž 2 .. O nm log n rm , the same bound as the other parametric flow algorithms of Ž Gallo et al. n and m denote the number of vertices and edges of the given graph, . Ž. respectively . For graphs with integral capacities that are O 1 the time improves to Ž 3r2 Ž 2 .. Om log n rm . Finding a minimum-cost base solves problems like optimal Ž 2 Ž 2 .. reinforcement of a network. We find a base in time Onm log n rm , improving the previous bound of m maximum flow computations. The fractional packing number is known as the strength of a network. We compute it in time Ž 2 Ž 2 .. Ž . Onm log n rm and space Om , improving the best previous result by a factor n in space. Our algorithms are based on a new characterization of the vectors in a graphic polymatroid, and also on an extension of parametric flow techniques to a problem concerning global minimum cuts, called parametric augmentation for s-sets. Q 1998 Academic Press 1. INTRODUCTION Graph problems such as packing spanning trees, computing the strength, and covering by forests are most fruitfully studied using graphic matroids and polymatroids. Previous approaches to such problems have been based Ž . on characterizations of the graphic polymatroid and related polytopes that use network flow, equivalently, s, t-cuts. Recent algorithms for para- metric network flow have proved useful for this approach. We give a new Ž characterization of graphic polymatroids in terms of s-cuts synonymously, * Research supported in part by NSF Grant CCR-92-15199. E-mail: [email protected]. 48 0196-6774r98 $25.00 Copyright Q 1998 by Academic Press All rights of reproduction in any form reserved.

Algorithms for Graphic Polymatroids and Parametrics-Sets

Embed Size (px)

Citation preview

Page 1: Algorithms for Graphic Polymatroids and Parametrics-Sets

Ž .JOURNAL OF ALGORITHMS 26, 48]86 1998ARTICLE NO. AL970904

Algorithms for Graphic Polymatroids and Parametrics-Sets

Harold N. Gabow*

Department of Computer Science, Uni ersity of Colorado, Boulder, Colorado 80309

Received August 10, 1994; revised September 22, 1997

We present efficient algorithms for finding the covering number, finding a base,and finding the packing number, all in graphic polymatroids. The integral coveringnumber is the arboricity of an undirected graph; computing it is suggested as an

Žopen problem by Gallo et al. G. Gallo, M. D. Grigoriadis, and R. E. Tarjan, SIAMŽ . Ž . .J. Comput. 18 1 1989 , 30]55 . We compute the arboricity in time

Ž Ž 2 ..O nm log n rm , the same bound as the other parametric flow algorithms ofŽGallo et al. n and m denote the number of vertices and edges of the given graph,. Ž .respectively . For graphs with integral capacities that are O 1 the time improves to

Ž 3r2 Ž 2 ..O m log n rm . Finding a minimum-cost base solves problems like optimalŽ 2 Ž 2 ..reinforcement of a network. We find a base in time O n m log n rm , improving

the previous bound of m maximum flow computations. The fractional packingnumber is known as the strength of a network. We compute it in timeŽ 2 Ž 2 .. Ž .O n m log n rm and space O m , improving the best previous result by a factor

n in space. Our algorithms are based on a new characterization of the vectors in agraphic polymatroid, and also on an extension of parametric flow techniques to aproblem concerning global minimum cuts, called parametric augmentation fors-sets. Q 1998 Academic Press

1. INTRODUCTION

Graph problems such as packing spanning trees, computing the strength,and covering by forests are most fruitfully studied using graphic matroidsand polymatroids. Previous approaches to such problems have been based

Ž .on characterizations of the graphic polymatroid and related polytopesthat use network flow, equivalently, s, t-cuts. Recent algorithms for para-metric network flow have proved useful for this approach. We give a new

Žcharacterization of graphic polymatroids in terms of s-cuts synonymously,

* Research supported in part by NSF Grant CCR-92-15199. E-mail: [email protected].

48

0196-6774r98 $25.00Copyright Q 1998 by Academic PressAll rights of reproduction in any form reserved.

Page 2: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 49

.s-sets rather than s, t-cuts. We propose a new parametric framework,called parametric augmentation for s-sets, to handle the problems arisingfrom our characterization. This leads to more efficient algorithms forproblems about graphic polymatroids, specifically for covering, finding abase, and packing.

We now state our results precisely and compare them to previous work.Throughout this paper n and m denote the number of vertices and edgesof the given graph, respectively. In this section T denotes the time to findFa maximum flow on a network of n vertices, m edges, and arbitrary

Ž . Ž .capacities. King et al. showed T s O nm log n for b s mr n log n q 2F bw xKRT; see also PhW .

Our covering result is to compute the arboricity of a capacitatedundirected graph. When capacities are integral the integral arboricity is

Žthe smallest number of forests that contain all the edges the capacity of. w xan edge is the number of times it must be covered H . Computing the

arboricity for a graph with arbitrary edge capacities is suggested as anw xopen problem by Gallo et al. GGT . We compute the arboricity in time

Ž Ž 2 ..O nm log n rm , the same time as the other parametric flow algorithmsw x Ž .of GGT . For graphs with integral capacities that are O 1 our algorithm

Ž 3r2 Ž 2 .. w xspeeds up to O m log n rm . This improves the bound of GW , whichŽ � 5r3 1r3 4. Ž .is O min m log n, nm log n for m s V n log n and slightly more

w xotherwise. The algorithm of GW computes the corresponding forests thatŽ . Ž .cover the graph, in the case of O 1 capacities. Our algorithm for O 1

w xcapacities does this also. Earlier algorithms for arboricity include PQ82aŽ . w xfor O 1 capacities and PaW84 for general capacities.

Our second result is to find a minimum-cost base of a graphic polyma-Ž 2 Ž 2 .. w xtroid in time O n m log n rm . This improves the algorithm of C85a

Ž .which uses time O mT . A minimum-cost base algorithm solves otherFproblems in the same time, specifically the problem of optimal reinforce-

w x Žment of a network C85a and optimal augmentation for covering defined.in Section 6 .

Another application of this base algorithm is our packing result, which isto compute the packing number of an undirected graph with edge capaci-ties. The integral packing number is the greatest number of spanning trees

Ž .in the graph an edge can occur in as many trees as its capacity . Thefractional packing number is called the strength of a graph, a measure of

w xits vulnerability C85a, Gu83 . We compute these packing numbers inŽ 2 Ž 2 .. Ž .O n m log n rm time and O m space. This is the same time bound as

w xthe recent algorithm of Cheng and Cunningham CC and it improves theirŽ .space bound of O nm . Previous algorithms for strength include Cunning-

w x Ž . Ž .ham’s original algorithm C85a using O nmT time and O m space, andFŽ 2 Ž 2 .. Ž 2 .Gusfield’s algorithm using O nm log n rm time and O m space

w xGu91 .

Page 3: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW50

For large capacities our algorithms do not find the actual trees forcovering or packing. For packing our algorithm does find the set of edges

Ž .composing the trees this of course is trivial for covering . Furthermore weshow how to convert this set to the desired trees: We prove that finding aminimum cover of an undirected graph by forests reduces to packing thegreatest number of rooted arborescences in a corresponding digraphŽ .Corollary 3.1 . This approach is used to efficiently find a minimum forestcover or maximum packing of spanning trees in a capacitated undirected

w xgraph in GM . Furthermore, when the given undirected graph has a costfunction on the edges, our approach finds the edges in a maximum packing

w xof spanning trees that has minimum cost possible. The algorithms of GMw xagain find the corresponding packing. However, the algorithms of GM

Žare slower than the ones of this paper e.g., the strong polynomial timeŽ 3 Ž 2 ...bound is O n m log n rm .

We turn to the methodology used for these results. At the highest levelour algorithms are implementations of Newton’s method for fractionaloptimization. This method is used for graphic matroids and polymatroids

w xin C85a, PQ82a, PaW84 . We show that for arbitrary polymatroids thepacking and covering problems can be solved efficiently by Newton’smethod, assuming an oracle that finds a base. We propose the ‘‘prefixalgorithm,’’ an algorithm that finds a polymatroid base and is well-suitedfor implementing Newton’s method for packing.

We present a new characterization of vectors in graphic polymatroids.w xPrevious work C85b, PQ82b, PaW83 tests a vector for membership in a

Ž .graphic polymatroid equivalently, the forest polytope by solving n net-w xwork flow problems. The algorithm of CC is based on a characterization

w xof Barahona B that tests a vector for membership in the dominant of thespanning tree polytope, also using n network flow computations. Ourcharacterization tests a vector for membership in a graphic polymatroid by

Ž .solving one network flow problem i.e., a minimum s, t-cut problem andone minimum t-cut problem. This is closely related to the above-men-tioned reduction of undirected covering to directed packing.

Our characterization leads to parametric problems for analyzing graphicpolymatroids that differ from the parametric network flow problems intro-

w xduced by GGT . We formulate a parametric problem concerning theglobal minimum cut, which we call ‘‘parametric augmentation for s-sets.’’

w xWe extend the global minimum cut algorithms of Hao and Orlin HO andw xGabow Ga95a to solve this problem efficiently on graphs with large and

small capacities, respectively. We believe parametric augmentation willfind other applications in future work. Aside from the applications in thispaper, parametric augmentation for s-sets has been used to solve several

w xproblems in GM .

Page 4: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 51

The paper is organized as follows. Section 2 discusses Newton’s methodfor covering and packing, and formulates the prefix algorithm. Section 3shows how to transform membership questions for graphic polymatroidsinto s, t-cut and s-cut problems. Section 4 discusses the parametric aug-mentation problem for s-sets. Section 5 gives our algorithms for arboricity.Section 6 implements the prefix algorithm to find a base in a graphicpolymatroid. Section 7 applies the prefix algorithm to packing in graphicpolymatroids. The rest of this section gives notation, definitions, and some

Žbackground on polymatroids. More complete treatments of polymatroidsw x .are in C85a, W .

R denotes the set of real numbers, R the set of nonnegative realqw x �numbers, Z the set of integers. For integers i, j, i . . j denotes k g Z:

4i F k F j .Consider a universe V containing elements s, t and subsets S, T. S

denotes the complement V y S. We use both set containment S : T andproper set containment S ; T. We often denote singleton sets by omittingset braces, e.g., s j X. An st-set contains s but not t; more generally anSt-set contains S but not t; a t-set is a nonempty set not containing t. Wedo not distinguish between a function f : S ª R and a vector f g RS. For

Ž . � Ž . 4such an f and any set T : S, f T denotes Ý f t : t g T .In a graph with vertices ¨ and w, the notation ¨w denotes an undirected

edge joining ¨ and w or a directed edge from ¨ to w; it will be clear fromcontext which is meant.

Ž .Let W be a set of vertices in a graph G. g W denotes the set of allŽ . Ž Ž ..edges with both ends in W. If G is directed then d W r W denotes the

Ž .set of edges u¨ with W a u¨-set ¨u-set . If the graph G is not clear weŽ .write it as a subscript, e.g., d W . If G has a capacity function c:G

Ž . Ž Ž .. Ž Ž Ž ...E ª R then the out-degree in-degree of W is c d W c r W .qConsider the set of vectors RE. For vectors b and c, b F c means b F ci i

for each i g E. A polymatroid function is a function f : 2 E ª R such thatqŽ .f B s 0, and f is nondecreasing and submodular, i.e., for any subsets

Ž . Ž . Ž . Ž . Ž .A, B of E, A : B implies f A F f B , and f A q f B G f A j B qŽ . Ž . � E Ž .f A l B . Such an f determines the polymatroid P f s b g R : b F FqŽ . 4 Ž .f F for all F : E . For an undirected graph G s V, E the graphic

Ž .polymatroid function r has r F equal to the number of edges in anyŽ . Ž .maximal forest of F, for any F : E. For any k g R , P kr s kP r is aq

graphic polymatroid.Ž .Fix a polymatroid P s P f . A set F : E is closed in P if F ; F9

Ž . Ž .implies f F - f F9 . Fix a vector b g P. A set F : E is tight for b ifŽ . Ž . Ž .b F s f F . The union of tight sets for b is tight by submodularity . Thus

b has a unique maximal tight set T. It is easy to see that T is closed.

Page 5: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW52

E Ž .For any vector c g R , a base or P-base of c is any maximal vectorqb g P with b F c. Any such b has

b E s min c F q f F : F : E . 1Ž . Ž . Ž . Ž .� 4

Ž .It is not hard to see that the minimizing set F* in 1 can be taken as themaximal tight set of b. In fact this extends to show that this minimizer F*,i.e., the maximal tight set of a base, is uniquely determined by c.

The polymatroid greedy algorithm finds a minimum-cost P-base b of agiven vector c, as follows. It initializes b to the zero vector. Then it

Ž < <.examines each component i 1 F i F E in order of nondecreasing cost.For each i, it increases b as much as possible while keeping b g P andib F c.

2. NEWTON’S METHOD FOR COVERING AND PACKINGIN POLYMATROIDS

This section discusses the application of Newton’s method to coveringand packing problems in polymatroids. It proposes the prefix algorithm asan efficient way to find a base in Newton’s method.

We begin by defining the two problems, starting with packing. ConsiderŽ . E Ž .a polymatroid P s P f and an arbitrary vector c g R . The fractionalq

Ž .P-packing number of c is the largest k g R such that a P kf -base b of cqŽ . Ž .has b E s kf E . The integral P-packing number is the floor of this value.

To see why this corresponds to packing fix f as an integer-valued polyma-w x Ž w x.troid function. Baum and Trotter BT and independently Giles Gi show

Ž .that for any integer k, any integral vector in P kf is the sum of k integralŽ .vectors in P f . This implies the following characterizations for integral f ,

Ž .P s P f , and an integral vector c. The integral P-packing number of c isŽthe greatest number of integral P-bases summing to at most c. Note that,

for any integral polymatroid function g, any integral vector has an integralŽ . w x .P g -base W . The fractional P-packing number of c is the greatest

numerical ‘‘weight’’ k such that some collection of P-bases, each with apositive rational weight, has total weight k and weighted sum at most c.

Ž .Turning to covering, consider a polymatroid P s P f and any vectorE Ž . Ž . Ž .c g R such that c e s 0 whenever f e s 0. The fractional P-co¨eringq

Ž .number of c is the smallest k g R such that c g P kf . The integralqP-co¨ering number is the ceiling of this value. Assuming f and c areintegral and reasoning as above we see that the integral P-coveringnumber of c is the smallest number of integral vectors in P with sum c.The fractional P-covering number of c is the smallest weight k such that

Page 6: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 53

some collection of integral vectors in P, each with a positive rationalweight, has total weight k and weighted sum c.

A number of previous algorithms for covering and packing in graphicw xpolymatroids C85a, PQ82a, PaW84 have been based on Newton’s method.

We now summarize this approach, at the same time generalizing it toarbitrary polymatroids.

We first describe Newton’s method for fractional optimization, alsow x � Ž . Ž . 4known as Dinkelbach’s method D . It computes min a x rb x : x g XX .

Ž .Here XX is a set endowed with functions a , b : XX ª R with b x ) 0 for allx g XX . An equivalent problem is to find the largest value k makingŽ . Ž .a x G kb x for all x g XX . In this version it makes sense to relax the

Ž . Ž .assumptions and allow b x s 0 if it implies a x G 0.The algorithm maintains a value k that is an upper bound on the

Ž Ž . Ž .desired value. k is initialized to any upper bound e.g., a x rb x for anyŽ . .x with b x / 0 . Then the following loop is executed:

� Ž . Ž . 4while min a x y kb x : x g XX - 0 do begin� Ž . Ž . 4let x* be a minimizer of a x y kb x : x g XX ;

Ž . Ž .k ¤ a x* rb x* ; end;

Ž .The assumptions imply b x* is never zero. Thus the assignment to k iswell-defined and maintains k as an upper bound on the desired value.

ŽHence if the algorithm halts, k equals the desired minimum value and x*.is a minimizer . Examining x* shows that each assignment to k reduces its

value. Any iteration of the loop is called a Newton iteration.The next two results show that for our polymatroid problems Newton’s

method does a small number of iterations and each iteration amounts to asimple polymatroid problem.

ŽTHEOREM 2.1. Newton’s method can be used to compute the integral or. Ž .fractional P f -co¨ering or packing number of a ¨ector c. Each iteration

amounts to finding a base of c and its maximal tight set in a polymatroidŽ .P kf .

Proof. First consider the problem of finding the packing number of aŽ . Ž . Ž .vector c for an arbitrary polymatroid P f . Formula 1 Section 1 implies

the packing number is the largest k such that every set X : E hasŽ . Ž . Ž . Ž Ž . Ž .. Ž .kf E F c X q kf X , i.e., k f E y f X F c X . Finding this k is the

Ž .second optimization problem for Newton’s method. Since c X G 0 New-ton’s method is applicable.

The initialization of Newton’s method is simple, e.g., choosing X s BŽ . Ž .gives c E rf E as a valid upper bound. Each Newton iteration computes

� Ž . Ž . 4 Ž . Ž .min c X q kf X : X : E y kf E and a minimizer. By 1 the mini-Ž .mizer X can be chosen as the maximal tight set of a P kf -base of c, as

claimed.

Page 7: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW54

Now consider the problem of finding the covering number of a vector cŽ .for an arbitrary polymatroid P f . The definition implies the covering

Ž . Ž .number is the smallest k where c is a base of c in P kf . By 1 thisŽ . Ž . Ž . Ž . Ž .means that any set X : E has c E F c X q kf X , i.e., c X F kf X .

Ž . Ž . Ž .Thus we seek the largest value yk such that yc X G yk f X forevery X : E. This is the second optimization problem for Newton’s method.

Ž . Ž .By the assumption for covering f X s 0 implies c X s 0 so Newton’smethod is applicable.

Ž . Ž .We initialize k to a convenient upper bound such as yc E rf E . Sincethe initial k is negative all values of k are negative. Each Newton iteration

� Ž . Ž . 4computes min yc X y kf X : X : E and a minimizer. This is the same� Ž . Ž . 4 Ž .as computing min c X y kf X : X : E y c E and a minimizer. Since

k is negative the desired minimizer X is the maximal tight set of aŽŽ . .P yk f -base of c. Thus each Newton iteration finds a polymatroid base

as claimed.

COROLLARY 2.1. Let f be an integral polymatroid function. Newton’sŽ . Ž . Ž .method for P f -co¨ering or P f -packing performs at most f E complete

iterations.

Proof. The previous discussion shows that each Newton iteration com-� Ž . Ž . 4putes min c X q kf X : X : E , where k ) 0 is increasing for covering

and decreasing for packing. It is well-known that when k is increasingŽ . Ž . Ž .decreasing , each complete iteration strictly decreases increases f X ,for X the minimizer of the iteration. This fact is true even for a totally

Ž w x.arbitrary function f see, e.g., S . The fact implies the corollary. Forcompleteness we prove the fact here, showing the following slightly strongerversion: The minimizers T for each complete Newton iteration form a

Ž . Ž .nested family, with f T strictly decreasing increasing when k is increas-Ž .ing decreasing .

First we observe a general property of polymatroids. Consider a polyma-troid function f and a vector c g RE . For positive real values k - k9 let Tq

Ž .be the maximal tight set of a P kf -base of c, and similarly for T 9. ThenŽ . Ž .T 9 : T and furthermore f T 9 - f T unless T 9 s T. In proof let y9 be a

Ž . Ž . Ž .P k9 f -base of c. Let y s krk9 y9. Then y g P kf with T 9 tight, andŽ .y F c. Thus y can be enlarged to a P kf -base of c with tight set including

T 9. Hence T 9 : T. The second part of the property follows since T 9 isclosed.

Now assume the above sets T and T 9 are the sets chosen as minimizersŽ Ž .in two consecutive complete Newton iterations. T 9 is found after before

Ž ..T when k is increasing decreasing . The above property shows T 9 ; TŽ . Ž . Žand f T 9 - f T it is easy to see the minimizers for two consecutive

.complete iterations are distinct .

Page 8: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 55

We now give a refined version of Newton’s method for packing inpolymatroids. Section 7 implements this method for graphic polymatroids.Our algorithm for covering in graphic polymatroids uses ideas in Theorem2.1 but goes beyond it.

Each Newton iteration can be implemented by using the greedy algo-Žrithm for finding a polymatroid base. Recall that the greedy algorithm

finds a minimum-cost base. For a Newton iteration we can take the cost of. < <each element to be zero. The greedy algorithm finds a base in E

Ž < < Ž ..iterations, so Corollary 2.1 implies O E f E greedy-algorithm iterations.We improve this bound by using a variant of the greedy algorithm that wecall the prefix algorithm. We first describe the prefix algorithm and thenshow how it is used in Newton’s method for packing.

Fix a polymatroid P with a cost vector a g RE. We seek a minimum-costbase b of a given vector c g RE , i.e., b is a P-base of c having theq

Žsmallest possible inner product ab. Note that although costs are irrelevantin Newton’s method, they are used in the application of the prefix

.algorithm in Section 6.Consider any vector b g RE. For a subset F : E, b denotes theF

restriction of b to F, i.e., all components not in F are set to 0. Suppose EŽ < <.is indexed from 1 to m m s E . We identify each element with its index.

For i, j g E, b abbreviates b . A prefix of b is b itself or a vector pi . . j w i . . j xwhere, for some index i, 1 F i F m, b F p - b . In the latter case1 . . iy1 1 . . ip is an i-prefix; in the former case b is an m-prefix of b. A longest prefix ofb satisfying some condition is a lexically maximum prefix p of b that

Ž Ž . .satisfies the condition equivalently, p E is maximum .The prefix algorithm works as follows. Index the elements of E from 1 to

m so cost is nondecreasing. The algorithm maintains an index i F m, avector b g RE , and a set T : E. Each iteration increases i to some newqvalue and makes b the vector found by the first i iterations of the greedyalgorithm. T is a tight set for b in P.

i ¤ 0; b ¤ 0; T ¤ B;while i - m do begin

Ž .b ¤ the longest prefix of b q c that is in P ;w iq1 . . m xyT

let b be an i-prefix;Ž .T ¤ the maximal subset of E that is tight for b in P ; end;

ŽThe prefix algorithm is correct i.e., it halts with b equal to a minimum-. Žcost base of c because it maintains i and b as stated above i.e., b is the

.vector computed by the first i iterations of the greedy algorithm .The prefix algorithm does at most as many iterations as the greedy

algorithm, but for graphic polymatroids and certain others it does fewer.Ž .Specifically we show that if P s P kf for an integer-valued function f

Page 9: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW56

Ž .and positive real value k then there are at most 1 q f E completeiterations. This follows since each complete iteration other than the last

Ženlarges T. In proof, a complete iteration not the last ends with b - c ,i i.where i f T before the iteration and i g T after the iteration. Since each

Ž . Ž .T is closed, kf T is strictly increasing, and so is f T .The crucial part of implementing the prefix algorithm efficiently is the

first line of the loop, finding the longest prefix b. For graphic polymatroidsw xwe use the ‘‘steppingstone approach’’ proposed in GW for matroids: We

use a polymatroid SP that contains P and is computationally simpler. Wefind b as follows:

Ž .p ¤ the longest prefix of b q c that is in SP ;w iq1 . . m xyT

Ž .b ¤ the longest prefix of p that is in P ;

This modification finds the same vector, say b*, as found by the originalalgorithm: P : SP implies b* is a prefix of p.

This completes the definition of the prefix algorithm. Now we give thepacking algorithm based on it. The idea is to carry over the base b andtight set T from one Newton iteration to the next. The details are as

Žfollows. Note that although costs are irrelevant for Newton’s method, we.will use them as a convenient way to order the elements.

Make b and T global variables, so they both retain their value from theŽprevious iteration. The first Newton iteration chooses an arbitrary cost say

.zero for each element and runs the prefix algorithm unchanged. For aniteration after the first, let k and k be the previous and current values ofy

< <k, respectively. Let t s T . Revise costs so that any element of T ischeaper than any element of E y T. Reindex E according to this costfunction, so the elements of T are indexed from 1 to t. Change theinitialization of the prefix algorithm to the following:

ki ¤ t; b ¤ b ;1 . . tky

Ž . Ž . Ž .These statements make T tight for b, i.e., b g P kf and b T s kf T .The rest of the algorithm is unchanged.

COROLLARY 2.2. Let f be an integral polymatroid function. Newton’sŽ .method for P f -packing using the prefix algorithm finds a total of at most

Ž .2 f E q 1 prefixes.

Proof. Corollary 2.1 shows Newton’s method for packing has at mostŽ .f E complete iterations. Each complete iteration of the prefix algorithm

except the last in its Newton iteration enlarges T. Since T is closed inŽ . Ž . Ž .P f this occurs at most f E times. This gives at most 1 q 2 f E

iterations of the prefix algorithm.

Page 10: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 57

3. A CHARACTERIZATION FOR GRAPHICPOLYMATROIDS

This section shows how to transform problems about graphic polyma-troids into s, t-cut and t-cut problems. The preliminary version of this

w x Ž .paper Ga95b proved the basic result Theorem 3.1 using the ‘‘equivalentw xgraph’’ construction introduced in Ga94 . Here we offer a different proof

based on orientations of graphs. The result can also be deduced fromw xFrank’s characterization F79b of coverings of digraphs by branchings.

After our proof we discuss the relation to Frank’s characterization.We illustrate the ideas of this section using the graph G shown in0

Ž .Fig. 1 a . All edges have capacity 1 except the capacity-2 edge shown.Ž .Figure 1 b shows a minimum covering of G by two forests.0

Ž .For an undirected graph G s V, E , let D be the set of directed edgescorresponding to E, i.e., each undirected edge ¨w g E corresponds to twodirected edges ¨w, w¨ g D. An orientation of a function c : E ª R is aE q

Ž . Ž . Ž .function d: D ª R such that c ¨w s d ¨w q d w¨ for every undi-q Erected edge ¨w g E. In addition if c is integral-valued we require d to beEintegral-valued. For a function c : V ª R a c -orientation is an orienta-V q V

Ž . Ž Ž ..tion where every vertex ¨ g V has in-degree at most c ¨ , i.e., d r ¨V DŽ .F c ¨ . We require d to be integral-valued if both c and c areV E V

integral-valued.In this paper we often choose the above function c : V ª R to have aV q

Ž .constant value k, i.e., c ¨ s k for every k g V. We denote this functionVŽ .by k, e.g., we speak of a k-orientation. Figure 2 a shows a 2-orientation

of G .0Ž .Consider an undirected graph G s V, E with functions c : E ª RE q

Ž .and c : V ª R . We define a digraph G* c , c . We abbreviate this toV q E VG* when possible. G* is the well-known bipartite version of an undirected

Ž w x . � 4graph see PQ82a and its references . G* has vertex set s, t j V j E.The fact that ¨ g V and e g E occur in G* as well as in G will not cause

� 4 � 4 �confusion. The edge set of G* is se: e g E j e¨ , ew: e s ¨w g E j ¨t:4 Ž .¨ g V . We define a capacity function c on G* by the identities c se s

Ž . Ž .FIG. 1. a Example graph G . b Covering of G by two forests.0 0

Page 11: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW58

Ž . Ž .FIG. 2. a 2-orientation of G . b 2-equivalent graph EG of G .0 0 0

Ž . Ž . Ž . Ž . Ž . Žc e , c e¨ s c ew s `, c ¨t s c ¨ . Note that we will often use theE VŽ . .graph G* c , k for the constant function k.E

The following result on orientations was first proved by Frank andw xGyarfas FG . We give an alternate proof based on the graph G*. This´ ´

proof will justify the approach used in our algorithms.

Ž .LEMMA 3.1. Consider an undirected graph G s V, E with functions c :EŽ Ž ..E ª R , c : V ª R . c has a c -orientation if and only if c g W Fq V q E V E

Ž .c W for e¨ery subset of ¨ertices W : V.V

Ž .Proof. Consider G* c , c . There is a one-to-one correspondenceE Vbetween c -orientations of c and flows on G* from source s to sink t ofV E

Ž .value c E . Specifically such a flow f gives a c -orientation d by settingE VŽ . Ž . Ž . Ž .d ¨w s f ew and d w¨ s f e¨ for every edge e s ¨w g E. Hence it

Ž .suffices to show that G* has a flow of value c E exactly when theEcondition of the lemma holds.

Ž .G* has a flow of value c E if and only if every s, t-cut has capacity atEŽ .least c E . In the rest of this argument let ‘‘cut’’ abbreviate ‘‘s, t-cut.’’E

Every set of vertices W : V corresponds to a cut of G* whose source sideŽ .is the vertex set s j W j g W . In fact it is easy to see that a minimum

Ž . Ž Ž .. Ž .cut of G* has this form. This cut has value c E y c g W q c W .E E VŽ .Hence every cut has capacity at least c E if and only if every set ofE

Ž . Ž Ž .. Ž . Ž . Ž .vertices W satisfies c E y c g W q c W G c E , i.e., c W GE E V E VŽ Ž ..c g W .E

Ž .Next consider a digraph G s V, E and functions d : E ª R and d :E q VŽ .V ª R . Assume that every vertex ¨ g V has in-degree at most d ¨ ,q V

Ž Ž .. Ž . Ž .i.e., d r ¨ F d ¨ . The d -equi alent graph of d is the digraphE G V V EŽ � 4.EG s V j t, E j t : ¨ g V , where t is a new vertex not in V, with

Ž . Ž . Ž . Ž .capacity function c defined by c e s d e for e g E and c t s d ¨E VŽ Ž .. Ž .y d r ¨ for ¨ g V. Figure 2 b shows the 2-equivalent graph corre-E G

Ž .sponding to Figure 2 a .

Page 12: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 59

It is easy to see that, for any set of vertices W : V,

c r W s d W y d g W . 2Ž . Ž . Ž . Ž .Ž . Ž .EG V E EG

Ž .This follows since the set of edges directed to vertices of W is r W jEGŽ . Ž .g W , and d W is the total of all in-degrees of vertices of W.EG V

Ž .Fix an undirected graph G s V, E with associated functions c : E ªEŽ .R , c : V ª R . Any c -orientation of c if such exist gives a corre-q V q V E

sponding c -equivalent graph, which we call a c -equi alent graph of c .V V EŽ . Ž .Thus Fig. 2 b shows a 2-equivalent graph of the capacity function of G .0

A function c can have more than one c -equivalent graph. Hence theE Vterm ‘‘some c -equivalent graph of c ’’ refers to the c -equivalent graphV E Vfor some c -orientation, and ‘‘every c -equivalent graph of c ’’ refers toV V Ethe equivalent graph for every c -orientation.V

Ž .Now consider an undirected graph G s V, E . We characterize theŽ . Žgraphic polymatroid P s P kr of G recall r is the graphic polymatroid

.function of G . We also characterize the related bicircular polymatroidŽ .SP s P ks of G. Here s is the bicircular polymatroid function defined

Ž .from G as follows: For any set F : E, s F is the number of distinctvertices on edges of F. It is easy to check that s is submodular, and in fact

Ža polymatroid function. When considered as the rank function of aw x .matroid, s defines the bicircular matroid of G M . Note that P : SP,

since r F s.The following condition plays an important role. It applies to a digraph

D with distinguished vertex t.

Every t-set of D has in-degree at least k . 3Ž .

Ž .THEOREM 3.1. Let G s V, E be an undirected graph and let k g R .qŽ . Ž .Let P s P kr be the graphic polymatroid of G and SP s P ks the bicircular

polymatroid of G. Let b g RE .q

Ž .i b g SP if and only if b has a k-orientation.Ž . Ž .ii If b g P then b g SP and e¨ery k-equi alent graph of b satisfies 3 .Ž . Ž .iii If b g SP and some k-equi alent graph of b satisfies 3 then

b g P.

Ž .Proof. For i it is easy to see that b g SP if and only if every set ofŽ Ž .. < < Ž .vertices W : V has b g W F k W . Now i follows from Lemma 3.1 if

we choose c to be b and c to be the constant function k.E VIt is not hard to see that b g P if and only if every nonempty set of

Ž Ž .. Ž < < .vertices W : V has b g W F k W y 1 , or equivalently,

< <k F k W y b g W .Ž .Ž .

Page 13: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW60

In every k-equivalent graph of an arbitrary vector b, the in-degree of anyset of vertices W is given by the right-hand side of the displayed inequality.

Ž .This follows from Eq. 2 , taking d to be the constant function k and dV EŽ Ž Ž ..to be a k-orientation of b. Note that the latter implies d g W sE EG

Ž Ž .. . Ž . Ž .b g W . Now it is easy to verify ii and iii .

The equivalent graph provides even more information about graphicpolymatroids. We will give two more facts used in this paper. In thestatement of Corollaries 3.1 and 3.2 below and throughout the rest of thissection, fix G, b, k, and P as in Theorem 3.1, with b g P.

Ž .Recall that a vector in the graphic matroid P r is a forest of G; for kŽ .integral, an integral vector in P kr can be partitioned into k forests

Ž .recall the second paragraph of Section 2 . We will show that the represen-Ž .tation of b g P s P kr as a collection of forests can be found in any

k-equivalent graph of b. We begin by reviewing two theorems of EdmondsŽ .also used in Section 4 . Fix a digraph H with a capacity function c, and fixa vertex t.

A branching in H is a set of edges that is a forest when edge directionsare ignored, and has at most one edge directed to each vertex. A spanningt-arborescence is a branching that has exactly one edge directed to every

Ž .vertex except t. Thus no edge is directed to t. A packing of arborescencesin H is a collection of spanning t-arborescences with each edge e in at

Ž .most c e arborescences. Figure 3 shows a packing of arborescences in theŽ .digraph of Fig. 2 b . Edmonds showed that H has a packing of k arbores-

Ž . w xcences if and only if H satisfies 3 E72 .For a nonnegative integer k, a complete k-intersection in H consists of k

Ž .spanning trees formed from edges of H we ignore edge directions , suchŽ .that each edge e of H belongs to at most c e trees, and each vertex ¨ / t

Žhas exactly k tree edges directed to it. Note that the k edges directed to ¨w xcan be in any subset of the spanning trees. Unlike Ga95a , this paper

assumes that a complete k-intersection is always given with its partition.into k spanning trees. Obviously a packing of k arborescences is a special

type of complete k-intersection. Edmonds showed that H has a completew xk-intersection if and only if it has a packing of k arborescences E69 .

FIG. 3. Packing of two arborescences in EG .0

Page 14: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 61

We begin by assuming that k and b are integral. We wish to partitionb g P into k forests.

COROLLARY 3.1. For an integral ¨ector b g P, e¨ery k-equi alent graphof b has a packing of k arborescences. Starting with such a packing, or moregenerally starting with a complete k-intersection, deleting t and ignoring edgedirections gi es a representation of b as a collection of k forests.

Remark. Figures 1]3 illustrate the corollary: the packing of Fig. 3 givesŽ .the covering of Fig. 1 b .

Proof of Corollary 3.1. Theorem 3.1 and Edmonds’ theorem imply thatevery k-equivalent graph of b has a packing of k arborescences. Let T bea complete k-intersection in any k-equivalent graph EG of b. Ignoring thedirections of edges in T , we claim that every edge e of G occurs in

Ž .precisely b e trees of T. This claim implies that T y t gives the desiredpartition of b into k forests.

We prove the claim in two steps. First observe that, for each edge e s xyŽ . Žof G, the total capacity of xy and yx in EG is b e since EG comes from

.an orientation of b . This observation implies that, to prove the claim, it< <suffices to show T consists of all the edges of EG. T contains k V edges,

< <since EG has V q 1 vertices. So it suffices to show the edges of EG have< <total capacity k V . The total capacity of EG equals the total in-degree of

all vertices of V in EG. Each of these vertices has in-degree k. Thisproves the claim.

The corollary extends easily to the case where k and b take on arbitraryrational values. The extension states that every k-equivalent graph of bhas a collection of spanning t-arborescences T , each with a nonnegativeirational weight w , such that Ýw s k and, furthermore, ignoring edgei idirections the total weight of all arborescences containing a given edge e

Ž .of G is precisely b e . Thus deleting t gives a partition of b into forests oftotal weight k. This is proved by reduction to the integral case.

w xThe algorithm of Ga95a finds a complete k-intersection efficiently forŽ .small k see Section 4 . This in conjunction with Corollary 3.1 allows our

algorithm for covering graphic polymatroids with small capacities to find aŽ .corresponding forest decomposition see Section 5 . Corollary 3.1 is also

w xused in GM to find a maximum packing of spanning trees and a minimumcovering by forests in a capacitated graph. These results are based on an

Žefficient algorithm to find a maximum packing of arborescences. The.algorithms are slower than the other algorithms of this paper. Appendix A

gives two other properties of equivalent graphs that are used in thew xpacking algorithms of GM .

Corollary 3.1 can be rephrased as follows: An integral vector b has acovering of k forests if and only if b has a k-orientation, and every

Page 15: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW62

w xk-orientation of b can be covered by k branchings. Frank F79b haspresented the following theorem: A digraph can be covered by k branch-ings if and only if every vertex has in-degree at most k, and the undirectedgraph formed by ignoring edge directions can be covered by k forests. It isnot hard to see that this theorem and our statement about branchings areequivalent. In fact it is not hard to deduce Theorem 3.1 from Frank’stheorem. Our derivation of Theorem 3.1 will be useful in this paperbecause we construct orientations using the graph G* as in the proof ofLemma 3.1. Frank’s derivation is based on a min]max result concerning

w xcuts of a digraph, proved using kernel systems F79a .To motivate the next relation recall from Theorem 2.1 that each Newton

iteration computes the maximal tight set for a base.

COROLLARY 3.2. Let EG be any k-equi alent graph of b g P. Themaximal tight set T of b consists of all edges ha¨ing both ends in a t-set of

� Ž . 4in-degree k in EG. Equi alently, T s D g U : U g UU for UU the family ofGmaximal t-sets of in-degree k in EG.

� Ž .Proof. First observe that a closed set of P has the form D g U :G4 Ž .U g UU for UU a family of disjoint sets of vertices. A set g U is tight for bG

Ž Ž .. Ž < < . Ž .if b g U s k U y 1 . As previously noted, 2 shows the in-degree ofG< < Ž Ž .. Ž .any set U : V in EG is k U y b g U . Hence g U is tight for b if theG G

in-degree of U in EG is k. This implies the equation given for T in thelemma.

We close this section with motivation for the next section. Our graphicpacking algorithm amounts to implementing the prefix algorithm. Recallthe main task is, given a vector u, find the longest prefix of u that is in P.The prefixes of u will give a family of equivalent graphs, parameterized bya value l. As Theorem 3.1 suggests, our task will be to find the smallestparameter value l where each t-set has in-degree at least k. The nextsection defines a parameterized problem that generalizes this task. Thegeneralization is also the key to our covering algorithm.

4. PARAMETRIC AUGMENTATION

This section defines our parametric problem on digraphs and presentstwo efficient solutions. The algorithm of Section 4.1 is efficient for largecapacities. The algorithm of Section 4.2 solves a special case of theparametric problem more efficiently for small capacities.

Page 16: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 63

4.1. Parametric Augmentation for s-Sets

Ž .The parametric augmentation problem for s-sets is defined by a digraphŽ .G s V, E with distinguished vertex s and parameterized capacity func-

tion c : E ª R . Here l is a parameter in R . Also given is a targetl q qfunction t : R ª R . The goal is to find the smallest value of l such thatq qthe in-degree of every s-set is at least the target value. More precisely,

Ž .assume that every s-set U has an associated value l possibly infiniteUsuch that

c r U G t l if and only if l G l .Ž . Ž .Ž .l U

� 4 �The problem is to find l s max l : U an s-set . Equivalently l s min l:UŽ Ž .. Ž . 4c r U G t l for every s-set U .l

We make some additional assumptions that allow the problem to beŽ .solved efficiently. Assume that given U we can compute l in time O m .U

Ž . Ž .Also given l and an edge e we can compute c e in O 1 time. Finallyl

and most importantly we assume the following monotonicity properties forthe capacities:

Ž . Ž . Ž .i c e is nondecreasing for each e g d s ;l

Ž . Ž . Ž .ii c e is nonincreasing for each e f d s ;l

Ž . Ž Ž ..iii for each vertex ¨ / s, c r ¨ is nondecreasing.l

Sections 5 and 6 involve parametric augmentation problems for specialŽ Ž .cases of these monotonicity properties in Section 5, ii holds because

Ž . Ž . Ž .c e is constant for each e f d s ; in Section 6, iii holds becausel

Ž Ž .. . Ž . Ž .c r ¨ is constant for each ¨ . Although ii and iii together implyl

Ž .property i we list all three properties for completeness.w xWe will adapt the Hao]Orlin minimum cut algorithm HO to solve the

parametric augmentation problem. We first review the Hao]Orlin algo-Ž .rithm. Its input is a digraph G s V, E with capacity function c: E ª Rq

and a distinguished vertex s. It returns a value m equal to the smallestŽ Ž ..in-degree c r W of any s-set W. The algorithm works by repeatedly

finding the smallest value of an S, t-cut. Here S is a set of verticesŽincluding s, and t is a vertex not in S. Recall an S, t-cut is a partition of V

into two sets, one containing S and the other containing t; its value is the. � 4in-degree of the set containing t. Initially S equals s . Over the course of

the entire algorithm t takes on the value of every vertex other than s. Ingeneral after the algorithm finds a smallest S, t-cut for some set S andsome vertex t, it adds t to S, chooses the next value of t, and finds thesmallest S, t-cut for the new S and t. To find a smallest S, t-cut the

Žalgorithm computes a maximum preflow f from S to t. Recall that the

Page 17: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW64

value of a maximum preflow from S to t equals the smallest value of an.S, t-cut. The algorithm at a high level is as follows:

� 4HO initialize; r) makes m s `, S s s and]chooses an initial sink t )r

while S / V do beginŽ .HO preflow push; r) makes D, W a minimum S, t-cut )r] ]

� Ž Ž ..4m ¤ min m, c r W ;HO select new sink; r) adds t to S and] ] ]

chooses a new sink t )r end;return m;

The routines HO initialize, HO preflow push, and HO select] ] ] ] ]w xnew sink are described in detail in HO . HO preflow push is a modifica-] ] ]

w xtion of the Goldberg]Tarjan maximum flow algorithm GT . In particularit computes the maximum preflow f from S to t. The sets D and W consistof the vertices that are called ‘‘dormant’’ and ‘‘awake,’’ respectively inw xHO . The source set S is contained in D and the sink t is in W.HO select new sink adds the old sink t to S and chooses a new sink that] ] ]belongs to W.

The idea of our parametric augmentation algorithm is to execute theHao]Orlin algorithm, increasing the parameter l whenever a cut smaller

Ž Ž .. Ž .than the current target is discovered, i.e., whenever c r W - t l . Thealgorithm is as follows. It maintains a current parameter value l and

� 4returns the desired value l s max l : U an s-set . Assume that the HOUroutines always compute edge capacities using the function c for thel

current value of l. Recall that f : E ª R is the current preflow function.q

l ¤ 0; HO initialize;]

while S / V do beginŽ .HO preflow push; r) makes D, W a minimum S, t-cut )r] ]

Ž Ž .. Ž .while c r W - t l do beginl

l ¤ l ; r) increase l )rW

if l s ` then return `; r) since l G l s ` )rW W

Ž . Ž . Ž .for each edge e g d s do f e ¤ c e ; r) increase flow )rl

Ž . Ž . � Ž . Ž .4for each edge e f d s do f e ¤ min f e , c e ;l

r) decrease flow )rHO preflow push;] ]

Ž .r) makes D, W a minimum S, t-cut )rend;HO select new sink; end;] ] ]

return l;

Page 18: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 65

The main step in proving our algorithm is correct is to show that the HOroutines work correctly, even though the ‘‘increase l’’ line changes edgecapacities and the ‘‘increase flow’’ and ‘‘decrease flow’’ lines change theflow function. We begin by noting that the comments in the algorithm arecorrect: The ‘‘increase l’’ line increases l, by the definition of l . TheW

Ž .‘‘increase flow’’ line does not decrease flow, by monotonicity property i .The ‘‘decrease flow’’ line does not increase flow, by definition.

Next we prove that as in the Hao]Orlin algorithm, our algorithmmaintains f as a valid preflow from S to t. We need only show that f is avalid preflow right after the ‘‘increase flow’’ and ‘‘decrease flow’’ lines. It is

Ž . Ž .obvious that these lines change f so the capacity constraints f e F c el

hold for every edge e. So we need only show that each vertex not currentlyŽin the source set S has nonnegative flow excess. Recall the flow excess at

Ž Ž .. Ž Ž .. .a vertex ¨ equals f r ¨ y f d ¨ . For this it is sufficient to show thatwhen l increases to a larger value l9, the excess at any vertex ¨ / s does

Ž . Ž .not decrease. For each edge e f d s let D e be the amount that theŽ . Ž Ž . .‘‘decrease flow’’ line decreases the flow f e . Clearly D e G 0. Then the

excess at ¨ increases by at least

� 4c y c s¨ y D r ¨ y s¨ q D d ¨ .Ž . Ž . Ž . Ž .Ž . Ž .l9 l

Ž Ž . � 4. ŽThe second term in the displayed expression is D r ¨ y s¨ F c yl

.Ž Ž . � 4. Ž .c r ¨ y s¨ , by definition and monotonicity property ii . The thirdl9

Ž Ž .. Ž .term D d ¨ is nonnegative, by monotonicity property ii . Thus the entiredisplayed expression is at least

� 4c y c s¨ y c y c r ¨ y s¨ s c y c r ¨ .Ž . Ž . Ž . Ž . Ž . Ž .Ž . Ž .l9 l l l9 l9 l

Ž .The last quantity is nonnegative by monotonicity property iii . We con-clude that f is a valid preflow.

The rest of the argument is based on the following observation: An edgewhose residual capacity increases as a result of the ‘‘increase l,’’ ‘‘increaseflow,’’ and ‘‘decrease flow’’ lines is directed to s. This observation isobvious.

We now show that the HO routines operate correctly in our algorithm.We have already shown that f is always a preflow, so we need only provethe other invariants of the Hao]Orlin algorithm. These invariants are

w xstated as Properties 1]8 in HO . Simply put, none of these properties isaffected by the changes made in our algorithm, because the properties

Ž .involve either distance labels which our algorithm does not change orŽresidual edges directed to vertices other than s which our algorithm does

.not create, by the above observation . The next two paragraphs brieflydiscuss these properties in greater detail for the interested reader. We

w xassume the reader is familiar with HO .

Page 19: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW66

Recall that the Hao]Orlin algorithm, like other preflow-push algo-rithms, maintains a distance function d: V ª Z. The dormant set D ispartitioned into sets D , 0 F i F max for some nonnegative integer max,iwhere S s D . Hence V is partitioned into sets D , 0 F i F max, and W.0 iThe HO preflow push routine creates a new dormant set D by identify-] ] iing a set of vertices R : W, deleting R from W and making R the next

Ž .dormant set, R s D it also increases max by one . Themaxq1HO select new sink routine transfers the old sink from W to S; if this] ] ]makes W empty it makes the last dormant set D into the new awake setmax

Ž .W it also decreases max by one .We now review the invariants of the Hao]Orlin algorithm and show

they continue to hold in our algorithm. Property 1 states that if no vertexŽ .of W has positive flow excess then D, W is a minimum S, t-cut. This

holds as long as f is a valid preflow from S to t, which we have alreadyŽ . Ž .shown, and Property 4 below holds. Property 2 states that d x F d y q 1

for any residual edge xy with x, y g W or x, y g D for some i ) 0. Thisiproperty is preserved by our algorithm since it only creates residual edges

Ž .directed to s and s g D . Property 3 states that each distance d x0increases whenever the algorithm modifies its value. This property contin-

Ž . Ž .ues to hold because the new value of d x is computed as d x s� Ž . 4min d y q 1: xy a residual edge with y g W , and our algorithm does not

create any residual edges in this set. Property 4 states that no residualedge is directed from D to W or from D to D for any i - j. Again thisi jholds since our algorithm only creates residual edges directed to s g D .0

Ž .Property 7 states that the HO routines perform O nm saturating pushes.This holds because our algorithm only increases the residual capacity of

Ž .edges in r s and there are no pushes on these edges. The proofs of theremaining three properties are entirely unaffected by our changes: Prop-

Ž .erty 5 states that d X is a set of consecutive integers, for X equal to W orŽ .any set D , i ) 0. Property 6 states that any distance value d ¨ is at mosti

n y 1. Property 8 states that less than n dormant sets D are created inithe entire algorithm. To illustrate these arguments that are unaffected we

Ž .sketch the proof of Property 8 this property is used again below : Eachdormant set D is eventually made the set of awake vertices W byiHO select new sink, and the next sink t is chosen from this set. Since a] ] ]vertex is chosen to be the sink only once, at most n y 1 dormant sets Diare created in the entire algorithm. Property 8 follows. We have nowverified that all invariants of the Hao]Orlin algorithm hold for ouralgorithm.

The following theorem completes the analysis of our algorithm. In orderto guarantee our algorithm is efficient we need to make one of two

Ž .assumptions that ensure each arithmetic operation takes O 1 time. TheŽfirst assumption is that the algorithm is executed on a real RAM. By

Page 20: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 67

Ž .definition arithmetic operations on arbitrary real numbers take O 1 time.on a real RAM. The second assumption is that we start with integral data

Žand execute the algorithm on an ordinary RAM. On such a machine allŽ .numbers are integers, and an arithmetic operation takes time O 1 only

.when the integers involved are polynomially related to the input values. ItŽ .is easy to see that when all capacities c e are integral, the flow f in ourl

Ž .algorithm is always integral. Recall the HO routines preserve integrality.Also by definition flow values cannot exceed capacity values. We make oneof these two assumptions to prove the time bound in the theorem below.ŽWe mention this because preserving integrality becomes an issue in

.Sections 5]7.

THEOREM 4.1. The parametric augmentation problem for s-sets can beŽ Ž 2 .. Ž .sol ed in time O nm log n rm and space O m .

Proof. We first show that the value l returned by our algorithm equalsthe desired value l that solves the parametric augmentation problem. Thevalue l is either the initial value 0 or l for some set W. This showsWl F l. Furthermore we claim the algorithm has verified that any s-set Uhas l F l. To see this let t9 be the first vertex of U chosen to be the sink.USuppose the last iteration where t9 is the sink ends with minimum S, t9-cutŽ . Ž Ž .. Ž .D9, W9 and parameter value l9. These values satisfy c r W9 G t l9 .l9

Ž Ž .This inequality holds when the inner while loop terminates. Note D9, W9. Ž .is a minimum S, t9-cut because the HO routines work correctly. V y U, U

Ž Ž .. Ž Ž ..is an S, t9-cut by the choice of t9. Thus c r U G c r W9 . Thisl9 l9

Ž Ž .. Ž .implies c r U G t l9 , i.e., l F l9 F l as desired.l9 UWe now analyze the efficiency of the algorithm. The main observation is

Žthat the parameter l is increased at most 2n times by the ‘‘increase l’’.line . In proof consider a fixed sink t. Each increase of l after the first

Ž .while t is the sink is caused by a new cut D, W . The HO preflow push] ]routine changes D only when it creates a new dormant set D . Property 8igiven above states this occurs less than n times in the entire algorithm.This implies the desired bound of 2n increases of l.

This bound implies all executions of the ‘‘increase l’’ line use a total ofŽ . Ž 2 .O nm time. Furthermore the ‘‘increase flow’’ line does a total of O n

Ž .pushes and the ‘‘decrease flow’’ line changes flow in a total of O nmedges.

We implement the Hao]Orlin algorithm using dynamic trees, exactly asw xin HO . In addition the new lines of our algorithm perform the following

dynamic tree operations to preserve the invariants for the dynamic trees:After the ‘‘decrease flow’’ line a cut operation is done for every dynamictree edge whose residual capacity has decreased to zero. This ensures thatall edges in dynamic trees have positive residual capacity. In addition asend operation is done for every vertex that is not the root of its dynamic

Page 21: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW68

tree and has positive flow excess. This ensures that only vertices that arethe root of their dynamic tree have positive excess.

Ž 2 .It is easy to see that the new lines of our algorithm do O n dynamictree operations. This does not change the asymptotic bound for thenumber of operations in the Hao]Orlin algorithm. Thus as the theoremclaims, our algorithm has the same time bound as the Hao]Orlin algo-rithm.

Ž .4.2. Augmentation with Parametric d s

We turn to our second augmentation algorithm. It is faster than the firstŽ .algorithm when the target value t l is small. However, it only solves the

augmentation problem when capacity changes are restricted to edgesdirected from s. More precisely, we define the augmentation problem with

Ž .parametric d s as the special case of the parametric augmentation prob-lem for s-sets where the following two additional assumptions hold:

First, given a family UU of disjoint sets of vertices U we can compute allŽ . Ž Ž Ž 2 ..values l , U g UU, in total time O m . In fact time O m log n rm isU

sufficient. This strengthens the assumption of the original parametricŽ . .augmentation problem where one value l is computed in time O m .U

Second, we strengthen the monotonicity properties to the following:

Ž . Ž . Ž .i9 c e is nondecreasing for each e g d s ;l

Ž . Ž . Ž .ii9 c e is constant for each e f d s ;l

Ž . Ž .iii9 t l is nondecreasing.

This problem is the special case of augmentation used in Section 5.Since we are concerned with small connectivities we assume that l and

all functions c are integral-valued. Thus each c specifies a multigraph. Inl l

all our resource estimates the parameter m counts the edges of a graph,with each edge counted according to its capacity.

w xWe begin by briefly reviewing the round robin algorithm of Ga95a thatŽ .finds an s-set of minimum in-degree. Fix a digraph G s V, E and a

vertex s. E can contain parallel edges. Recall the notion of a completek-intersection from Section 3. The round robin algorithm takes as input a

Ž .complete k y 1 -intersection T. If G has a complete k-intersection thenround robin returns with T modified to be such an intersection. If G doesnot have a complete k-intersection then round robin returns the givenŽ .k y 1 -intersection T along with a message ‘‘maximal.’’ Thus to find thesmallest in-degree of an s-set we repeatedly run round robin until T is acomplete k-intersection for k maximal. The final value of k equals thesmallest in-degree of an s-set, by the two theorems of Edmonds discussedin Section 3.

Page 22: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 69

We state our augmentation algorithm using the following convention forŽ .edge capacities: The algorithm maintains a variable c e for the capacity of

an edge e. When the algorithm changes the parameter l, it also changesŽ . Ž .each value c e to the new capacity c e .l

Ž . Ž .T ¤ B; l ¤ 0; r) also set capacities c e to c e )r0

run round robin to make T a complete k-intersection, for maximalŽ .k F t l ;Ž .while k - t l do begin� Ž Ž .. 4l ¤ max l : U an s-set and c r U s k ; r) increase l, andU

Ž .capacities c e )rif l s ` then return l;run round robin to enlarge T to a complete k-intersection, for

Ž .maximal k F t l ;end;

return l;

To show this algorithm is correct, first observe that each execution ofŽ Ž Ž ..the ‘‘increase l’’ line actually increases l since any s-set U with c r Ul

Ž . . Ž . Ž .s k - t l has l ) l . Monotonicity properties i9 ] ii9 imply T re-Umains a valid complete k-intersection each time l is increased. Henceeventually l is increased to the desired value l.

Ž Ž ..We turn to computing the time bound. First observe there are O t lŽ .iterations of the while loop. To prove this, monotonicity property iii9

implies it suffices to show each iteration increases k. Suppose an iterationŽ Ž ..begins with the value l so k - t l . Each s-set U having in-degree k

before the ‘‘increase l’’ line has in-degree larger than k after that lineŽ Ž . Ž . . Ž .since t l G t l ) k . Hence a complete k q 1 -intersection exists.U

Next we describe how the ‘‘increase l’’ line calculates the new value ofl. This is simple to do for the special case of parametric augmentationused in Section 5: In that parametric augmentation problem, changing l tol q 1 increases the capacity of s¨ for every vertex ¨ / s. Thus thesmallest in-degree of an s-set increases. This allows us to substitutel ¤ l q 1 for the ‘‘increase l’’ line, since we still get k increasing every

Ž Ž .. Žiteration and as above there are O t l iterations. Whenever an aug-Ž .mentation problem with parametric d s has this property, which is a

Ž .stronger version of monotonicity property i9 , there is no need to make.the first assumption on the time to compute l .U

w xIn general the ‘‘increase l’’ line is implemented as follows: Ga91presents an algorithm that, given T , finds the family UU of all minimal

Ž .s-sets of in-degree k in time O m . In the ‘‘increase l’’ line the sets U can

Page 23: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW70

Ž Ž . Ž ..be restricted to this family UU by monotonicity properties i9 ] ii9 . Thesets of UU are disjoint. Hence, by the first assumption of the augmentation

Ž .problem with parametric d s , all values l , U g UU, can be computed inUŽ .time O m .

The remaining issue for efficiency concerns the time for round robin.Let m denote the number of edges in graph G y s. Round robin enlarges

Ž . ŽŽa complete k y 1 -intersection to a complete k-intersection in time O m. . Ž .q kn log n ; if every edge of G y s has capacity O 1 the time bound

Ž Ž 2 . . Ž .decreases to O m log n rm q kn . The space is O m q kn . In ouraugmentation algorithm the term kn can dominate these estimates. Wewish to avoid this. We do so by modifying the augmentation algorithm to

Ž .decrease n to a value n9 with kn9 s O m .The modification is based on the following transformation. Consider a

digraph G with edge capacity function c and distinguished vertex s.Ž . Ž Ž ..Suppose a vertex ¨ / s has c s¨ ) c d ¨ . The transformation forms a

Ž . Ž .new digraph H by deleting ¨ and increasing c sw by c ¨w for every edgeŽ .¨w g d ¨ .

Consider any s-set U of G. The following two properties of the transfor-mation are clear:

Ž . Ž Ž .. Ž Ž ..a If ¨ g U then c r U G c r U y ¨ .G G

Ž . Ž Ž .. Ž Ž ..b If ¨ f U then c r U s c r U .G H

Although the transformation eliminates a vertex, there is no simple wayto convert a complete k-intersection in G to one in H. This is because theintersection may contain a directed edge u¨ in a tree T , with ¨ the parentiof u. When ¨ is deleted there is no obvious way to convert T y u¨ into ai

Ž Ž . .spanning tree in H c su has not increased . For this reason the modifiedalgorithm will execute the transformation only intermittently.

We now give the modified algorithm. It is the result of two changes tothe original algorithm. First, we modify the first line to initialize l to

� 4l ¤ max l : ¨ g V y s . Second, the algorithm computes complete k-¨Žintersections of a graph H rather than G. H is initialized to G. So H has

.a parameterized capacity function. Whenever round robin increases k toa power of 2 the following clean-up step is executed on the graph H:

Ž . Ž Ž ..while some vertex ¨ / s has c s¨ ) c d ¨ do begin

Ž . Ž . Ž .for each edge ¨w g d ¨ do increase c sw by c ¨w ;

delete ¨ from H;

if H now has exactly 2 vertices then return l; end;

T ¤ B; run round robin to make T a complete k-intersection in H;

Page 24: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 71

To implement this algorithm we maintain, for every vertex w / s, aŽ . Ž .quantity D sw equal to the total increase in c sw in all clean-up steps.

Ž . Ž .The for loop of the clean-up step increases D sw by c ¨w . At any pointŽ . Ž . Ž .in the algorithm c sw , for w a vertex of H, equals c sw q D sw .l

Now we show that our augmentation algorithm with the clean-up stepŽ .still returns the correct value l. Note that property b of the transforma-

tion implies that, at any point in time for the current value of l, any s-setU of H has

c r U s c r U .Ž . Ž .Ž . Ž .H l G

Suppose the current value of l equals l. Since G has a completeŽ .t l -intersection, the displayed equation implies H does too. So eventu-

Ž . Žally either round robin constructs a complete t l -intersection on H after.zero or more clean-up steps or a clean-up step reduces H to two vertices.

In both cases the algorithm returns l s l.Next suppose the current value of l is less than l. We claim it suffices

to show some s-set U of H has l s l. To prove this claim first note thatU� 4such a set U is not a singleton set ¨ . This follows since the initialization

of l implies l F l - l . Now the existence of U implies the algorithm¨ UŽ Ž .eventually increases l since it cannot find a complete t l -intersection

.and it cannot reduce H to two vertices . Thus eventually l is set to l andthe previous case applies.

We now show the existence of U is preserved each time the clean-upstep deletes a vertex ¨. If ¨ f U this is obvious so assume ¨ g U. As

� 4 Ž .noted above U is not the singleton set ¨ , i.e., U y ¨ / B. Property a ofŽ Ž .. Ž Ž ..the transformation shows c r U G c r U y ¨ . By the displayedH H

Ž Ž .. Ž Ž ..equation this is equivalent to c r U G c r U y ¨ . This last in-l G l Gequality holds for the current value of l, and also for all larger values of l

Ž . Ž .by monotonicity properties i9 ] ii9 . This implies l G l . Hence clearlyUy¨ Ul s l.Uy¨

Now we show that, as previously mentioned, during any execution ofŽ .round robin kn9 s O m for n9 the number of vertices in H. It suffices to

show that if H contains a vertex ¨ then at least kr4 edges of H areŽincident to ¨ and are in the original graph G we count each edge

.according to its capacity . In proof consider a vertex ¨ that is not deletedŽ . Ž Ž ..in a clean-up step. Immediately after the clean-up step c s¨ F c d ¨ .

Ž Ž ..Also c r ¨ G k since H has a complete k-intersection. Thus at least oneŽ Ž .. Ž Ž . .of the quantities c d ¨ , c r ¨ y s¨ is at least kr2. Since this quantity

Ž Ž ..does not change with l by property ii9 , it is at least kr4 until the nextclean-up step.

In the following theorem recall that m counts each edge of the graphaccording to its initial capacity.

Page 25: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW72

Ž .THEOREM 4.2. The augmentation problem with parametric d s can beŽ Ž . . Ž .sol¨ed in time O t l m log n and space O m . The time is

2Ž Ž . Ž .. Ž .O t l m log n rm if e¨ery edge of G y s has capacity O 1 .

Ž .Proof. Since kn9 s O m each execution of round robin uses timeŽ .O mlog n . Thus the total time for round robin excluding clean-up steps isŽ Ž . .O t l m log n . The time for a clean-up step for a given value k isŽ .O km log n . Summing over all values of k that are powers of two and at

Ž . Ž Ž . .most t l gives total time O t l m log n . The logarithmic term in theseŽ 2 .estimates decreases to log n rm if every edge of G y s has capacity

Ž . Ž Ž 2 .O 1 . Since log n rm is increasing in both n and m this estimate applies.to H as well as G.

We conclude this section by showing how the output of our parametricŽ .algorithm can be converted to a complete t l -intersection for the given

graph G when c is the capacity function.l

Ž .We begin with the final graph H. Let T be a complete t l -intersectionon H: If H has more than two vertices then T is the intersectioncomputed by our parametric algorithm. Otherwise if H contains vertices s

Ž .and ¨ let T be the intersection formed by t l trees, each consisting ofŽ . Ž . Ž .the edge s¨ . We also begin with each capacity c e equal to c e q D el

Ž . Ž . Ž Ž .. Ž . Ž Ž .for e g d s and c e equivalently, c e for e f d s . Here D el 0denotes the final value of this quantity. These formulas hold even for

.edges that were deleted from H.To construct the desired intersection, add the vertices of G y H back to

H in reverse order of their deletion in clean-up steps. Use the following�procedure to add back a vertex ¨ . For each tree T of T define W s w: Ti i i

Ž . 4contains an edge sw and c ¨w ) 0 .

for each T g T with W / B do begini i

Ž .T ¤ T q s¨ ; decrease c s¨ by 1;i i

for each vertex w g W do begini

Ž .T ¤ T y sw q ¨w; decrease c ¨w by 1; end; endi i

for each T g T with W s B do begini i

Ž .u ¤ a vertex in T with c u¨ ) 0;i

Ž .T ¤ T q u¨ ; decrease c u¨ by 1; end;i i

The first for loop ensures that, after all vertices ¨ are added back, anŽ . Žedge sw is in at most c sw trees of the intersection even though sw mayl

Ž . Ž . .start out in c sw q D sw trees . Hence to prove the procedure correctl

Ž .we need only show that c s¨ ) 0 at the start of each iteration of the firstŽ .for loop, and a vertex u with c u¨ ) 0 exists in the second for loop. For

Page 26: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 73

Ž . Ž Ž ..the first for loop it suffices to show the inequality c s¨ ) c d ¨ alwaysholds. The inequality holds because of three facts: It holds when ¨ isdeleted in the clean-up step. After that the parametric algorithm may

Žincrease the left-hand side but not the right by monotonicity propertiesŽ . Ž ..i9 ] ii9 . Each iteration of the for loop decreases the left-hand side byone and the right-hand side by one or more.

Now consider the second for loop. Let H denote the current graph HŽ Ž .. Ž .with vertex ¨ added back. Clearly vertex u always exists if c r ¨ G t lHŽ Ž .. Ž .when the procedure starts to add ¨ back. The inequality c r ¨ G t ll G

Ž .holds because G has a complete t l -intersection. The left-hand sideŽ Ž .. Žequals c r ¨ when the procedure starts to add ¨ back recall theH

Ž . � Ž . 4 .clean-up step makes D s¨ s Ý c x¨ : x a vertex of G y H . This impliesthe desired inequality.

Ž Ž . .It is easy to implement the procedure so the time is O m q t l n . Themain data structure is, for each vertex w, a list of the trees T that containiedge sw. Using this data structure the sets W are identified and the firsti

Ž Ž .. Ž .for loop is executed in time O d ¨ . The second for loop uses time O 1for each tree it processes.

The covering algorithm of Section 5 requires only a subset of theŽ .complete t l -intersection T constructed by this algorithm. Specifically it

Ž . Ž .requires the family of t l forests T y d s . This family of forests can beŽ .constructed more efficiently, in time and space O m . To achieve this we

make these simple changes to our algorithm that constructs T :When we start the algorithm, if H consists of two vertices s, ¨ then let

the intersection T consist of m trees with edge s¨ . Also assign each edgeŽ . Ž . Ž .e g d s that was deleted from H capacity c e s D e . In the second for

Ž Ž ..loop of the above procedure, stop when c r ¨ has been decreased to 0Ž .so an edge directed to ¨ need not be added to every T . Finally, afteriadding back all vertices, delete all edges incident to s from T.

Ž .To show the time for this algorithm is O m first observe that it startsŽ .out with T containing O m edges. This holds by construction if H had

Ž .two vertices and otherwise by the clean-up step. The new definition of c eŽ . Ž .ensures that our procedure adds O m edges of d s to T. The rest of the

Ž .timing analysis is the same as before. The space is O m because we storethe trees of T as lists of edges.

5. COVERING GRAPHIC POLYMATROIDS

This section presents algorithms to compute the arboricity efficiently,for both large-capacity and small-capacity graphs. Throughout this section

Ž .fix an undirected graph G s V, E with a capacity function c: E ª R .q

Page 27: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW74

Ž . ŽG determines the graphic polymatroid P s P r . The integral frac-. Ž . w xtional P-covering number is called the integral fractional arboricity H .

G denotes the integral or fractional arboricity, as determined by context. Ifc is integral, a collection of forests of G co¨ers the edges of G if it

Ž .contains each edge e precisely c e times. The integral arboricity is thesmallest number of forests that cover the edges of G. The fractionalarboricity has a similar interpretation. Nash-Williams gave a formula for

�u Ž Ž .. Ž < < .v < < 4 w xintegral arboricity, G s max c g W r W y 1 : W : V, W ) 1 NW .Ž .This formula can also be seen by examining the proof of Theorem 3.1.

Ž .Graph G also determines the bicircular polymatroid SP s P s definedin Section 3. The density d of c is the SP-covering number of c. Integraland fractional density have the obvious meaning, and d denotes the variant

� Ž Ž .. < <determined by context. The fractional density equals max c g W r W :< < 4 Ž .W : V, W ) 1 see the proof of Theorem 3.1 .

We use the density as a steppingstone to the arboricity: our algorithmfirst finds d and then finds G. The details are as follows.

The first step computes the density d. Theorem 3.1 and the proof ofLemma 3.1 show that d is the smallest k where a maximum flow on

Ž . Ž .G* c, k has value c E . This value can be found using the algorithm forw x w xdensity in GGT ; alternatively use the algorithm of GGT that finds the

largest breakpoint.The second step finds G. Theorem 3.1 shows that G is the smallest

Ž .k G d where an arbitrarily chosen k-equivalent graph satisfies 3 . For anyk G d, a k-equivalent graph can be derived from a d-equivalent graph byincreasing the capacity of edge t by k y d for every ¨ g V.

We find the desired value k by solving a parametric augmentation prob-lem for t-sets. The graph for parametric augmentation is any d-equivalent

Ž .graph of c . Let r and d refer to this graph, and let c denote its capacityd

function. The parameter l corresponds to k y d. We define the capacityfunction c so it corresponds to capacities in a k-equivalent graph: Forl

Ž . Ž . Ž . Ž .every ¨ g V, c t s c t q l; for all other edges e f d t , c e sl d l

Ž . Ž .c e . The target function is t l s d q l. A t-set T has l s 0 ifd TŽ Ž .. Ž Ž Ž ... Ž < < . Žc r T G d and l s d y c r T r T y 1 otherwise. It is easy tod T d

Ž Ž .. Ž .verify that these values satisfy the defining condition, i.e., c r T G t ll

< <if and only if l G l . Note that all values of l are finite: If T s 1 thenT TŽ Ž .. .c r T s d by the definition of d-equivalent graph. It is clear that thed

� 4value computed by parametric augmentation, l s max l : T a t-set ,T

corresponds to the desired value, i.e., G s d q l. All additional assump-tions for our parametric augmentation algorithm obviously hold: we can

Ž . Ž . Ž . Ž .compute l in time O m , we can compute c e in time O 1 , c e isT l l

Ž .nondecreasing for e g d t , and all other capacities are constant.

Page 28: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 75

This algorithm works well on a real RAM. We summarize the discus-sion, under this assumption, in the following theorem. Then we show howto modify the algorithm so the theorem holds for ordinary RAMs.

THEOREM 5.1. The integral and fractional arboricity of a capacitated graphŽ Ž 2 .. Ž .can be found in time O nm log n rm and space O m .

Proof. The algorithm as described above computes the fractional ar-boricity; for the integral arboricity we just take the ceiling. The parametric

w x Ž Ž 2 ..algorithms of GGT compute the density in time O nm log n rm . Theo-rem 4.1 shows our parametric augmentation algorithm runs in the sametime bound.

Now assume that the given capacity function c is integral and weexecute the algorithm on an ordinary RAM. We first show how to computethe integral arboricity. Change the parametric augmentation problem sothat l equals the ceiling of its previous value. It is easy to see this gives aTcorrect algorithm for integral arboricity, and the time bound of Theorem5.1 holds on a RAM.

Next we show how to compute the fractional arboricity. We use atwo-step procedure. The first step calculates the integral arboricity G of1the given graph with capacity function n2c.

u 2 vNote that G s n prq for integers p and q, q - n, where the desired12 Žfractional arboricity is G s prq. Clearly n prq is in the interval G y1

x Ž x 21, G . We claim G y 1, G contains no other rational number n p9rq91 1 1for p9, q9 integers and q9 - n. This follows because any such value

2 < 2 2 < < 2Ž . < < <n p9rq9 has n prq y n p9rq9 s n pq9 y p9q rqq9 ) pq9 y p9q G 1.Ž xHence to find G it suffices to find this unique value in G y 1, G .1 1

? 2 @Furthermore the desired integers p, q satisfy p s qG rn .1This leads to the second step of our procedure. It finds the desired

integers by examining every positive integer q - n and checking if2 ? 2 @n qG rn rq ) G y 1.1 1

Ž .The time for this second step is O n . Hence we find the fractionalarboricity in the time bound of Theorem 5.1 on an ordinary RAM.

Our algorithm runs faster on graphs with small capacities. We concen-Ž . Žtrate on the case of integral capacities that are O 1 and there are no

'. Ž .parallel edges . For such graphs G s O m . This is easy to check using' 'Ž < < < <Nash-Williams’ formula examine the cases W F m and W ) m

.separately .

Ž .THEOREM 5.2. If all capacities are integral and O 1 then the integralarboricity G, along with G forests co¨ering the edges of G, can be found in

Ž 3r2 Ž 2 .. Ž .time O m log n rm and space O m .

Page 29: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW76

Proof. Recall the first step of our general covering algorithm computes2r3Ž � Ž . 4 .'the density. This can be done in time O min m log n , n log n m

w xGW . For completeness we sketch an algorithm that runs in time2r3'Ž � 4 .O min m , n m log n . It is easy to see that both bounds are within the

time bound of the theorem.As in the general covering algorithm we compute the density as the

Ž . Ž .smallest integer k where a maximum flow on G* c, k has value c E .Find this integer by doing a binary search. Since the density is an integerbetween 1 and n the search makes log n probes. A probe for a given

Ž .integer k finds a maximum flow on G* c, k . This graph is equivalent toŽone where all edges have unit capacity except those incident to t since the

Ž .edges of infinite capacity in G* c, k can be replaced by unit capacity. Ž . Ž .edges . The graph has O m vertices and O m edges. An argument

w xsimilar to the one in T shows a maximum flow can be found in timeŽ 3r2 .O m . Also since the graph is bipartite with the bipartition consisting of

Ž . Ž .sets of O n vertices and O m vertices, respectively, an argument similarw x Ž 2r3 .to T shows a maximum flow can be found in time O n m . The claimed

time bound follows.The second step of the general covering algorithm computes G by

solving a parametric augmentation problem. This problem satisfies theŽ .assumptions for augmentation with parametric d s . Hence Theorem 4.2

Ž Ž 2 ..shows the time to find G is O Gm log n rm . This is within the desired'Ž .time bound since, as noted above, G s O m . Corollary 3.1 shows a

complete G-intersection of G gives G forests covering the edges of G. Asshown after Theorem 4.2 we can find these forests in additional timeŽ .O m .

6. FINDING A GRAPHIC POLYMATROID BASE

Ž .Let G s V, E be an undirected graph with a cost function on theedges. This section implements the prefix algorithm of Section 2 to find aminimum-cost base of a given vector c g RE in the graphic polymatroidq

Ž .P s P kr .Recall that the prefix algorithm begins an iteration with an index value

i, a vector b g P with b s 0 for j ) i, and a set T : E that is tight for bjin P. Let u denote the vector b q c . The three steps of anw iq1 . . m xyTiteration are as follows. The first step sets p to the longest prefix of u that

Ž Ž ..is in SP SP is the bicircular polymatroid P ks . We will find p usingparametric network flow. The second step sets b to the longest prefix of pthat is in P. We will find b using parametric augmentation. The third stepfinds the maximal tight set for b in P. We will find T using the Hao]Orlinalgorithm. Now we describe these three steps in detail.

Page 30: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 77

The first step finds p using the characterization of SP of Theorem 3.1,i.e., we seek the longest prefix of u that has a k-orientation. Recall fromSection 2 that the edges of G are indexed from 1 to m and each edge isidentified with its index. Hence in graph G* the edges directed from s aredenoted si, 1 F i F m. The proof of Lemma 3.1 justifies the followingcharacterization of p: Let l be the smallest index such that a maximum

Ž .flow in G* u , k does not saturate edge sl; let l be m if no such index1 . . l

Ž .exists. Let f be a maximum flow in G* u , k . Then p is the vector of1 . . l

Ž Ž . Ž . Ž .. Ž Ž .flow values f s1 , f s2 , . . . , f sm . By definition f si s u for i - l,iŽ . Ž . .f sl - u if l - m, and f si s 0 for i ) l. Let l denote this desiredl

value l.Ž .We can find l by considering the parametric network G* u , k . Here1 . .l

w xl is an integral parameter ranging over 1 . . m . Starting at l s 0, repeat-edly increase l by one until a maximum flow f in the parametric networkdoes not saturate edge sl, or l s m. This final value of l is the desiredvalue l.

This method can compute up to m maximum flows. In order to use anŽ .efficient parametric flow algorithm we must reduce this to O n maximum

flows. This can be done using two parametric flow computations: Firststarting at l s 0, repeatedly increase l by n to find l s hn, the largestmultiple of n where a maximum flow saturates edges si, 1 F i F l. Thenstarting at l s hn, repeatedly increase l by one until a maximum flowdoes not saturate edge sl, or l s m.

This method gives the desired prefix p. Both steps calculate at most nŽ 2 .maximum flows this holds for the first step since m F n . Below we show

this method can be implemented by a parametric flow computation to runin the desired time bound.

The second step finds b using the characterization of P in Theorem 3.1and parametric augmentation. The parametric augmentation problem will

Ž .involve a real-valued parameter l ranging from 0 to p E . Let p be thel

Ž . Ž .unique prefix of p satisfying p E s p E y l. Theorem 3.1 shows thel

desired vector b is p for l the smallest value for which an arbitrarilyl

Ž .chosen k-equivalent graph of p satisfies 3 . Let l denote this value of l.l

To find l by parametric augmentation we first describe how to construct ak-equivalent graph of p .l

We begin by describing a k-equivalent graph EG of vector p. The finalmaximum flow of the first step gives a k-orientation of p, as described inthe proof of Lemma 3.1. From this orientation we construct EG by addingedge t for each vertex ¨ g V, with capacity set so that the in-degree of ¨in EG equals k.

Now consider any vector p . It is easy to see that a k-equivalent graph ofl

p can be obtained from EG by the following two-step procedure: Forl

Ž . Ž .every edge ¨w g E with p ¨w - p ¨w , decrease the capacity of ¨w orl

Page 31: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW78

Ž . Ž . Ž .w¨ or both in EG so they sum to p ¨w rather than p ¨w . Then forl

each vertex ¨ g V increase the capacity of edge t in EG so the in-degreeof ¨ equals k. Let the capacity function c correspond to the capacities inl

this k-equivalent graph for p .l

We now show how to find the desired value l by solving a parametricaugmentation problem for t-sets. In this problem as already stated l

Ž .ranges from 0 to p E . The parametric problem is defined on graph EG.The capacity function c is as described above.l

Ž .The target function is constant, t l s k. A value l is computed byTstarting with EG and l s 0, and then increasing l and computing the

Ž .k-equivalent graph of p as described above until the in-degree of Tl

Žbecomes k. Note that when we decrease the capacity of edge ¨w in the.equivalent graph, the in-degree of T increases if ¨ and w are both in T.

Ž Ž .. Ž .This corresponds to the defining condition, c r T G t l if and only ifl

Ž .l G l . The value l is easily computed in time O m .T TThe above description of the k-equivalent graph of p implies thel

Ž .monotonicity properties for parametric augmentation: c e is nondecreas-l

Ž . Ž . Ž Ž ..ing for each e g d t , nonincreasing for e f d t , and c r ¨ does notl

change for any vertex ¨ . The remaining assumption of the parametricaugmentation problem is clear: once the k-equivalent graph of p hasl

Ž . Ž .been computed we can compute c e in O 1 time.l

The value computed by the parametric augmentation problem equalsthe value l described above that gives the desired prefix b. We concludethat the vector b of the second step can be found by solving a parametricaugmentation problem.

The third step of an iteration of the prefix algorithm updates T.Corollary 3.2 shows that T corresponds to the family of maximal t-sets ofin-degree k in the k-equivalent graph for p . This family of sets is easilyl

found by executing the Hao]Orlin algorithm on the equivalent graph withŽdistinguished vertex t. After computing a maximum preflow f from S to

t9 with value k, we find the maximal set of in-degree k that contains t9 butno vertex of S as the complement of the minimal St9-set of out-degree k.The minimal St9 set of out-degree k is the smallest set of out-degree zeroin the residual graph of f that contains S and all vertices with positive flow

Ž .excess. So this set can be found in time O m , and all sets composing TŽ . .can be found in time O nm .

Ž .THEOREM 6.1. A minimum-cost base of a graphic polymatroid P kr canŽ 2 Ž 2 .. Ž .be found in time O n m log n rm and space O m .

Proof. We need only analyze the time. Section 2 shows that the prefixŽ .algorithm performs at most r E q 1 s n complete iterations. Thus it

suffices to show that each of the three steps of an iteration uses timeŽ Ž 2 ..O nm log n rm . The first step uses the parametric network flow algo-

Page 32: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 79

w x Ž .rithm of AOST . As noted above, O n maximum flows are computed inŽ Ž 2 ..the first step. Hence the time is O nm log n rm . The second step solves

a parametric augmentation problem and hence has the same time boundŽby Theorem 4.1. Note that integrality presents no difficulty: if k is

Ž .fractional, k s prq, we can work in the integral polymatroid P pr with.capacity vector qc. The third step uses the Hao]Orlin algorithm and has

the same time bound.

w xCunningham C85a proposes the reinforcement problem: Given is agraph with capacity vectors c, u g RE and cost vector a g RE. The prob-qlem is to increase c to c q z, where 0 F z F u, so the resulting graph haspacking number at least k, and the cost az is as small as possible.Cunningham shows the reinforcement problem reduces to two executionsof the greedy algorithm.

We refer to this problem as the optimal augmentation problem forpacking. We can also define an optimal augmentation problem for co¨ering:A graph with the same three vectors is given. The problem is to increase cto c q z, where 0 F z F u, so the resulting graph has covering number atmost k, and az is as large as possible. This problem also reduces to twoexecutions of the greedy algorithm.

THEOREM 6.2. The optimal augmentation problems for packing and co¨er-2 2Ž Ž .. Ž .ing can be sol ed in time O n m log n rm and space O m .

7. PACKING GRAPHIC POLYMATROIDS

This section applies the prefix algorithm to get an efficient algorithm tocompute the packing number of a graphic polymatroid.

Ž . EFix an undirected graph G s V, E , a vector c g R , and the graphicqŽ .polymatroid P s P r determined by G. The integral P-packing number is

Žthe greatest number of spanning forests of G spanning trees if G is. Ž .connected containing each edge e at most c e times. The fractional

P-packing number equals the strength of G. To see this, recall that the� Ž . Ž Ž . Ž .. Ž . Ž .4strength of G is defined as min c F r r E y r F : F : E, r E ) r F

w x Ž Ž . Ž .C85a . The motivation is that the graph G y F has r E y r F moreŽ . Ž .connected components than G. Thus deleting F creates r E y r F new

components, and the strength is the smallest effort per new component.when we destroy a set of edges. The expression for strength is Edmonds’

w x Žformula for the packing number E65 alternatively see the proof of.Theorem 2.1 . We refer to the integral P-packing number as the integral

strength.Ž .We compute the fractional strength using Newton’s method for pack-

ing in polymatroids, with the implementation of the prefix algorithm given

Page 33: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW80

in Section 6. We initialize k to any upper bound on the strength, e.g.,Ž . Ž .c E r n y 1 . It is an easy exercise to show that when capacities are

integral, this algorithm computes the fractional packing number workingentirely with rational numbers having denominator at most n2. Alternatelythe modification of the algorithm presented below makes all denominatorsat most n. In either case working on an ordinary RAM presents noproblem.

THEOREM 7.1. The integral and fractional strength of a capacitated graphŽ 2 Ž 2 .. Ž .can be found in time O n m log n rm and space O m .

Ž Ž ..Proof. Corollary 2.2 shows Newton’s method amounts to O r E sŽ .O n iterations of the prefix algorithm. Theorem 6.1 shows each iteration

2Ž Ž ..uses time O nm log n rm .

We now give a modification of our packing algorithm that reduces thesize of numbers that are computed, and may also speed up the algorithmin practice. Recall that each time the prefix algorithm is executed the

Ž Ž . .initialization specifically the assignment b ¤ krk b makes T tighty 1 . . tŽ .for b in P s P kr . The prefix algorithm then finds a vector b9 such that,

for this initial value of b, b q b9 is a P-base of c.� Ž . 4Let T s D g U : U g UU , where UU is a family of disjoint sets of

Ž Ž .. Ž < < . < < Žvertices U having b g U s k U y 1 and U ) 1 this description of T.follows from Corollary 3.2 and its proof . Form the graph G9 by starting

Ž .with G and contracting each set U g UU. Let P9 s P kr9 for r 9 thegraphic polymatroid function of G9. It is an easy exercise to check that, forany nonnegative vector b9, b q b9 g P if and only if b9 g P9. Our modi-fied algorithm finds the desired vector b9 by running the prefix algorithmon P9.

The modified algorithm is initialized like the original prefix algorithmŽ .e.g., b is initialized to 0 . The asymptotic time bound of Theorem 7.1holds for the modified algorithm. The only numbers involved in themodified algorithm derive from the current value of k, a fraction withdenominator less than n. So all fractions in the current iteration have thesame denominator. Thus in the modified algorithm all fractions havedenominator less than n.

We close by summarizing how our algorithms can be used to find amaximum packing of spanning trees in a capacitated undirected graph

Ž . ŽG s V, E . First find the integral strength s using the algorithm of this. Ž . Žsection . Then find a base b of the graphic polymatroid P s r using the

. Ž . Ž .algorithm of Section 6 . It is known that b E s s r E , and a cover of bby s forests is a maximum packing of spanning trees in G. Corollary 3.1shows the desired cover can be constructed from a maximum packing ofarborescences in a s-equivalent graph of b.

Page 34: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 81

We have shown the time for all these steps except finding the packing ofŽ 2 Ž 2 .. w xarborescences is O n m log n rm . GM gives efficient algorithms for

packing arborescences.If G has a cost function on the edges our approach can be used to find a

maximum packing of spanning trees in G with the smallest possible cost:Choose b to be a minimum cost base, again using the algorithm of Sec-tion 6. The time bound does not change.

APPENDIX A: SPECIALIZED COVERINGS

This appendix uses the approach of Section 3 to show the existence ofcoverings by forests in a capacitated graph that have special properties.

We begin with a generalization of Lemma 3.1. Consider an undirectedŽ .graph G s V, E with functions c : E ª R and ll , u : V ª R suchE q V qV

Ž . Ž . Žthat ll ¨ F u ¨ for every vertex ¨ g V. Let ll : D ª R , where as inV qV D.Section 3 D is the set of directed edges corresponding to E.

LEMMA A.1. c has an orientation d where e¨ery ¨ertex ¨ g V hasEŽ . Ž Ž .. Ž . Ž .ll ¨ F d r ¨ F u ¨ and e¨ery directed edge ¨w g D has d ¨w GD VVŽ .ll ¨w if and only if the following conditions hold:D

u W G c g W q ll r W ,Ž . Ž . Ž .Ž . Ž .V E DD

for every subset of vertices W:V ; 4Ž .

c E G c g W q ll r W q ll W ,Ž . Ž . Ž . Ž .Ž . Ž .E E DD V

for every subset of vertices W:V ; 5Ž .c ¨w G ll ¨w q ll w¨ , for every edge ¨w g E. 6Ž . Ž . Ž . Ž .E D D

� 4Proof. Form a digraph H with vertex set s, t j V j E and edge set� 4 � 4 � 4 � 4se: e g E j e¨ , ew: e s ¨w g E j ¨t: ¨ g V j ts . Define a capac-ity function c and a lower bound function ll on the edges of H by the

Ž . Ž . Ž . Ž . Ž . Ž .identities c se s c e , ll se s 0, c ew s `, and ll ew s ll ¨w forE DŽ . Ž . Ž . Ž . Ž . Ž . Ž .e s ¨w g E, c ¨t s u ¨ , ll ¨t s ll ¨ , c ts s `, ll ts s c E . It isV EV

easy to see that c has an orientation satisfying the desired conditions ifEand only if H has a circulation obeying the capacity and lower boundconstraints. The latter holds if and only if every subset X of vertices of H

Ž Ž .. Ž Ž ..has c d X G ll r X . Now it is easy to check that this condition givesŽ . Ž . Ž .inequalities 4 when X is an st-set and inequalities 5 and 6 when X is

Ž Ž .an st-set. To get 6 take X as the set of all vertices except vertex e, for.e s ¨w . The other choices of X give redundant inequalities.

Page 35: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW82

Our first result on coverings concerns graphs that can be partitionedinto a number of spanning trees.

Ž .COROLLARY A.1. Consider an undirected graph G s V, E with capacityŽ . Ž .function c : E ª R such that c E s k n y 1 . Choose a ¨ertex r g VE q E

Ž . Ž .and a function ll : D ª R with ll r¨ s c r¨ for e¨ery edge r¨ g E.q ED DThen G with capacity function c can be partitioned into k spanning trees suchE

Ž . Žthat rooting each tree at r makes ¨ the parent of w in at least ll ¨w trees forD. Ž .e¨ery ¨w g D if and only if G satisfies 6 and

< <k W G c g W q max k , ll r W ,Ž . Ž .� 4Ž . Ž .E DD

for every nonempty set of vertices W:V y r . 7Ž .

Ž . Ž .Remark. The condition ll r¨ s c r¨ does not restrict the generalityEDof the result since the root r is never a child.

Ž . Ž .Proof of Corollary A.1. The necessity of 6 ] 7 is clear. Now we provesufficiency, i.e., the partition into spanning trees described in the corollary

Ž . Ž .exists if 6 ] 7 hold.Ž .Inequalities 7 imply that G has a covering by k forests. To prove this

we must show every nonempty set of vertices X satisfies

< <k X G c g X q k .Ž .Ž .E

Ž . ŽIf r f X this is obvious. If r g X then apply 7 to the set X y r. We can. Ž . < <assume this set is nonempty. The left-hand side of 7 equals k X y k.

Ž .On the right-hand side note that r X y r contains every directed edgeDŽ .r¨ where ¨ g X and r¨ g E; furthermore every such edge has ll r¨ sD

Ž . Ž . Ž Ž ..c r¨ . This implies the right-hand side of 7 is at least c g X . TheE Edesired inequality follows.

Now Corollary 3.1 shows we need only prove that c has an orientationEd where each vertex ¨ / r has in-degree k, r has in-degree 0, and each

Ž . Ž .directed edge ¨w g D has d ¨w G ll ¨w . The orientation exists ifDŽ . Ž . Ž . Ž . Ž . Ž .4 ] 6 hold when ll ¨ s u ¨ s k for ¨ / r and ll r s u r s 0.V VV V

Ž . Ž .We will complete the proof by showing that both 4 and 5 are implied byŽ .the following specialization of 7 : every nonempty set of vertices W : V y r

satisfies

< <k W G c g W q ll r W .Ž . Ž .Ž . Ž .E DD

Ž .First consider 4 for any set X : V. If r f X then the displayed inequalityŽ .for X is identical to 4 . If r g X then the displayed inequality applied to

Ž . Ž . < <X y r gives 4 : The left-hand side of 4 equals k X y r and the right-handŽ Ž .. Ž Ž .. Ž Ž .. Ž Ž ..side equals c g X q ll r X s c g X y r q ll r X y r .E D E DD D

Ž . Ž .Next consider 5 for any set X : V. The left-hand side of 5 equals

Page 36: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 83

Ž . Ž . Ž . Žk n y 1 . If r f X then, on the right-hand side of 5 , ll W s k n yV< <. Ž .1 y X . Hence 5 follows from the displayed inequality. If r g X then on

Ž . Ž . Ž < <. Ž < <.the right-hand side of 5 , ll W s k n y X s k n y 1 y X y r .VŽ .Hence 5 follows from the displayed inequality applied to X y r.

To motivate the rest of this section we first review a result proved inw xGM : A digraph with arbitrary edge capacity function has a maximum

Ž . Žfractional integral packing of arborescences that has at most m m q n. Ž 3y 2 distinct arborescences. These packings can be found in time O n mŽ 2 .. Ž Ž � 4 2 Ž 2 ..log n rm O min n, log N n m log n rm , for N equal to the largest

Ž . .integral capacity of an edge . Corollary 3.1 indicates how an arborescencepacking on an equivalent graph can be used to find a minimum cover of anundirected graph G by forests. Suppose G is an undirected graph with nvertices, m edges, and an arbitrary edge capacity function. Any equivalentgraph contains n q 1 vertices and at most 2m q n edges. Thus G has a

Ž .minimum covering by forests using at most 2m q n 2m q 2n y 1 dis-Ž .tinct forests for fractional integral covering. We now reduce these bounds

by showing there are equivalent graphs with fewer edges.We start with a fact about orientations. In an orientation d of undi-

Ž .rected graph G s V, E call the undirected edge ¨w g E two-way if it isŽ . Ž .oriented in both directions, i.e., both d ¨w and d w¨ are positive.

LEMMA A.2. Any orientation can be con¨erted to another orientationha¨ing the same in-degrees and no cycle of two-way edges.

Proof. Let d be a given orientation. Consider an undirected cycle C inG that consists of two-way edges. Let C be the directed cycle obtained by1traversing C in one direction. Hence the edges of C belong to D. Let1

� Ž . 4d s min d ¨w : ¨w g C . Now for all directed edges ¨w g C , decrease1 1Ž . Ž .d ¨w by d and increase d w¨ by d . It is easy to see that this operation

gives a new orientation of G, preserving the in-degree of each vertex anddecreasing the number of two-way edges by at least one. Hence repeatingthis procedure as many times as possible results in an orientation wherethe two-way edges of G are acyclic.

It is easy to implement this proof as an algorithm running in timeŽ .O nm : maintain a spanning forest in the graph of two-way edges, and use

fundamental cycles for the above undirected cycles C. This algorithm runsŽ .in time O m log n if we implement the spanning forest as a collection of

w xdynamic trees ST . To summarize, we can convert any orientation into anorientation with the same in-degrees and no cycle of two-way edges in timeŽ .O m log n .

Page 37: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW84

Ž .COROLLARY A.2. Let G s V, E be an undirected graph with capacityfunction c : E ª R .E q

Ž .a If G has a k-equi alent graph, it has one containing n q 1 ¨erticesand at most m q 2n y 1 edges.

Ž .b If G is the integral or fractional arboricity, G has a G-equi alentgraph containing at most m q 2n y 2 edges.

Ž .c If G can be partitioned into k spanning trees then G has ak-equi alent graph containing at most m q n y 1 edges total, with exactly oneedge incident to t.

Ž .Proof. For part a use Lemma A.2 to modify the k-equivalent graph sothere is no cycle of two-way edges. This implies there are at most n y 1

Ž .two-way edges. Part a follows.Ž .For part b let D denote the maximum degree of a vertex. Observe that

< < Ž Ž .. Ž < <G F D. In proof, any set of vertices W with W ) 1 has c g W r W yE. < < Ž < < .1 F W Dr2 W y 1 F D. This proves the desired relation for both

integral and fractional arboricity.Let x be a vertex of degree D. G has a G-orientation where x has

in-degree G. To show this, apply Lemma A.1 with ll s 0, u s G, andVDŽ . Ž .ll ¨ equal to 0 for ¨ / x and equal to G for ¨ s x. Inequality 4 isV

Ž . Ž . Ž Ž .. Ž .obvious. Inequality 5 becomes c E G c g W q ll W . When x fE E VŽ . Ž Ž ..W this becomes c E G c g W q G. This holds because the degree ofE E

x is at least G.Now use Lemma A.2 to get a G-orientation where x has in-degree G

and there is no cycle of two-way edges. The corresponding G-equivalentŽ .graph does not contain edge tx. The bound of part b follows.

Ž .For part c fix an arbitrary vertex r g V. Any set of vertices W : V hasŽ Ž .. Ž < < . Ž .c g W F k W y 1 . Hence Lemma 3.1 or A.1 shows G has a k-E

Ž . Ž .orientation where vertex r has in-degree 0. Since c E s k n y 1 thisEimplies every other vertex has in-degree k. Apply Lemma A.2 to removecycles of two-way edges. Note that no two-way edge is incident to r. Hence

Ž .the corresponding k-equivalent graph has at most m q n y 2 q 1 sm q n y 1 edges. Furthermore tr is the only edge incident to t.

Now let G be an arbitrary undirected graph with capacity function. PartŽ . w xb of the corollary along with the result of GM shows that G has a

Ž .covering by forests containing at most m q 2n y 2 m q 3n y 3 distinctŽ . Ž .forests for fractional integral covering. Part c shows that G has a

Žmaximum spanning tree packing containing at most m q n y 2 m q. Ž . Ž2n y 4 distinct trees for fractional integral packing. To show this, note

Ž .that in the k-equivalent graph EG of part c the edge tr belongs to everyarborescence of any packing. Hence any packing of k arborescences in thedigraph EG y t gives a packing of spanning trees in G. Now apply the

Page 38: Algorithms for Graphic Polymatroids and Parametrics-Sets

GRAPHIC POLYMATROIDS & PARAMETRIC s-SETS 85

w xresult of GM to digraph EG y t, a graph of n vertices and at most.m q n y 2 edges. Such coverings and packings are found by the algo-

w xrithms of GM in the same time bounds as given above.

ACKNOWLEDGMENT

w xThanks to Bill Cunningham for pointing out the results of CC .

REFERENCES

w xAOST R. K. Ahuja, J. B. Orlin, C. Stein, and R. E. Tarjan, Improved algorithms forŽ . Ž .bipartite network flow, SIAM J. Comput. 23 5 1994 , 906]933.

w xB F. Barahona, Separating from the dominant of the spanning tree polytope, Oper.Ž .Res. Lett. 12 1992 , 201]203.

w xBT S. Baum and L. E. Trotter, Jr., Integer rounding for polymatroid and branchingŽ . Ž .optimization problems, SIAM J. Alg. Disc. Meth. 2 4 1981 , 416]425.

w xC85a W. H. Cunningham, Optimal attack and reinforcement of a network, J. Assoc.Ž . Ž .Comput. Mach. 32 3 1985 , 549]561.

w xC85b W. H. Cunningham, Minimum cuts, modular functions and matroid polyhedra,Ž .Networks 15 1985 , 205]215.

w xCC E. Cheng and W. H. Cunningham, A faster algorithm for computing the strength ofŽ .a network, Inform. Process. Lett. 49 1994 , 209]212.

w x Ž .D W. Dinkelbach, On nonlinear fractional programming, Management Sci. 13 1967 ,492]498.

w xE65 J. Edmonds, Lehman’s switching game and a theorem of Tutte and Nash-Williams,Ž .J. Res. National Bureau of Standards 69B 1965 , 73]77.

w xE69 J. Edmonds, Submodular functions, matroids, and certain polyhedra, in CalgaryInternational Conf. on Combinatorial Structures and their Applications,’’ pp. 69]87,Gordon and Breach, New York, 1969.

w x ŽE72 J. Edmonds, Edge-disjoint branchings, in ‘‘Combinatorial Algorithms’’ R. Rustin,.Ed. , pp. 91]96, Algorithmics Press, New York, 1972.

w x Ž .F79a A. Frank, Kernel systems of directed graphs, Acta Sci. Math. 41 1979 , 63]76.w x Ž .F79b A. Frank, Covering branchings, Acta Sci. Math. 41 1979 , 77]81.w xFG A. Frank and A. Gyarfas, How to orient the edges of a graph?, in ‘‘Combinatorics,´ ´

Ž .I’’ A. Hajnal and V. T. Sos, Eds. , Colloq. Math. Soc. Janos Bolyai, Vol. 18, pp.´ ´353]364, North-Holland, Amsterdam, 1978.

w xGa91 H. N. Gabow, Applications of a poset representation to edge connectivity and graphrigidity, in ‘‘Proc. 32nd Annual Symp. on Found. of Comp. Sci., 1991,’’ pp. 812]821.Also Technical Report CU-CS-545-91, Dept. of Computer Science, University of

.Colorado at Boulder, 1991.w xGa94 H. N. Gabow, Efficient splitting off algorithms for graphs, in ‘‘Proc. 26th Annual

ACM Symp. on Theory of Comp., 1994,’’ pp. 696]705.w xGa95a H. N. Gabow, A matroid approach to finding edge connectivity and packing

Ž . Ž .arborescences, J. Comput. System Sci. 50 2 1995 , 259]273.w xGa95b H. N. Gabow, Algorithms for graphic polymatroids and parametric s-sets, in ‘‘Proc.

6th Annual ACM-SIAM Symp. on Disc. Algorithms, 1995,’’ pp. 88]97.

Page 39: Algorithms for Graphic Polymatroids and Parametrics-Sets

HAROLD N. GABOW86

w xGi F. R. Giles, ‘‘Submodular Functions, Graphs and Integer Polyhedra,’’ Ph.D. disser-tation, Dept. of Combinatorics and Optimization, University of Waterloo, Ontario,1975.

w xGu83 D. Gusfield, Connectivity and edge-disjoint spanning trees, Inform. Process. Lett.Ž . Ž .16 2 1983 , 87]89.

w x Ž . Ž .Gu91 D. Gusfield, Computing the strength of a graph, SIAM J. Comput. 20 4 1991 ,639]654.

w xGGT G. Gallo, M. D. Grigoriadis, and R. E. Tarjan, A fast parametric maximum flowŽ . Ž .algorithm and applications, SIAM J. Comput. 18 1 1989 , 30]55.

w x ŽGM H. N. Gabow and K. S. Manu, Packing algorithms for arborescences and spanning.trees in capacitated graphs, in ‘‘Proc. Fourth MPS Conf. on Integer Programming

Žand Combinatorial Optimization, 1995,’’ pp. 388]402. Also Math. Programming B,.to appear.

w xGT A. V. Goldberg and R. E. Tarjan, A new approach to the maximum-flow problem,Ž . Ž .J. Assoc. Comput. Mach. 35 4 1988 , 921]940.

w xGW H. N. Gabow and H. H. Westermann, Forests, frames and games: Algorithms forŽ .matroid sums and applications, Algorithmica 7 1992 , 465]497.

w xH F. Harary, ‘‘Graph Theory,’’ Addison-Wesley, Reading, MA, 1969.w xHO J. Hao and J. B. Orlin, A faster algorithm for finding the minimum cut in a directed

Ž . Ž .graph, J. Algorithms 17 3 1994 , 424]446.w xKRT V. King, S. Rao, and R. Tarjan, A faster deterministic maximum flow algorithm,

Ž . Ž .J. Algorithms 17 3 1994 , 447]474.w x Ž . Ž .M L. R. Matthews, Bicircular matroids, Quart. J. Math. Oxford 28 2 1977 , 213]228.w xNW C. St. J. A. Nash-Williams, Decomposition of finite graphs into forests, J. London

Ž .Math. Soc. 39 1964 , 12.w xPQ82a J.-C. Picard and M. Queyranne, A network flow solution to some nonlinear 0]1

Ž .programming problems, with applications to graph theory, Networks 12 1982 ,141]159.

w xPQ82b J.-C. Picard and M. Queyranne, Selected applicatons of minimum cuts in networks,Ž .INFOR 20 1982 , 394]422.

w x Ž .PaW83 M. W. Padberg and L. A. Wolsey, Trees and cuts, Ann. Discrete Math. 17 1983 ,511]517.

w xPaW84 M. W. Padberg and L. A. Wolsey, Fractional covers for forests and matchings,Ž .Math. Programming 29 1984 , 1]14.

w xPhW S. Phillips and J. Westbrook, Online load balancing and network flow, in ‘‘Proc.25th Annual ACM Symp. on Theory of Comp., 1993,’’ pp. 402]411.

w xS S. Schaible, Fractional programming II. On Dinkelbach’s algorithm, ManagementŽ .Sci. 22 1976 , 868]873.

w xST D. D. Sleator and R. E. Tarjan, A data structure for dynamic trees, J. Comput.Ž .System Sci. 26 1983 , 362]391.

w xT R. E. Tarjan, ‘‘Data Structures and Network Algorithms,’’ SIAM, Philadelphia, PA,1983.

w xW D. J. A. Welsh, ‘‘Matroid Theory,’’ Academic Press, New York, 1976.