View metadata, citation and similar papers at core.ac.uk brought to you by CORE

provided by Digital Repository @ Iowa State University

Computer Science Technical Reports Computer Science

1995 Linear-Time for Parametric Minimum Spanning Problems on Planar Graphs David Fernández-Baca Iowa State University, [email protected]

Giora Slutzki Iowa State University, [email protected]

Follow this and additional works at: http://lib.dr.iastate.edu/cs_techreports Part of the Theory and Algorithms Commons

Recommended Citation Fernández-Baca, David and Slutzki, Giora, "Linear-Time Algorithms for Parametric Minimum Problems on Planar Graphs" (1995). Computer Science Technical Reports. 90. http://lib.dr.iastate.edu/cs_techreports/90

This Article is brought to you for free and open access by the Computer Science at Iowa State University Digital Repository. It has been accepted for inclusion in Computer Science Technical Reports by an authorized administrator of Iowa State University Digital Repository. For more information, please contact [email protected]. Linear-Time Algorithms for Parametric Problems on Planar Graphs

Abstract A linear-time for the minimum-ratio spanning tree problem on planar graphs is presented. The algorithm is based on a new planar minimum spanning tree algorithm. The ppra oach extends to other parametric minimum spanning tree problems on planar graphs and to other families of graphs having small separators.

Disciplines Theory and Algorithms

This article is available at Iowa State University Digital Repository: http://lib.dr.iastate.edu/cs_techreports/90

Linear-Time Algorithms for Parametric

Minimum Spanning Tree Problems on



Planar Graphs

y

David Fernandez-Baca and Giora Slutzki

Department of Computer Science, Iowa State University, Ames, IA 50011

Abstract

A linear-time algorithm for the minimum-ratio spanning tree prob-

lem on planar graphs is presented. The algorithm is based on a new

planar minimum spanning tree algorithm. The approach extends to

other parametric minimum spanning tree problems on planar graphs

and to other families of graphs having small separators.

1 Intro duction

Supp ose we are given an undirected graph G where each edge e has two

weights a and b ; the b 's are assumed to b e either all negative or all p osi-

e e e

tive. The minimum ratio spanning treeproblem MRST [Cha77 ] is to nd

P P

a spanning tree T of G such that the ratio a = b is minimized.

e e

e2T e2T

One application of MRST arises in the design of communication networks.

The number a represents the cost of building link e, while b represents the

e e

time required to build that link. The goal is to nd a tree that minimizes the

ratio of total cost over construction time. Other applications of MRST are

given elsewhere [CMV89, Meg83 ]. The main result of this pap er is a linear-

time algorithm for solving parametric minimum spanning tree problems on



A preliminary version of this pap er will app ear in the Pro ceedings of the 2nd Latin

American Theoretical Informatics Conference,Vi~na del Mar, Chile, 1995.

y

Supp orted in part by the National Science Foundation under grant No. CCR-211262. 1

planar graphs and other families of graphs with small separators. The ap-

proach leads to linear-time planar MRST algorithm, as well as to linear-time

algorithms for sensitivity analysis and for Lagrangian relaxation problems

asso ciated with minimum spanning trees. Toachieve our results wehave

develop ed a new linear-time planar minimum spanning tree algorithm based

on graph decomp osition and graph reduction.

The b est known MRST algorithm for arbitrary graphs, due to Cole [Cole87],

is an application of Megiddo's metho d of [Meg79, Meg83 ].

Like other algorithms for the problem including ours, Cole's relies on the

equivalence b etween MRST and the following parametric search problem

[Cha77 ]. Asso ciate with each edge e 2 G a linear weight function w =

e

a b and let Z   denote the weight of the minimum spanning tree rela-

e e



tive to the weights w . The problem is to nd the ro ot  of Z  . Cole's

e

metho d determines a minimum ratio spanning tree in O T n; m log n

MST

time, where T n; m denotes the time to compute a minimum spanning

MST

tree of an n-vertex, m-edge graph. The b est deterministic minimum span-

ning tree algorithm achieves T n; m=O m log m; n [GGST86 ], re-

MST

sulting in a O m log m; n log n for the general minimum ratio spanning

tree problem. Faster MRST algorithms can b e obtained either by using

Karger, Klein, and Tarjan's O m randomized minimum spanning tree al-

gorithm [KKT94], or Fredman and Willard's deterministic O m-time mini-

mum spanning tree algorithm, which op erates under a less restrictive mo del

of computation [FrWi90]. For planar graphs, a minimum spanning tree can

b e constructed in O n time [ChTa76 ] see also Section 3, leading to a

O n log n MRST algorithm.

Parametric search has b een the sub ject of a considerable amount of re-

search in recent times b ecause of its numerous applications to optimization

and [CoMe93, Tol93a , CEGS92 , MaSc93 ]. In the

context of optimization problems such as MRST, the application of Megiddo's

technique tends to follow a common pattern. Supp ose wehave an algorithm

A that allows us to determine the value of a certain function f for any

 within a certain range for MRST, algorithm A would b e any minimum



spanning tree algorithm, and that we wish to lo cate a critical value  for



f .To nd  ,we simulate the execution of A to determine its computation



path at  . In the simulation, the op erations of A are executed symb olically,

manipulating functions of  instead of numb ers; this is referred to as lifting

the computation of A.To determine the outcome of comparisons without ex- 2



plicit knowledge of  , the simulation invokes an oracle, which is often closely

related to A itself. Since oracle calls are exp ensive, they must b e used spar-

ingly. Megiddo showed that if these op erations can b e batched i.e., group ed

and ordered in sucha way as to p ermit many of them to b e resolved bya

single oracle call, the total amountofwork to solve the parametric problem

can often b e made at most a p olylogarithmic factor slower than that of al-

gorithm A. The p olylogarithmic slowdown in going from non-parametric to

parametric algorithms remains even when using Cole's technique [Cole87].

The slowdown is largely a consequence of treating the oracle as a blackbox.

Frederickson [Fre90] observed that, as the search progresses, it is sometimes

p ossible to compile information that can sp eed up subsequent oracle calls

and used this idea to devise linear-time algorithms for a variety of lo cation

problems on trees. Subsequently it was shown that a large class of paramet-

ric optimization problems can b e solved in linear time for graphs of b ounded

tree-width [FeSl94].

Our MRST algorithm is in uenced byFrederickson's work. It is a depar-

ture from Megiddo's algorithm for general graphs in that it do es not use sort-

ing at a global level, and hence do es not need to dep end on the AKS sorting

network [AKS83], whose large constants of prop ortionality make it imprac-

tical. Our algorithm simulates a new non-parametric minimum spanning

tree algorithm that takes advantage of planarity to view the input graph at

di erent levels of re nement a technique similar to that used byFrederickson

for computing shortest paths [Fre85b]. The structure of the non-parametric

algorithm allows us to construct a sequence of successively faster oracles as

the simulation unfolds. In the pro cess, we will identify and contract an in-

creasingly larger set of essential edges; i.e., edges that must b e included in



any minimum spanning tree at  .At the conclusion, the input graph will b e



contracted to a single vertex and  will b e found by exhaustiveenumeration.

Organization of the pap er. Section 2 de nes the notion of a multilevel

division of a and describ es how to compute one in linear time.

Multilevel divisions, together with graph reduction, are used in the linear-

time planar minimum spanning tree algorithm presented in Section 3. This

algorithm will b e the basis for the parametric searchscheme discussed in

Section 4. The same idea can b e used for other parametric spanning tree

problems, as discussed in Section 5. 3

2 Multilevel divisions of planar graphs

Our non-parametric planar minimum spanning tree algorithm relies on an

idea byFrederickson [Fre85b], who describ ed an algorithm that uses Lipton

and Tarjan's planar separator theorem [LiTa79] to build a division of a planar

graph G into regions. Each region has twotyp es of vertices, boundary vertices

and interior vertices. Every interior vertex is contained in exactly one region

and is adjacent only to vertices within that region. Boundary vertices are

shared b etween at least two regions. Frederickson [Fre85b] showed that, for

every p ositiveinteger r , G has an r -division, i.e., a division with n=r 

p

r  b oundary vertices each. regions of O r vertices and O 

Supp ose we are given integers r >r >:::>r, where r  n and

1 2 k 1

r  1. A multilevel division of G is constructed as follows. First form an

k

r -division of G; each of the resulting regions will b e referred to as an r -

1 1

region.Nowwe do the next step for i =1;:::;k 1. Takeevery r -region

i

and construct an r -division for it; each resulting region will b e referred to

i+1

as an r -region. Note that in this construction, every b oundary vertex in

i+1

an r -region A will b e considered a b oundary vertex for any subregion within

i

A that contains it. It is straightforward to verify that there are O r =r 

i i+1

r -regions within every r -region and that the total number of r -regions is

i+1 i i

O n=r [Fre85b].

i

Lemma 2.1 For any given integers r >r > ::: > r , where r  n and

1 2 k 1

P

p

k

r  1,amultilevel division of G can beconstructedinO n+n log r = r 

k i i

i=1

time. If we choose r = and r = r , 1  i  k 1, for some constant

k i i+1

>1, the total time is O n.

Note: A similar result is claimed by Klein et al. [KRRS94]; we include a

pro of for completeness.

Pro of. We use a result by Go o drich [Go o93 ] to show that after a one-time-

p

only O n prepro cessing step, an r -division can b e constructed in O n log r= r 

time. The r -division is built using a two-step pro cedure byFrederickson

[Fre85b] that uses the planar separator theorem [LiTa79 ]. The latter states

that if G has vertex weights adding up to at most one, then there is a par-

tition of V Ginto sets A, B , and C such that no edge joins a vertex of A 4

with a vertex in B , neither A nor B has total weight exceeding 2=3, and C

p

p

2 n vertices. contains no more than 2

Frederickson's algorithm starts with G consisting of one region and with

all vertices interior. In the rst step, it applies the separator theorem with all

vertex weights equal to 1=n, to obtain sets A, B , and C .Two regions with

vertex sets A [ C and B [ C are inferred, each of which has C as its set of

b oundary vertices. The same pro cedure is applied recursively to any region

with more than r vertices, resulting in a division of G into n=r  regions

p

with no more than r vertices each and a total of O n= r  b oundary vertices

[Fre85b]. In the second step, the following op eration is rep eated until it no

p

r longer applies. Find a planar separator in any region R with more than

b oundary vertices and use it to split R into subregions. For this, let the

0 0

n b oundary vertices haveweight1=n , and let interior vertices haveweight

zero.

The key to implementing Frederickson's algorithm eciently is to nd the

required separators quickly. Given O n prepro cessing time, an algorithm

by Go o drich [Go o93 ] builds a data structure that allows one to compute

p

a separator weighted or not in O  n log n time. Within the same time

b ound, similar data structures can b e set up for each region de ned by the

separator [Go o93 ]. We should note that Go o drich's algorithm is not directly

applicable to our needs, since, after nding the partition of V Ginto sets

A, B , and C , it builds data structures for computing separators in G[A] and

1

G[B ], and not in G[A [ C ], G[B [ C ] as required byFrederickson's algorithm .

Fortunately, only slightchanges to Go o drich's scheme are needed to handle

this | we omit the details.

Thus, after the one-time-only O n prepro cessing step needed to build

the necessary data structures, we will b e able to compute each separator

in sublinear time. Hence, the total time for the rst step of Frederickson's

algorithm is describ ed by the recurrence

p p p

tn; r   a n log n + t n + b n; r +t1 n + b n; r  for n>r,

tn; r =0 for n  r

where 1=3   2=3. One can showby induction that

p p

tn; r   cn log r= r d n log n

1

We write G[A] denote the subgraph of G induced by the vertices of A. 5

for some constants c and d.At the b eginning of the second step, wehave

p

r  b ound- n=r  regions of at most r vertices each and with a total of O n=

ary vertices. At the end of the second step, we still haven=r  regions of

p

at most r vertices, but now each region has O  r  b oundary vertices. The

total numb er of separator computations needed to go from the set of re-

gions existing after the rst step to the set of regions at the end of step 2

is therefore O n=r . For each such region, wehave a data structure that

p

allows us to nd separators with the appropriate weights in O  r log r 

p

time. Thus, the total time sp ent on the second step will b e O n log r= r ,

which is asymptotically equal to the time sp ent on the rst step.

The lemma follows by adding up the work for constructing r -regions over

i

all i. 2

3 Spanning trees via graph reduction

An imp ortant consideration in Megiddo's parametric search metho d is cho os-

ing the right non-parametric algorithm to simulate. In the context of MRST,

we need an algorithm that evaluates Z  for any xed ; i.e., an algorithm

for nding minimum spanning trees in planar graphs. As we stated earlier,

Cheriton and Tarjan have devised a O n time algorithm for this purp ose

[ChTa76 ]; unfortunately, it is not clear how to use it directly to devise an

ecient MRST pro cedure. In this section, we give a new linear-time non-

parametric minimum spanning tree algorithm for planar graphs that relies

on multilevel divisions and the idea of graph reduction. While our algorithm

is asymptotically no faster than Cheriton and Tarjan's, the way in whichit

discards larger and larger sets of edges from the graph as the computation

unfolds will b e a notable advantage from the p oint of view of parametric

search.

3.1 Graph reduction

Our non-parametric minimum spanning tree algorithm works by rep eatedly

reducing regions of the graph, replacing them by smaller \substitutes" that

retain all the essential information for computing minimum spanning trees.

The basic pro cedure for this is algorithm Reduce, which takes a region

A of G having B as its b oundary vertices and, via a series of deletions and 6

contractions of edges, reduces G[A] to a graph with O jB jvertices. Reduce

also returns the total cost C of the edges it contracts, these b eing the edges

2

that participate in every minimum spanning tree of G . The pro cedure is

essentially the same as an algorithm by Lengauer [Len87 ]; in its description,

we will write that an edge e is contractible if

 it has a -one endp oint that is not a b oundary vertex, or

 it shares a degree-two non-b oundary vertex with another edge f such

that coste  costf .

ReduceA; C 

1 compute a minimum spanning forest T of G[A]

A

2 discard all edges in E G[A] E T 

A

3 discard all isolated vertices from G[A]

4 C  0

4 while there is a contractible edge in G[A] do

5 cho ose a contractible edge e

6 C  C + coste

7 contract e

Observe that step 1 of Reduce computes a minimum spanning forest

of region A, rather than a tree. The reason for this is that, even if G is

connected, G[A]may not b e. The application of Reduce to a planar graph

is shown in Figure 1. The next two lemmas state some prop erties of Reduce.

We will refer to the graph resulting from applying Reduce to a graph G or

to a subregion A of G as a reduction of G.

Lemma 3.1 Let A beanr -vertex region of G with a set of boundary vertices

B . Then, the reduction of G[A] isagraph of size O jB j.IfG is planar and

the time for computing a minimum spanning tree is excluded, ReduceA; C 

takes O r  time and the reduction of G is a planar graph.

2

This assumes that the minimum spanning tree is unique, which is guaranteed to b e the

case if all edge costs are distinct. If they are not, one standard way of ensuring uniqueness

is to assign an arbitrary numb ering to edges and to use it to resolve ties. 7 (a) (b)

(c) (d)

(e)

Figure 1: Applying Reduce to the regions of a graph. a The original graph;

terminal vertices are shown as grey squares. b Separating the graph into

four regions. b The regions after edges not in their resp ective minimum

spanning forests are deleted. c The regions after edge contractions. d

Reassembling the regions. 8

Pro of. The planarity of the reduction of G follows from the fact that edge

deletion and edge contaction are planarity-preserving op erations. The size

b ound on the reduction of G[A] and the fact that Reduce's deletions and

contractions can b e done in time linear in the number of vertices and edges

were proved by Lengauer [Len87]. The running time for planar graphs is

O r  since the numb er of edges in these graphs is linear in the number of

vertices. 2

Note: If the Cheriton-Tarjan planar minimum spanning tree algorithm is

used in step 1 of Reduce, this algorithm will take a total of O r  time.

We will show, however, that a linear-time minimum spanning tree algorithm

can b e obtained even when a slower minimum spanning tree algorithm e.g.,

Kruskal's [Kru56 , Tar83 ] is used in that step.

0

Lemma 3.2 Let G beagraph and let G be the graph obtainedfrom G by

cal ling ReduceA; C , for some region A of G. Then, every edge in the min-

0 0

imum spanning tree T of G is in a minimum spanning treeof G. Moreover,

0

the cost of a minimum spanning tree for G equals costT +C .

Pro of. Using well-known prop erties of minimum spanning trees [Len87,

Tar83 ], one can show that every contractible edge is essential, as it is included

in every minimum spanning tree of G, and that every discarded edge is non-

essential in that it participates in no minimum spanning tree of the graph.

The lemma follows. 2

3.2 The minimum spanning tree algorithm

We pro ceed to describ e the algorithm MST , which returns the cost of a

minimum spanning tree. The pro cedure will asso ciate with each region A,

avariable C , which will record the total cost of contracted edges within

A

A.For convenience, we de ne r = 1 and consider every no de in G as an

k +1

r -region. We assume that C = 0 for every r -region.

k +1 A k +1

MST G

1 build a multilevel division of G

2 for i  k downto 1 do

3 for each r -region A do

i 9

4 ReduceA; C 

A

P

5 C  C + fC : B is an r -subregion of Ag

A A B i+1

0

6 construct a minimum spanning tree T of the remaining graph

P

0

7 return costT + fC : A an r -regiong

A 1

We shall refer to the iteration of MST where i = j as iteration j ;thus,

iteration k is actually the rst iteration and iteration 1 is the last. We rst

state a simple b ound on the size of an r -region at iteration i of MST .

i

Lemma 3.3 At the beginning of iteration i, k  i  1 of MST , every r -

i

p

r . region of G has been reduced to a planar graph of size O r =

i+1 i

Pro of. Each r -region A has O r =r  r -subregions, each of which has

i i i+1 i+1

p

O  r  b oundary vertices. By Lemma 3.1, at the b eginning of iteration i,

i+1

p

each subregion has b een reduced to a planar graph with O  r vertices.

i+1

The lemma follows. 2

Lemma 3.4 Algorithm MST correctly computes the cost of a minimum

P

p

k

log r = spanning treeofG in O n + n r  time. Suppose that i

i i+1

i=1

the minimum spanning forests in step 1 of Reduce and step 6 of MST are

computed using an algorithm that runs in O m log n  time, where n and

0 0 0

m are the number of vertices and edges of input region, and ii we choose

0

k and a sequence r ; ;r such that r = , r = r , 1  i  k 1, and

1 k k i i+1

2

log n  r  n, for some suitable constant >1. Then MST runs in O n

1

time.

Pro of. The correctness of MST follows immediately from Lemma 3.2. By

P

p

k

r  time. Now, consider steps Lemma 2.1, step 1 takes O n + n log r =

i i

i=1

p

2{5. By Lemma 3.3, each region A considered in steps 3{4 has O r = r 

i i+1

vertices and edges. Thus, using Lemma 3.1 and implementing Reduce's

minimum spanning tree computation using a O m log n  algorithm, we can

0 0

p p

pro cess A in O r = r  log r  time, for a total of O n log r = r over

i i+1 i i i+1

p

all r -regions. The graph remaining in step 6 will have O n= r vertices.

i 1

2

Since r  log n, its minimum spanning tree can b e constructed in O n

1

P

p

k

log r = time. The total time sp ent in steps 1{6 is thus O n + n r ,

i i+1

i=1

whichisO n for the given choice of r 's. 2

i 10

Later in this pap er, we will nd it convenienttocho ose a sequence

r ;:::;r such that r = n. If we do so, the only r -region will b e G it-

1 k 1 1

self and it will have no b oundary vertices. The last iteration of MST will

therefore pro duce a one-vertex graph and C will equal the cost of a mini-

G

mum spanning tree.

4 The search

As stated in the intro duction, solving the minimum ratio spanning tree prob-

 

lem is equivalent to nding a value  such that Z  =0. Our MRST

algorithm accomplishes this by lifting the execution of algorithm MST of

Section 3 so as to determine all its computation paths over an I



containing  . The nal result will b e a complete description of Z  within



I ;  will b e found by searching this description to lo cate the p oint at which

Z crosses the -axis. Lifting is an exp ensive op eration, since the number

of computation paths grows rapidly with the size of I . Thus, in order to

make the search ecient, wemust control the size of this interval; this is

accomplished using an oracle, a pro cedure that can determine the p osition



of any given value  with resp ect to  [Meg79, Meg83]. One of the key

0

features of our algorithm is the way in which the oracle and the lifting steps

interact. Taking advantage of the structure of algorithm MST ,we are able

to ensure that each successive lifting step uses a faster oracle than the pre-

ceding step; the overall e ect will b e that the time for successive steps adds

up in a geometric series.

We will now giveanoverview of the search algorithm, after whichwe will

describ e its main details.

4.1 An overview of the algorithm

The search algorithm lifts the computation of MST iteration by iteration;

each lifting step pro duces an ecient representation of all p ossible outcomes

of the ith iteration of MST over some interval I , for each r -region A of G.

i

An ecient representation is a data structure that allows us to obtain two

ob jects quickly:

 the reduced graph G  for A relative to the weights w  and

A e 11

 the cost C  of the contracted edges for that region.

A

In order to lift iteration i,we will need ecient representations of the outcome

of iteration i + 1 for every r -region B of G. Underlying the representation

i+1

for region B is a set of values L I, which induces a sub division of I

B

into a sequence of intervals, denoted I . The L 's will satisfy the following

B B

prop erties.

P1 Every value in L is the  -co ordinate of the intersection p oint of the

B

costs lines for two edges lying within region B .

0

P2 Let I be any subinterval of I . Then, the computation path followed

B

by MST on B up to the b eginning of iteration i is the same for all

0

 2I . That is, at the b eginning of iteration i, MST will have deleted

0

and contracted exactly the same set of edges in region B , for all  2I .

S

P3 j fL : B an r -regiongj  n=r .

B i+1 i+1

2

By P1, jL j = O r , since region B has O r  edges. By P2, the

B i+1

i+1

0

reduced graph G   is the same for all  2I and that C   is a straight

B B

0

line within I . Thus, the outcomes of all computation paths on B up to

the b eginning of iteration i can b e represented by an ordered list of the

subintervals of I , where, for for each subinterval, the corresp onding G 

B B

and C  is recorded. The subintervals can b e represented so as to allow

B

O log jL j=O log r  access time if, for example, we use balanced binary

B i+1

search trees see [FeSl94] for one way of doing this. We should note that

a binary search tree representation also allows ecient up dates, a fact that

shall b e used by the search algorithm. Observe also that it is easy to build

ecient representations for the r -regions at the b eginning of iteration k :

k +1

Since each region consists of a single vertex, prop erties P1, P2 and P3

will trivially hold true at the b eginning of iteration k if we set L = ; for

B

every r -region B .

k +1

To lift iteration i of MST ,we rst build sets L , for all r -regions A, that

A i

satisfy prop erties P1, P2, and P3 with resp ect to the r -regions. The

i

whole pro cess will b e referred to as a re nement of I . After the re nement

is complete, we will pro cess each r -region A separately, lifting the execution

i

of Reduce for each subinterval of the sub division I of I induced by the

A

S

p oints in L . Initially, for each r -region A, L = fL : B is an r -

A i A B i+1

subregion of Ag; this set will clearly satisfy prop erty P1 with resp ect to 12

region A. Prop erty P2 implies that the reduced graph G[A] pro cessed by

0 0

Reduce within any subinterval I of I is the same for any  2I. The

A

reason is that each subregion of A is reduced to a unique graph indeed, a

0

unique forest within I .However, Reduce's computation on A mayhave

0

di erent outcomes for di erent  2I and, thus, L might not satisfy P2

A

with resp ect to A.Intuitively, this is b ecause edges in di erent subregions

of A mayinteract in ways that are not re ected by the current L | this

A

o ccurs b ecause cycles are formed when reduced subregions are put together

see Figure 1. Thus, it will b e necessary to add new p oints to the L 's

A

corresp onding to the intersections of cost lines of edges lying in di erent

r -subregions of A. This will have to b e done carefully, since the number of

i+1

intersections may b e large. Our technique is to sample the set of intersection

p oints, and use the information, in conjunction with the oracle, to eliminate a

large enough fraction of these p oints from any further consideration, without

actually having to generate them.

A top-level description of the search algorithm is shown b elow.

SearchG

1 I1; +1

2 build a multilevel division of G

3 for i  k downto 1 do

4 re ne I

5 for each r -region A do

i

0

6 for each interval I of I do

A

0

7 lift ReduceA; C   over all  2I

A

P

8 C    C  + fC :B is an r -subregion of Ag

A A B i+1



9 construct a description of Z   within I and lo cate 

Steps 1{2 are indep endent of edge costs and need not b e explained further.

In the rest of this section, we shall describ e, in order, each of the main parts

of Search: re ning step 4, lifting steps 5{8, and concluding the search

step 9. Additionally,we will discuss how the results of the lifting steps are

used to pro duce faster oracles.

4.2 Re ning the searchinterval

0

Consider any r -region A at the b eginning of iteration i and let I be any

i

0

 to denote the set of cost lines of edges subinterval of I .We write S I

A A 13

0

in E G  , for  2I. Because of prop erty P2, this is a well-de ned

A

set. The interval re nement algorithm uses a simple result. In its pro of, for

clarity,we will use a sup erscript of i to denote the value of an ob ject at the

i

b eginning of iteration i;thus, for example, G  will b e the reduced graph

B

at the b eginning of iteration i for the given  -value.

0

Lemma 4.1 Let I be any subinterval of I at the beginning of iteration

A

0

i of Search. Let L be the set of  -values of al l intersections of lines in

0 0 00

S I  whose  -coordinate fal l in I and let I be any of the subintervals of

A

0 0

I induced by the values in L . Then, when appliedtoregion A, Reduce

00

fol lows the same computation path for al l  2I .

Pro of. Reduce's choice of edges to delete and edges to contract dep ends

i 0

on the top ology of G  | which, by P2, is xed with I | and the

A

00 i

 . By de nition of I , this relative ordering of the costs of the edges in G

A

00

ordering is xed within I . The lemma follows. 2

Supp ose wehave an oracle; i.e., a pro cedure that, given a value  , de-

0

  

termines whether  < ,  =  ,or > . After applying the oracle

0 0 0

to  , this value will b e said to b e resolved. Lemma 4.1 could then b e used

0

0

to re ne I by simply generating intersection p oints b etween lines in S I 

A

and then invoking the oracle rep eatedly. There are at least two obstacles to

overcome. First, the total number of intersection p oints over all r -regions is

i

sup erlinear. Second, wemust have a fast indeed, sublinear oracle to resolve

-values. The rst problem will b e addressed by narrowing the search in-

terval using global information, prior to actually generating anyintersection

p oints. To address the second diculty,we use a sequence of successively

faster oracles Oracle ;:::;Oracle , whose details will b e supplied later.

k 1

For now, we limit ourselves to stating that Oracle , the oracle for iteration

i

p

i, can resolveanyvalue  in O n= r  time.

0 i+1

The re nement step uses two subroutines. The rst of these applies an

oracle to narrow the searchinterval I :



NarrowI ;L;s;Oracle: Given an interval I where  2I, a list of

values L I,a number s, and an oracle Oracle, return an interval



0 0 0

I I such that  2I and jL \I js, and discard every p ointin

0

L lying outside of I . 14

Narrow is implemented using a standard technique see, e.g., [Meg83]:

Cho ose a elementof L and apply Oracle to it; dep ending on the

outcome of the call, either resolve all elements of L larger than the median

or all elements smaller than the median. In either case, at least half of the

elements in L will b e resolved; these values can therefore b e removed from

further consideration and the interval I is up dated accordingly. The pro cess

is rep eated until I contains no more than s p oints of L.

Lemma 4.2 NarrowI ;L;s;Oracle runs in O jLj + t  log jLj=s time,

where t is the running time of Oracle.

Pro of. Since each oracle call reduces the numb er of p oints of L in I byat

q

least half, after q calls, the numb er of p oints will b e at most jLj=2 . Hence,

q = log jLj=s calls suce to reduce I by the desired amount. The total time

is therefore O jLj + t  log jLj=s, where the O jLj term accounts for the

total overhead incurred in computing and the second term accounts

for the total time sp entby the oracle calls. 2

The second subroutine allows us to sample the intersection p oints of an

arrangement of lines without having to construct it explicitly.

p

Sqrt-QuantilesS : Given a set of lines S , return the set of s quantiles

of their intersection p oints, where s = jS j. That is, return a set of

p p

s 1 -values that split the set of intersection p oints into s equal-

sized subsets to within 1.

The subroutine Sqrt-Quantiles can b e implemented using a pro cedure

by Cole et al. [CSSS89], which, given s distinct lines, nds the intersection

p oint with the k th smallest  -co ordinate in optimal O s log s time. The

p

quantiles we need can b e found with O  s calls to Cole et al.'s algorithm.

3=2

The required time is O s log s. Observe that the number of intersection

3=2

p oints b etween consecutive quantiles is O s .

There are two main phases in the pro cess of re ning interval I . Phase

1 examines each region A and each subinterval of I and nds an evenly-

A

distributed subset of the intersection p oints of the lines within the subinter-

val. It do es not nd al l the intersection p oints b ecause that would lead to

a sup erlinear search algorithm. The intersection p oints that are generated

will de ne smaller subintervals of I within which relatively few intersections 15

take place. Interval I is then narrowed so that the number of intersections

within each region that fall within I is small. Phase 2 actually enumerates

these intersections and then narrows I further. In addition to phases 1 and

2, there is a preliminary phase where certain data structures are set up.

Refine

> Phase 0

1 for each r -region A of G do

i

S

2 L  fL : B is an r -region within Ag

A B i+1

3 build an ecient representation of I

A

> Phase 1

4 for each r -region A of G do

i

0

5 for each subinterval I of I do

A

0 0

6 L  L [ Sqrt-QuantilesS I  \I 

A A A

S

7 L  fL : A an r -regiong

A i

8 NarrowI ;L;n=r ; Oracle 

i i

> Phase 2

9 for each r -region A of G do

i

0

10 for each subinterval I of I do

A

0 0

11 L  L [f 2I :  is the intersection of two lines in S I g

A A A

S

12 L  fL : A an r -regiong

A i

13 NarrowI ;L;n=r ; Oracle 

i i

Phase 0 is done by merging ecient representations for the I 's of the

B

r -regions. By P3, the total number of intervals over all the resulting

i+1

2

I 's will b e O n=r , and, by P1, any I will have O r  subintervals.

A i+1 A

i

The required I 's can thus b e assembled in O n=r  log r  time.

A i+1 i

Phases 1 and 2 rely on the ecient representations of the I 's in order

A

0

to retrieve the various S I 's. By P3, the total numb er of subinter-

A

vals that will b e considered over all executions of step 5 is O n=r ; i.e.,

i+1

the total numb er of times step 6 is executed is O n=r . By Lemma 3.3,

i+1

p

0

the graph G  for any suchinterval I is of size O r = r ; thus, in

A i i+1

p

0

step 6, jS I j = O r = r . Hence, each execution of step 6 takes

A i i+1

3=2 3=4 1=2 1=4

O r =r  log r  time and adds O r =r values to L . The total time

i A

i i+1 i i+1

7=4 3=2

 log r  and at =r sp entover all executions of step 6 is therefore O nr

i

i+1 i 16

1=2 5=4

step 7, jLj = O nr =r . By Lemma 4.2, step 8 takes time

i i+1

0 1

1=2

n log r nr

i

i

@ A

+ O :

p

5=4

r

i+1

r

i+1

Hence, the total time for Phase 1 is

1 0

1=2 3=2

nr n log r log r nr

i i

i i

A @

: 1 + + O

p

7=4 5=4

r

i+1

r r

i+1 i+1

As a consequence of the call to Narrow in Phase 1, the total num-

b er of subintervals that will b e considered over all executions of step 10 is

O n=r ; i.e., step 10 is executed O n=r  times. As in Phase 1, we will have

i i

p

0 0

jS I j = O r = r  for any subinterval I of I . The de nition of Sqrt-

A i i+1 A

0

Quantiles ensures that the number of intersection p oints of lines in S I 

A

0 0 3=2

that fall within I is O jS I j . Hence, each execution of step 11 adds

A

3=4 3=2

values to L , implying that, in step 12 =r O r

A

i+1 i

1 0 1 0

3=2 1=2

r nr n

i i

A @ A @

 = O : jLj = O

3=4 3=4

r

i

r r

i+1 i+1

0

Using standard techniques [CLR90 ], we can generate all the new p oints in I

0 0 0

in O log jS I j time p er p oint, at the exp ense of O jS I j log jS I j

A A A

prepro cessing time, for a total running time of

0 1

3=2

r

i

0 3=2 0

@ A

O jS I j log jS I j= O

A A

3=4

r

i+1

1=2 3=4

0

per I . The time required over all O n=r intervals is O nr =r  log r .

i i

i i+1

By Lemma 4.2, step 13 takes time

0 1

1=2

n log r nr

i

i

@ A

O + ; 2

p

3=4

r

i+1

r

i+1

which is also an upp er b ound on the time needed by Phase 2.

We summarize the analysis of Refine with the following lemma.

P

3=2 7=4

k

Lemma 4.3 Algorithm Search spends a total of O n r =r  log r 

i

i i+1

i=1

S

time on Refine. After Refine is executed in stage i, j fL : A an r -regiongj =

A i

0

O n=r  and for any r -region A and any subinterval I of I , the computa-

i i A

0

tion path fol lowedbyReduce on A is the same for al l  2I . 17

Pro of. The time b ound follows from equations 1 and 2. By construc-

0

tion, no subinterval I of I will contain an intersection p ointoftwo lines

A

0 0

in S I . The uniqueness of the computation path within I follows from

A

Lemma 4.1. 2

4.3 Lifting the ith iteration

We refer the reader back to the top-level description of algorithm Search.

Consider any r -region A at the p oint in iteration i of Search immediately

i

following the re nementof I . By Lemma 4.3, the graph G   is the same

A

0 0

for all  2I for any subinterval I of I . This makes lifting the computation

A

0

of Reduce over all  2I easy: simply execute Reduce on A for any 

0

p

0

. in the interior of I . By Lemma 3.3, wehave jV G j = O r = r

i+1 A i

Thus, if Kruskal's algorithm is used to compute minimum spanning trees,

p

Reduce will take O r = r  log r  time. By Lemma 4.3, the total num-

i i+1 i

berofintervals over which the computation will b e lifted is O n=r ; Thus,

i

the total time required for lifting all executions of Reduce on r -regions is

i

p

O n= r .

i+1

After lifting the di erent executions of Reduce over all r -regions, Search

i

will use the information gathered in this pro cess to construct ecient repre-

sentations of the I 's for all r -regions A. If balanced binary search trees are

A i

used for this purp ose, the time required will b e O log jL j p er value in L .

A A

Since every p ointinL is the intersection of the cost lines of two edges in

A

2

region A, jL j = O r , and, since the total numb er of subintervals over all

A

i

r -regions is O n=r , all the required ecient representations can b e built in

i i

O n=r  log r  time.

i i

4.4 The oracles

Recall that every edge in the input graph has a linear weight function w =

e

a b . As a result, Z  is a piecewise-linear concave function [Meg79],

e e

and, assuming the b 's are nonnegative, the slop e of every segmentof Z 

e

will b e nonp ositive. Wethus have three p ossibilities [Meg83]:



 Z   = 0. Then,  = 

0 0



 Z   > 0. Then,  < .

0 0 18



 Z   < 0. Then,  > .

0 0

Therefore, to implement an oracle, it is enough to haveawaytoevaluate

Z  , the cost of a minimum spanning tree in G relative to the weights

0

w  ; given this information, the additional work is O 1. In fact, we only

0

need to b e able to evaluate Z  for  2I, since anyvalue  62 I can b e

0

resolved in O 1 time by determining its p osition relative to the endp oints

of I .

Oracle uses the planar minimum spanning tree algorithm of Section 3

k

on the original graph and thus takes O n time alternatively, the Cheriton-

Tarjan algorithm could b e used. We use the representation of the I 's con-

A

structed while lifting the executions of Reduce to implement Oracle .

i1

The idea is to consult the representation to retrieve the reduced graphs at

, therebyavoiding the wasteful task of recomputing this information from

scratch. The details are as follows.

Oracle  

i1 0

1 for each r -region A do

i

i i

    and C 2 retrieve G

0 0

A A

i 0

3 assemble the G  's into a graph G

0

A

P

0 i

4 Z  MST G + fC  :A an r -regiong

0 i

A



5 if Z>0 then return \ < "

0



else if Z<0 then return \ > "

0



else return \ =  "

0

Step 2 is done in O n log r =r by accessing the ecient representations

i i

i

 's. of the I 's. Step 3 is done by identifying b oundary vertices of the G

0 A

A

p

0

r . Thus, step 4 takes The resulting graph G is planar and has size O n=

i

p

O n= r  time and, by Lemma 3.2, Z is the cost of a minimum spanning

i

tree in the original graph G. The value Z can b e used to resolve  in O 1

0

p

time. Therefore, the oracle takes O n= r  time.

i

4.5 Concluding the search

Up to now, wehave not sp eci ed the values of the r 's. Assume that we

i

cho ose r = n; this makes the top-level region A the entire graph G. Then,

1

when Search reaches step 9, L will contain O 1 values that sub divide I

A A 19

0

into O 1 subintervals. Within each subinterval I , G will have b een reduced

to a one-vertex graph, and we will have a linear function giving the cost

0

of the minimum spanning tree for all  2I. We can lo cate the p ointat

which Z   equals zero by examining every interval to determine whether its

asso ciated cost line intersects the  -axis. Thus, the nal step of the search

takes only O 1 time.

The total time taken by Search is therefore dominated byinterval re ne-

P

3=2 7=4

k

ment, which, by Lemma 4.3, is O n r =r  log r . Making r = n,

i 1

i i+1

i=1

r = r = , and setting k such that r  , for some suitable >1, we

i+1 i k

obtain our main result. We assume, for simplicity, that the successive r 's

i

are integers. The analysis can b e easily mo di ed to handle the case where

they are not.

Theorem 4.4 The minimum ratio spanning treeproblem can be solvedin

linear time for planar graphs.

Before concluding this section, we should note that Cole et al.'s algorithm

[CSSS89 ], which is used extensively in Sqrt-Quantiles, uses the AKS sort-

ing network, which makes it impractical. Cole et al. have describ ed a much

4 2

simpler algorithm whose running time is O s log s when a O log s-depth

sorter, such as Batcher's [Bat68], is used. It is easy to verify that by using

4

the simpler O s log s algorithm, one can obtain a new MRST algorithm

whose running time is still linear.

5 Discussion

The MRST algorithm can easily b e adapted to yield linear-time algorithms

for two closely related problems. In what follows, it is not necessary to assume

that the b 's are all p ositive or all negative. The rst problem, which arises

e

in certain typ es of sensitivity analysis [Gus83], is nding the next breakp oint



of Z ; i.e., given a  nd the smallest  > such that

1 1



 is a breakp ointofZ . The second problem, which arises in Lagrangian

 

relaxation [CMV89], is to nd a maximizer  of Z ; i.e., nd a  such that



Z   = max Z . The algorithms for these problems are nearly identical



to the MRST algorithm, except for the oracle. For the rst problem, given

avalue  , the oracle must determine whether the solution that is optimal

0



; at  is the same as the one that is optimal at  [Gus83 ]. If so,   

1 0 0 20

 

otherwise,  > .For the problem of maximizing Z ,    if the slop e

0 0

of Z at  is p ositive [CoMe93 ]. Thus, in b oth problems the situation is

0

analogous to minimum ratio optimization: the oracle requires an evaluation

of Z   plus additional work that is O 1.

0

The maximization algorithm discussed ab ove can b e used to improve

the eciency of an algorithm for solving the Lagrangian dual of the mini-

mum spanning tree problem with a xed numb er of side constraints [AgFe92,

d

CMV89]. The algorithm given in [AgFe92] sp ecializes to a O n log n algo-

rithm for planar graphs, where d is the numb er of side constraints; using

the algorithm describ ed here, we are able to reduce the running time to

d1

O n log n. We note that the maximization algorithm also leads to a new

linear-time algorithm for solving the planar minimum spanning problem with

one degree constraint, using a formulation given byAhuja, Magnanti, and

Orlin [AMO92]. An algorithm for this problem on general graphs, which

sp ecializes to a linear-time algorithm for planar graphs, was given by Gab ow

and Tarjan [GaTa84 ].

Our algorithm works in linear time for any family of graphs that admit a

linear-time decomp osition into regions with a sublinear numb er of b oundary

vertices and where spanning trees can b e computed in linear time. Using

additional ideas [FeWi91], it also extends to other parametric problems as-

so ciated with matroids on graphs whose circuits are de ned to b e subgraphs

homeomorphic from some nite set of graphs [Mat79 ]. Another member

of this family is the parametric minimum spanning problem

[GaTa88 ].

References

[AgFe92] R. Agarwala and D. Fern andez-Baca. Weighted multidimensional search

and its application to convex optimization. DIMACS Technical Rep ort 92-51,

Novemb er, 1992. To app ear in SIAM J. Comput.

[AKS83] M. Ajtai, J. Komlos, and E. Szemer edi. Sorting in c log n parallel steps.

Combinatorica, 3:1{19 1983.

[AMO92] R.K. Ahuja, T.L. Magnanti, and J.B. Orlin. Network Flows: Theory,

Algorithms, and Applications. Prentice-Hall, Englewo o d Cli s, NJ, 1992.

[Bat68] K.E. Batcher. Sorting networks and their applications. In Proc. AFIPS

Spring Joint Summer Computer Conf.,Vol. 32, pp. 307{314. 21

[CEGS92] B. Chazelle, H. Edelsbrunner, L. Guibas, and M. Sharir. Diameter,

width, closest line pair, and parametric searching. In Proceedings of the 8th

Annual ACM Symposium on Computational Geometry, pp. 120{ 129 1992.

[CMV89] P.M. Camerini, F. Maoli, and C. Vercellis. Multi-constrained ma-

troidal knapsack problems. Mathematical Programming 45:211{231 1989.

[CoMe93] E. Cohen and N. Megiddo. Maximizing concave functions in xed di-

mension. In Complexity in Numerical Computations,P.M. Pardalos, ed.,

World Scienti c Press 1993.

[Cole87] R. Cole. Slowing down sorting networks to obtain faster sorting algo-

rithms. J. Assoc. Comput. Mach., 341:200{208, 1987.

[Cha77] R. Chandrasekaran. Minimal ratio spanning trees. Networks, 7: 335{342

1977.

[ChTa76] D. Cheriton and R.E. Tarjan. Finding minimum spanning trees. SIAM

J. Comput., 5:724{742 1976.

[CLR90] T.H. Cormen, C.E. Leiserson, and R.L. Rivest. Introduction to Algo-

rithms. MIT Press, Cambridge, Massachusetts, 1990.

[CSSS89] R. Cole, J.S. Salowe, W.L. Steiger, and E. Szemer edi. An optimal-time

algorithm for slop e selection. SIAM J. Comput., 18:792{810 1989.

[FeSl94] D. Fern andez-Baca and G. Slutzki. Optimal parametric search on graphs

of b ounded tree-width. In Proc. 4th Scandinavian Workshop on Algorithm

Theory, pp. 155{166, LNCS 824, Springer-Verlag, 1994.

[FeWi91] D. Fern andez-Baca and M.A. Williams. On matroids and hierarchical

graphs. Information Processing Letters 38 1991, 117{121.

[Fre85b] G.N. Frederickson. Fast algorithms for shortest paths in planar graphs,

with applications. SIAM J. Comput. 16:1004{1022 1985.

[Fre90] G.N. Frederickson. Optimal algorithms for partitioning trees and lo cating

p-centers in trees. Technical Rep ort CSD-TR 1029, Department of Computer

Science, Purdue University, Octob er 1990.

[FrWi90] M. Fredman and D. Willard. Trans-dichotomous algorithms for mini-

mum spanning trees and shortest paths. In Proc. 31st Annual IEEE Symp.

on Foundations of Computer Science, 1990, pp. 719{725.

[GaTa84] H.N. Gab ow and R.E. Tarjan. Ecient algorithms for a family of ma-

troid intersection problems. J. Algorithms, 5:80{131 1984.

[GaTa88] H.N. Gab ow and R.E. Tarjan. A linear-time algorithm for nding a

minimum spanning pseudoforest. Information Processing Letters, 275:259{

263 1988. 22

[GGST86] H.N. Gab ow, Z. Galil, T. Sp encer, and R.E. Tarjan. Ecient algorithms

for nding minimum spanning trees in undirected and directed graphs. Com-

binatorica, 6:109{122 1986.

[Go o93] M.T. Go o drich. Planar separators and parallel p olygon triangulation.

Manuscript. A preliminary version app eared in Proceedings of the 24th An-

nual Symposium on Theory of Computing, 1992, pp. 507{516.

[Gus83] D. Gus eld. Parametric combinatorial computing and a problem in pro-

gram mo dule allo cation. J. Assoc. Comput. Mach., 303:551{563 1983.

[KKT94] D.R. Karger, P.N. Klein, and R.E. Tarjan. A randomized linear-time

algorithm for nding minimum spanning trees. Manuscript. A preliminary

version app eared in STOC 94.

[KRRS94] Klein, S. Rao, M. Rauch, and S. Subramanian. Faster shortest-path

algorithms for planar graphs. In Proc. STOC 94.

[Kru56] J.B. Kruskal. On the shortest spanning tree of a graph and the traveling

salesman problem. Proc. Amer. Math. Soc., 7:48{50 1956.

[Len87] T. Lengauer. Ecient algorithms for nding minimum spanning forests in

hierarchically de ned graphs. J. Algorithms, 8:260{284 1987.

[LiTa79] R.J. Lipton and R.E. Tarjan. A separator theorem for planar graphs.

SIAM J. Appl. Math, 36:177{189 1979.

[MaSc93] J. Matousek and O. Schwartzkopf. A deterministic algorithm for the

three-dimensional diameter problem. In Proceedings of 25th Annual Sympo-

sium on Theory of Computing, pp. 478{484 1993.

[Mat79] L.R. Matthews. In nite subgraphs as matroid circuits. Journal of Com-

binatorial Theory, Series B, 27 1979, 260{273.

[Meg79] N. Megiddo. Combinatorial optimization with rational ob jective func-

tions. Math. Oper. Res., 4:414{424 1979.

[Meg83] N. Megiddo. Applying parallel computation algorithms in the design of

serial algorithms. J. Assoc. Comput. Mach., 304:852{865, 1983.

[Tar83] R.E. Tarjan. Data Structures and Network Algorithms. So ciety for Indus-

trial and Applied Mathematics, 1983.

[Tol93a] S. Toledo. Maximizing non-linear convex functions in xed dimension. In

Complexity in Numerical Computations,P.M. Pardalos, ed., World Scienti c

Press 1993. A preliminary version app eared in FOCS 92. 23