Computer Science Technical Reports Computer Science

10-13-1994 Optimal Parametric Search on Graphs of Bounded Tree-Width 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 Commons

Recommended Citation Fernández-Baca, David and Slutzki, Giora, "Optimal Parametric Search on Graphs of Bounded Tree-Width" (1994). Computer Science Technical Reports. 89. http://lib.dr.iastate.edu/cs_techreports/89

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]. Optimal Parametric Search on Graphs of Bounded Tree-Width

Abstract We give linear-time algorithms for a class of parametric search problems on weighted graphs of bounded tree- width. We also discuss the implications of our results to approximate parametric search on planar graphs.

Disciplines Theory and Algorithms

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

Optimal Parametric Search on Graphs of



Bounded Tree-width

y

David Fernandez-Baca and Giora Slutzki

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

Octob er 13, 1994

Abstract

We give linear-time algorithms for a class of parametric search

problems on weighted graphs of b ounded tree-width. We also discuss

the implications of our results to approximate parametric search on

planar graphs.

1 Intro duction

Parametric search has b een the center of a considerable amount of research

in recent times due to its numerous applications to optimization and com-

putational geometry [CoMe93 , Tol93, CEGS92, MaSc93]. Much of this work

stems from two fundamental pap ers by Megiddo [Meg79, Meg83], where he

intro duced a powerful to ol for parametric search. In the context of opti-

mization problems, the application of Megiddo's technique tends to followa

common pattern. Supp ose we have an A that allows us to deter-

mine the value of a certain function f for any  within a certain range, and



that we wish to lo cate a critical value  for f whose nature dep ends on the



A preliminary version of this pap er app ears in the pro ceedings of the 4th Scandinavian

ConferenceonAlgorithm Theory, Aarhus, Denmark, 1994.

y

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

and grant No. CCR-211262. 1

application. Megiddo argued that we can pro ceed by simulating the execu-



tion of A to determine its computation path at  . To do so, the op erations

of A are executed symb olically, manipulating functions of  instead of num-

b ers. At branching p oints of A commonly asso ciated with comparisons,

decisions ab out the path to follow are made by invoking an oracle, which is

often closely related to algorithm A. Oracle calls are exp ensive; therefore,

they must be used sparingly. Megiddo showed that if these op erations can

be batched i.e., group ed and ordered in such a way as to p ermit many of

them to be resolved by a single oracle call, the total amount of work to

solve the parametric problem can often be made at most a p olylogarithmic

factor slower than that of algorithm A. The p olylogarithmic slowdown in go-

ing from non-parametric to parametric algorithms remains even when using

Cole's clever technique [Cole87].

In this pap er, we show that the ab ove-mentioned slowdown can be com-

pletely avoided for certain parametric optimum subgraph problems. In the

non-parametric versions of these problems, one is givenavertex- and/or edge-

weighted graph and is asked to nd the \b est" subgraph that satis es a sp eci-

ed prop erty. Problems of this kind include maximum cut, minimum-weight

dominating set, minimum-weight vertex cover, and the traveling salesman

problem. All of these problems, and many others, are known to be regular

for graphs of b ounded tree-width, implying that they can be solved in op-

timal linear time on such graphs using well-known dynamic programming

techniques [BLW87, BPT92 ]. In parametric optimum subgraph problems,

weights are assumed to be continuous functions of a parameter . The cost

of the optimum solution is describ ed by a real-valued function Z  that

G

sub divides the -axis into a sequence of intervals, where each is a

maximal connected set of -values for which a particular subgraph is opti-

mal [FeSl94]. The b oundary p oints between intervals are called breakpoints.

Three typ es of search problems will concern us:

 

P1 Given a value  nd the rst breakp oint  such that    .

1 1

  

P2 Find a value  such that Z   = 0. We assume that such a 

G

exists.

  

P3 Find  such that Z   = max Z  or such that Z   =

G G G



min Z .

G

 2

Problem P1 arises in sensitivity analysis [Gus83], P2 arises in minimum-

ratio optimization [Meg79], and P3 arises in Lagrangian relaxation [Fis81].

We shall show that, assuming the underlying non-parametric problem is reg-

ular, P3 can be solved in linear time if weights are concave xed-degree

p olynomial functions, and P1 and P2 can be solved in linear time if

weights are linear. These algorithms are optimal, to within a constant fac-

tor, since their run times match those of their non-parametric versions.

Our work has b een motivated by that of Frederickson [Fre90], who showed

that a number of lo cation problems on trees can be solved in optimal lin-

ear time by a novel application of parametric search. We b orrow several of

Frederickson's ideas here, including rep eated graph contraction, accompa-

nied by a rapid narrowing of the search interval, and the use of not one, but

a sequence of increasingly faster oracles. We also intro duce an idea that we

have shown to have applications outside of the context of b ounded tree-width

graphs [FeSl94a]. The basis of this technique is the observation that all our

search problems can be solved quickly if we have constructed Z over some

G



interval I containing  . Let A be the standard optimum subgraph algo-

rithm see Section 4 and [ALS91, BLW87, BPT92]. Algorithm A is easily

adapted to evaluate Z  for any xed ; moreover, Z can b e constructed

G G

by simulating the b ehavior of A for al l p ossible values of  in a pro cess that

is called lifting see Section 4. Our search metho d involves rearranging A's

computation into a sequence of phases, an op eration that relies heavily on a

linear-time algorithm for constructing parse trees satisfying an appropriate

balance condition see Section 2. This rearrangement allows the simulation

of A to be conducted by alternating lifting and \narrowing" steps. During

a lifting step, the algorithm is simulated to determine all the computation

paths it will followover an interval I . This will set the stage for a narrowing

of the searchinterval, and the construction of a faster oracle, which will make

the next phase faster than the current one. At the end of the simulation, we



will have a complete description of Z over an interval I containing  ; we

G



end the search by lo oking for  in this description.

Our results also lead to O n-time approximation algorithms for several

NP-hard parametric search problems on planar graphs. The pro of of this fact

yields some observations on the structure of functions describing the cost of

approximate solutions to parametric problems on planar graphs. 3

Organization of the pap er. Section 2 presents a linear-time algorithm

to construct balanced parse trees of b ounded tree-width graphs. It also de-

scrib es a strategy for identifying certain sets of no des in a balanced parse

tree. These sets will be used to organize the evaluation of the cost of an

optimum subgraph in the non-parametric setting in a manner to be dis-

cussed in Section 3. A parametric search algorithm based on this evaluation

algorithm is presented in Section 4. Section 5 discusses the application of

this algorithm to approximate parametric search in planar graphs, and gives

some nal comments.

2 Constructing Balanced Parse Trees

Our parametric search algorithm requires the construction of a balanced parse

tree of the input graph. Here we formalize this notion and show how such

a parse tree can be constructed in linear time. We also describ e a linear-

time algorithm to identify certain sets of no des in the tree called levels.

These sets shall b e used to organize the computation of optimum subgraphs,



and the search for  . We rst review the closely-related notions of tree

decomp ositions and parse trees.

A tree decomposition of an undirected graph G is a lab eled tree T; X,

where X is the lab eling function for T , such that for all i 2 V T , X i =

S

X = V G; 2 for every u; v  2 X V G, and such that: 1

i i

i2V T 

E G, fv; ug X for some i 2 V T ; 3 if j lies on the path of T from i

i

to k , then X \ X X . The width of T; X is max jX j 1. The

i k j i

i2V T 

tree-width of a graph G is the minimum over all tree decomp ositions T; X

of G of the width of T; X.

We write to denote the set of all graphs of tree-width at most w .

w

Classes of graphs of b ounded tree-width have b een surveyed by Bo dlaender

[Bo d88] and van Leeuwen [vLe90]. Bo dlaender [Bo d93] has shown that the

problem of determining whether a graph has tree-width at most w and, if

so, constructing a tree decomp osition of width at most w , can be solved in

linear time for every xed w .

A graph G is a k -terminal graph if it is given together with a list termsG=

ht ;:::;t i,1  s  k , of distinct vertices of G called terminals. A k -terminal

1 s

composition operator ' of arity r  0 joins r k -terminal graphs G ;:::;G

1 r

to obtain a new k -terminal graph G = 'G ;:::;G  by identifying the

1 r 4

terminals of the comp osing graphs in some precisely prescrib ed way. The

terminals of G are obtained from the terminals of the comp osing graphs

[Wim87, BPT92 ]. We shall write U [k; r] to denote the set of all k -terminal

graph comp osition op erators ' of arity at most r , and where, for each ' of

arity zero, jV 'j k . Note that for every xed k and r , jU [k; r]j is b ounded

by a constant.

Let R U[k; r]. Denote by R the subset of R consisting of all op erators

0

of arity0. R is a set of k -terminal graphs whose elements are called primitive

0



graphs. We write R to denote the set of all k -terminal graphs G such

that either G 2 R or G can be expressed as G = 'G ;:::;G  for some

0 1 r



op erator ' 2 R and some set of graphs G ;:::;G 2 R . The equality

1 r

G = 'G ;:::;G is called a decomposition of G with respect to R.

1 r



A parse tree T for G 2 R is a lab eled tree constructed as follows. If

G 2 R , T consists of a single no de v with lab el  v  = G. Otherwise,

0

let G = 'G ;:::;G  be decomp osition of G with resp ect to R . Then T

1 r

consists of a ro ot v , with lab el  v  = ', and subtrees that are parse trees

of G ;:::;G . For any no de v 2 T , we write T to denote the subtree of

1 r v



T ro oted at v . This subtree represents a graph G 2 R , such that 1

v

G =  v , if v is a leaf, or 2 G =  v G ;:::;G , if the children of v

v v v v

r

1

are v ;:::;v .

1 r

It is well known see, e.g., [Wim87] that graphs of constant-b ounded tree-

width can be expressed as the comp osition of graphs with b ounded number

of terminals according to some nite set of rules. More precisely, there exists



a set of op erators R U [w +1; 2] such that R = . While tree decom-

w

p ositions and parse trees are essentially equivalent concepts, the latter seem

more convenient from a computational p oint of view.

2.1 The decomp osition algorithm

We shall say that a decomp osition G = 'G ;:::;G  with resp ect to R

1 r

is -balanced if jV G j  jV Gj, for some constant  that dep ends only

i

on R. A parse tree T of an n-vertex graph G is said to be -balanced if

for every internal no de v of T with children v ;:::;v , the decomp osition

1 r

G =  v G ;:::;G  is -balanced. The height of an -balanced parse

v v v

r

1

0

tree T is clearly O log n. It is known that there exists a subset R U[4w +

0

4; 5] such that every G 2 has a O log n-height parse tree over R see

w

[Lag90, FeSl94]; a similar result was indep endently proved by Frederickson 5

[Fre93].

Supp ose wehave a pro cedure Decompose, whose details will b e supplied

shortly, which obtains a 7=8-balanced decomp osition with resp ect to U [5w +

5; 3] of any5w + 5-terminal graph of tree-width w . To obtain a 7/8-balanced

parse tree T of G,we do as follows: If jV Gj 5w +5, G is a primitive graph

whose parse tree consists of a single no de; otherwise, apply Decompose to G

to obtain a 7=8-balanced decomp osition G = 'G ;:::;G , lab el the ro ot of

1 r

T with ', and recurse on the G 's. We will argue that, at the exp ense of a one-

i

time-only linear-time prepro cessing step, Decompose can be implemented

to run in O log n time. Thus, the total work required to construct the

decomp osition, aside from prepro cessing, will b e describ ed by the recurrence

P P

q q

T n  T n +b log n, for some constant b, where 1  q  3, n =

i i

i=1 i=1

n and n  7n=8. It can readily b e shown that T n=O n; hence, the total

i

time for building the parse tree will be linear.

2.2 Implementation of Decompose

Decompose is closely patterned after a pro cedure that Lagergren [Lag90]

used to construct tree decomp ositions of graphs. Like Lagergren's metho d

and like a similar algorithm by Reed [Ree92 ], it relies on the familiar notion

of a separator. Let A; B ; S V G. Set S separates A and B if every path

from A to B go es through S . Given a subset Q V G and a real number ,

S V G is said to b e an -Q-separator if there exists a partition A ;A ;S

1 2

of V G such that S separates A and B and jA \ Qj  jQj, i = 1; 2. If

i

Q = V G, S will be referred to simply as an -separator.

Pro cedure Decompose requires that the input graph G be a 5w + 5-

terminal graph of tree-width at most w . In what follows, termsG will

denote the sequence of terminal vertices of G,as well as the unordered set

of terminal vertices. In the description of Decompose, we assume that we

are in p ossession of pro cedures that can compute 7/8-separators of size at

most w + 1 and 2/3-Q-separators of size at most w + 1; these pro cedures will

be discussed later. The existence of the desired separators is guaranteed by

results of Rob ertson and Seymour [RoSe86].

DecomposeG

Step 1. Find a 7/8-separator S of G and the asso ciated partition A ;A ;S 

1 1 2 1

of V G. For i =1; 2, let G = G[A [ S ] and let termsG  consist of

i i 1 i 6

S [ termsG \ A , in any order. Assume w.l.o.g. that jtermsG j

1 i 1

jtermsG j.

2

Step 2. If jtermsG j  5w +5, return the decomp osition G = 'G ;G ,

1 1 2

for the appropriate ' 2U[5w +5; 3].

Step 3. If jtermsG j > 5w +5, nd a 2/3-Q-separator S of G , where

1 2 1

Q = termsG , and the asso ciated partition B ;B ;S ofV G . For

1 1 2 2 1

i =1; 2, let H = G[B [ S ] and let termsH  consist of S [ termsG \

i i 2 i 2 1

B , in any order. Return the decomp osition G = 'H ;H ;G , for

i 1 2 2

the appropriate ' 2U[5w +5; 3].

To verify the correctness of Decompose, it is sucient to prove that

in b oth step 2 and step 3, the graphs into which G is decomp osed have

at most 5w +5 terminals. This is trivially true for step 2. Now examine

the decomp osition returned in step 3. For i = 1; 2, jtermsH j  jS j +

i 2

2jtermsG j=3. Since termsG jjS j + jtermsG j 6w +6, jtermsH j

1 1 1 i

5w + 5, for i =1; 2. Note also that jtermsG j jtermsGj jtermsG j +

2 1

2jS j;thus, jtermsG j 2w +2.

1 2

The most time-consuming steps of Decompose are the separator com-

putations in Steps 1 and 3. We shall next discuss how to implement these

computations in O log n time, at the exp ense of a one-time-only linear-time

prepro cessing step.

Prepro cessing. Separator computations rely on the maintenance of good

tree decomp ositions for all fragments of the graph, along with some informa-

tion ab out terminal vertices in the form of a data structure that we shall call

a skeleton. A go o d tree decomp osition of a graph G 2 is a decomp osition

w

T; X such that:

C1 T is a ro oted binary tree.

C2 jX j = w + 1 for every i 2 V T .

i

C3 jX \ X j is either w or w + 1 for every i; j  2 E T .

i j

C4 For every internal no de i 2 V T , i has at least one child j such that

X 6= X .

i j 7 X i

X i X X i j4 X X X X j1 j j3 j4 2 X X i j3

X X j

j1 2

Figure 1: Making a tree decomp osition binary.

The prepro cessing phase starts with the construction of a good decom-

p osition for the input graph G. This can be done in linear time as follows.

First, use Bo dlaender's linear-time algorithm [Bo d93] to obtain a tree de-

comp osition of width w of G. Without loss of generality, we can assume

that for any two adjacent no des i and j in this decomp osition, X 6 X

i j

and X 6 X if the given tree decomp osition do es not satisfy this condi-

j i

tion, we can transform it into one that do es by rep eatedly contracting edges

i; j  with X X . Pick any no de i with jX j = w +1 as the ro ot. Now

j i i

traverse the tree decomp osition in preorder. When a no de i which will

have jX j = w +1 is visited, consider each child j and do the following.

i

If jX j < w +1, replace X by X [ A, where A is any subset of X X

j j j i j

having cardinality w +1 jX j. After we are done, every no de i of the

j

resulting tree decomp osition will have jX j = w + 1 and for anytwo adjacent

i

no des i and j , jX \ X j  w . The next step of the transformation is to

i j

consider each pair of adjacent no des i and j . If jX \ X j

i j

edge i; j by the path i; i ; i ;i ;:::;i ;j, where k = jX X j. The

1 1 2 k 1 i j

corresp onding sets X ;:::;X are de ned as follows. Let Y = X \ X ,

i i i j

1

k 1

let X X = fa ;:::;a g, and let X X = fb ;:::;b g. Then, for

i j 1 k j i 1 k

r = 1;:::;k 1, X = Y [fb ;:::;b ;a ;:::;a g. In the nal step, the

i 1 r r +1 k

r

resulting tree decomp osition is made binary by applying the transformation

illustrated in Figure 1 to every no de having more than two children. All 8

steps in this pro cedure can be implemented to run in linear time. It is easy

to check that the nal result satis es C1{C4.

Go o d tree decomp ositions will b e represented using Sleator and Tarjan's

dynamic trees with partitioning by size [SlTa83]. Such a representation can

be built in O n time [GoTa91]. Several useful op erations can be done in

logarithmic time on dynamic trees, among them cutting and linking trees

and computing least common ancestors lca's of pairs of no des [SlTa83].

These prop erties will allow us to take a good decomp osition of a graph and

extract eciently from it good tree decomp ositions for fragments resulting

from separations.

A skeleton for the vertices in Q = termsG is a tree T constructed

Q

as follows. Cho ose any mapping f : Q ! V T  such that for all v 2 Q,

v 2 X . Let L denote the range of f . A tree T for L is de ned recursively

f v  L

as follows. If L = ;, T is empty. Otherwise, let r be the lca in T of the

L

no des in L. Let T and T be the subtrees of T ro oted at the children of

1 2

r , and let L = L \ V T , i = 1; 2. Then T has r as its ro ot and as its

i i L

subtrees it has the trees T and T for L and L , resp ectively. Finally,

L L 1 2

1 2

make T = T . See Figure 2. Each vertex i 2 V T  will have a weight

Q L Q

q equal to the number of vertices of Q mapp ed to it by f . Note that, since

i

jQj = O w , jV T j = O w . A skeleton can be computed using O w  lca

Q

queries on T in O w log n time.

Finding vertex separators. We shall show that a 7=8-vertex separator

of G, such as the one required in Step 1 of Decompose, can be obtained

by lo cating a centroid edge in a good tree decomp osition of G. A centroid

edge e in a tree T is an edge such that every subtree in T e has at most

3jV T j=4 vertices | such an edge always exists in a binary tree [CLR90].

We b egin by proving some prop erties of good tree decomp ositions. In what

follows, when no confusion can arise, a tree decomp osition of a graph shall

sometimes be referred to by mentioning only the underlying tree e.g., we

refer to T; X as just T . Given any i 2 V T , we shall write T to denote

i

the subtree of T ro oted at i and shall write G to denote the subgraph of G

i

S

induced by fX : j 2 V T g. Clearly, T is a tree decomp osition of G .

j i i i

Lemma 2.1 Let T; X be a good tree decomposition of G 2 . For any

w

i 2 V T , T is a good tree decomposition of G .

i i 9 1

2 3 2

4 5 4 5

6 7 8 9 61112

10 11 12

T TQ

Figure 2: A tree decomp osition and its skeleton. No des in the range of f are

shaded.

Pro of. Follows from the de nition of go o d tree decomp ositions. 2

Lemma 2.2 Let T; X be a good tree decomposition of G 2 . If n =

w

jV Gj and k = jV T j, then n w  k  2n w  1.

Pro of. Let d b e the numb er of distinct X 's in T . One can showby an easy

j

induction on d that d = n w . It now suces to show that d  k  2d 1.

The rst inequality is trivially true. The second one can b e proved by induc-

tion on k . The base case k = 1 is immediate. Supp ose k>1 and let i b e the

ro ot of T . If i has only one child j , then X 6= X , by C4. By Lemma 2.1,

i j

T is a go o d tree decomp osition of G and it must satisfy k  2d 1, where

j j j j

k = jV T j and d is the number of distinct X 's in T . Since d = d +1

j j j r j j

and k = k +1,we have k  2d 1. Now supp ose i has two children j and

j 1

j . For r =1; 2, let k = jV T j and n = jV G j. Then, k = k + k +1

2 r j r j 1 2

r r

and, by C4, d  d + d . The desired result follows since, by induction

1 2

hyp othesis, k  2d 1 for r =1; 2. 2

r r 10

Lemma 2.3 Let T; X be a good tree decomposition of an n-vertex graph

0 00

G. Suppose e =i; j  is a centroid edge in T , and let T and T be the two

S S

0 0 00

subtrees of T e, with G = G[ fX : l 2 V T g] and G = G[ fX : l 2

l l

00 0 00

V T g]. Then, jV G j; jV G j n=8. Furthermore, S = X \ X separates

i j

0 00

V G  from V G .

Pro of: The fact that S is a separator follows from basic prop erties of tree

decomp ositions see, e.g., [RoSe86].

0 0 0 0 00 00 00

Let k = jV T j, k = jV T j, n = jV G j, k = jV T j, and n =

00 0

jV G j. Assume that i is the parentofj in T and that T contains j . Then,

0 0

by Lemma 2.1, T is a good tree decomp osition of G and, therefore, by

0 0 0

Lemma 2.2, n w  k  2n w  1. Using Lemma 2.2 and the fact that

0

e is a centroid edge, we get the following relation for T :

0 0

n w =4  k=4  k  2n w  1:

0 00

It follows that n  n=8. The pro of that n  n=8 is similar, and relies on

00 00 00 00

the fact that n w  k  2n w , which holds b ecause T is a go o d tree

00

decomp osition of G , except for the p ossibility that it might violate C4 at

i i.e., X might equal X , where l is the sibling of j . We leave the details

i l

to the reader. 2

Go o drich and Tamassia have proved that a dynamic tree representation

allows one to lo cate a centroid edge in a binary tree in O log n time [GoTa91].

In combination with Lemma 2.3, this yields a O log n algorithm to nd a

7=8-separator in G. This do es not, however, complete the description of the

vertex separator pro cedure, since we still need to obtain go o d decomp ositions

and skeletons for the fragments. Let us use the notation of Lemma 2.3. As

0 0

argued in the pro of of that lemma, T is a good decomp osition of G ; to

0

extract T we simply cut it from T , which takes O log n time on dynamic

00

trees. On the other hand, T mayormay not be good. If it is, nothing b eyond

cutting it from T will b e needed. If it isn't, the only p ossible violation is that

00

no de i has only one child l and X = X . We can convert T into a good

i l

tree decomp osition by contracting the edge i; l . This can be achieved in

O log n time by O 1 cut and link op erations.

0 00

Skeletons for G and G can also b e obtained in logarithmic time. We limit

0 00

ourselves to describing the algorithm for G , as the one for G is analogous. 11

0 0 0 0

Observe that termsG  = Q [ N , where Q = Q \ V G  and N = X \

i

0

X  termsGN consists of the new terminal vertices of G created by the

j

separation. Recall that the skeleton for G is based on a function f mapping

vertices in termsG to vertices of T ; we shall establish a similar mapping

0 0 0 0 0

f : termsG  ! V T  as follows. Let P be the vertices of Q that are

0 0 0

mapp ed to no des in T by f . For every m 2 P , make f m = f m. By

0 0

de nition of tree decomp ositions, every vertex of Q P must b e present in

0 0 0

X ;thus, we make f m=j for all m 2 Q P . Every m 2 N is contained

j

0 0

in X ; thus, for any such m, we make f m=j . After f is established, we

j

0 0

compute askeleton for G in O w log n time with O w  lca queries on T .

Finding set separators. A Q-separator in G is lo cated by nding a cen-

troid vertex c in the skeleton T ; i.e., a vertex c whose removal leaves no

Q

P

subtree having total weight exceeding  q =2 suchavertex can eas-

i

i2V T 

Q

ily be shown to exist in any no de-weighted tree. We rely on the following

result.

Lemma 2.4 Let G 2 , let Q = termsG , and let T beagoodtree decom-

w

position of G. Then, if T is a skeleton of G and c is a centroid of T , X

Q Q c

is a 2=3-Q-separator of G.

Pro of. Let R , R , R be the comp onents of T c, and let S , S , S be

1 2 3 Q 1 2 3

the comp onents of T c we assume for simplicity that each of T c and

Q

T c have exactly three comp onents | there may actually b e fewer, but this

is easily handled. By the de nition of T , for l =1; 2; 3, there exists some

Q

0

0

m such that V R  V S , and V R  \ V S = ; for m 6= m. W.l.o.g.,

l m l m

assume that V R  V S .

l l

S

fX : r 2 V S gX . Then, B ;B ;B ;X  For l =1; 2; 3, let B =

r l c 1 2 3 c l

is a partition of V G such that X separates every pair of distinct B 's. We

c l

will show that jB \ QjQ=2. Let W b e the weightofR . Then, W equals

l l l l

the number of vertices v 2 Q such that f v  2 V S , where f is the mapping

l

asso ciated with T . By the de nition of tree-decomp ositions, if v 2 Q \ X ,

Q r

r 2 V S , but f v  2 V S , m 6= l , then v 2 X . Therefore, jB \ Qj W .

l m c l l

P

Since c is a centroid no de and fq : i 2 V T g = jQj,

i Q

jB \ QjW jQj=2:

l l 12

Assume w.l.o.g. that B is the largest B . Let A = B and A = B [ B .

1 l 1 1 2 2 3

One can easily show that A ;A ;X  is a partition of V G such that X

1 2 c c

separates A and A and jA \ Qj 2jQj=3. The lemma follows. 2

1 2 l

The vertex c of Lemma 2.4 can b e found in O w , as this is the size of T .

Q

It will be necessary to identify the two graphs resulting from the separation

and to construct good tree decomp ositions and skeletons for each. Let us

follow the notation used in Lemma 2.4. The two graphs that concern us

are given by G = G[A [ X ], l = 1; 2. Clearly, tree decomp ositions for

l l c

G and G will be given by the subtrees of T induced by V S  [fcg and

1 2 1

V S  [ V S  [fcg. These decomp ositions may or may not be good; if

2 3

they aren't, they can be repaired in O log n time with O 1 cut and link

op erations in a manner similar to that for vertex separators. Skeletons for

G and G can also be built in logarithmic time. The details are similar to

1 2

those for vertex separators and are therefore omitted.

2.3 Identifying levels in a parse tree

Let T be a 7/8-balanced parse tree of an n-vertex graph G 2 and let

w

r < r <  < r be a sequence of numb ers where r = w and r = n.

0 2 k 0 k

We shall use these numb ers to identify k + 1 subsets of V T having certain

sp ecial prop erties. To do so, we rely on a pro cedure Mark-Tree that takes

as inputs the ro ot v of a balanced parse tree T and a number r  jV Gj.

Mark-Tree is straightforward: If jV G j  r , it marks v . Otherwise,

v

Mark-Tree is applied recursively to each child u of v .

Lemma 2.5 Let L be the set of nodes in T markedby Mark-Tree. Then,

i jLj =n=r , ii for every u; v 2 L, u 6= v , V T  \ V T =;, and iii

u v

every leaf of T is a leaf of T , for some u 2 L. Moreover, assuming jV G j

u u

is known for every node u in the tree, Mark-Tree takes O n=r  time.

Pro of. Prop erties ii and iii follow directly from the description of Mark-

Tree. The pro of of prop erty i relies on a straightforward argument based

on the fact that T is balanced. We omit the details.

The time b ound follows from the fact that Mark-Tree traverses O n=r 

no des of T and pro cessing each no de takes O 1 time. 2 13 Lk

v Lj

Tv'

Lj -1

L0

Figure 3: Dividing a parse tree into levels.

The pro cedure to identify levels is as follows. Declare the ro ot v of T to

be a level k no de. Now, for j = k; k 1;:::;2, do the following. For each

level j no de u, apply Mark-Treeu; r  and declare the newly marked

j 1

no des to be level j 1 no des. Finally, declare the leaves of T to be level 0

no des. See Figure 3. For j =0;:::;k, let L denote the set of level j no des.

j

We shall say that a no de v 2 T lies ab ove level j ,0 j  k ,ifv is a prop er

ancestor of some level j no de. Lemma 2.5 and the fact that one can compute

jV G j for every u 2 V T  in O n time imply that identifying L ;:::;L

u 0 k

takes O n time. The following lemma states prop erties of levels that will b e

used later. 14

Lemma 2.6 For 0  j  k , jL j = n=r . Moreover, let v be a level j

j j

0

node, 0 < j  k and let T be the subtree of T containing al l nodes at or

v

v

0

above level j 1 see Figure 3. Then T has O r =r  nodes and height

j j 1

v

O logr =r .

j j 1

Pro of. The b ound on jL j follows from Lemma 2.5. This lemma also im-

j

plies that T has O r =r  level j 1 no des, from which we can conclude

v j j 1

0 0

that jV T j = O r =r . The height b ound on T follows from the fact

j j 1

v v

that T is 7=8-balanced. 2

3 The Non-Parametric Algorithm

In the rst part of this section, we summarize the well-known linear-time

dynamic programming algorithm for nding the weight of the optimum sub-

graph satisfying a regular prop erty in a graph of b ounded tree-width. From



the p oint of view of the search for  , it will be useful to view this algo-

rithm's computation as if it were hard-wired in the form of a circuit. It will

also be useful to organize the evaluation of this circuit using levels. The

circuit approach and the use of levels are discussed in the last two parts of

this section.

3.1 Regular prop erties and dynamic programming

We caution the reader that what follows is not a rigorous treatment of regular

graph prop erties. Our fo cus is limited to only those characteristics of the

metho d that are essential to understanding the parametric algorithm. Full

discussions of regularity can be found elsewhere [ALS91, BPT92, BLW87,

FeSl94].

Let R b e a set of comp osition op erators; we shall b e primarily interested



in sets R such that R = , for some w . A graph-subgraph pair is a pair

w

G; H  where G is a graph and H is a subgraph of G; the cost of G; H 

is the sum of the weights of the vertices and edges in H . The comp osition

op erators of R are extended to graph-subgraph pairs in the natural way:

the underlying graphs are comp osed and the subgraphs are unioned mo d-

ulo vertex identi cation [BLW87]. A predicate P on graph-subgraph pairs

is regular with resp ect to a set R of comp osition op erators if it induces a 15



partition of the set of graph-subgraph pairs G; H  with G 2R into a nite

number of equivalence classes such that the following prop erties hold.

1. For any class C and anytwo pairs D ;D 2 C , D and D either b oth

1 2 1 2

satisfy or b oth fail to satisfy the predicate P . Classes where every pair

satis es P are called accepting.

2. The comp osition op erators on pairs resp ect equivalence classes. That

is, the equivalence class containing the comp osition of pairs D ;:::;D

1 l

dep ends only on the comp osition op erator and on the equivalence classes

containing the pairs.

By 2, for each comp osition op erator ' there is a nite set of rules that

express the p ossible equivalence classes in which the comp osition of graph-

subgraph pairs may fall, dep ending on the classes from which these pairs

originate. These rules can be put in tables that are xed for each op erator

and each problem.



Let G 2 R , let T be a b ounded-degree linear-size parse tree of G, and

let v 2 V T . Let C = fC ;:::;C g be the set of equivalence classes with

1 N

i

resp ect to some regular prop erty P . For i =1;:::;N,we write z to denote

v

the value of the optimum pair G ;H 2 C . To compute z , the cost of the

v i G

optimum solution, pro cess the no des of T from the b ottom up, computing

i

z for every v 2 V T  and every class C . If v is a leaf, and hence G is a

i v

v

i

primitive graph, then compute all the z 's by exhaustiveenumeration. This

v

takes constant time, since there are only a constantnumb er of pairs G ;H

v

in each class. Otherwise, for each equivalence class C ,wehave tables giving

i

a nite number of ways in which a pair G ;H 2 C can be expressed as

v i

0

a combination of pairs of the form G ;H  2 C where u is a child of v .

u k

k 

If we know the z 's, we can combine this information in constant time via

u

i

additions and comparisons to obtain z [BLW87, BPT92]. After every no de

v

in the parse tree has b een pro cessed, we can compute the cost z of the

G

optimum solution in O 1 time by using

n o

i

z = min f+1g [ fz : C is an accepting class g : 1

G i

G

Thus, we have a linear-time algorithm to evaluate z .

G 16

3.2 A circuit for computing z

G

A combinational circuit is a directed acyclic graph whose no des are combi-

national elements, and where an edge from element w to element w implies

1 2

that the output of w is an input to w ; the size of a circuit is its number

1 2

of elements. Elements of zero fan-in are inputs; elements of zero fan-out are

outputs. Combinational elements are computational units that can p erform

certain well-de ned op erations, for instance additions and subtractions. The

depth of element w is the length of the longest path from an input elementto

w ; the depth of a circuit is the maximum depth of an element in the circuit.

A combinational circuit D for evaluating z can be built by applying

G

lo cal transformations to T as follows. To each comp osition op erator ' 2R

we asso ciate an O 1-size circuit CT' consisting only of adders and min

gates. If ' is a primitive graph, the inputs to CT' corresp ond to the

vertex and edge weights of that graph. Its outputs will be the costs of the

optimum solutions for each of the N equivalence classes. Otherwise CT'

will have with Nk inputs and N outputs, where k is the arity of '. Inputs

corresp ond to optimum solutions for the various equivalence classes of the

comp osing graphs, and the outputs corresp ond the optimum solutions for

the equivalence classes of the resulting graph. The structure of CT' is

thus completely determined by the table asso ciated with op erator '. Every

no de v of T that is lab eled by ' will be replaced by a copy of CT'. If

u ;:::;u are the children of v in T , the inputs to this copyofCT' are the

1 k

i

z 's which are the outputs of the circuits asso ciated with u ;:::;u  and

1 k

u

j

i

the outputs are the z 's. The result of applying this lo cal replacement to

v

the no des of T is a circuit whose inputs are the vertex and edge weights and

i

whose outputs are the z 's for the ro ot v of T . Equation 1 implies that

v

i

the value of z can b e obtained by connecting the appropriate z 's to a min

G

v

gate. The size of the resulting circuit D will b e O n, since T is a linear-size

parse tree of G. More details of the construction can be found elsewhere

[FeSl94, page 425]. To determine the output of D , we pro cess its elements

in top ological order; thus, when it is no de w 's turn to be pro cessed, all its

inputs will b e known, and its output can b e computed in O 1 time. Hence,

the circuit-based algorithm runs in linear time. 17

3.3 Using the levels

Assume that we have a balanced parse tree T of G, in which, as describ ed

in Section 2.3, levels have b een identi ed according to some sequence of

numb ers r ;:::;r . We shall use the levels to divide the computation of z

0 k G

i

into phases, where each phase determines the z 's for all no des between

v

two consecutive levels. The resulting algorithm will still run in linear time;

however, its structure will be more useful in the context of the \lift and

narrow" parametric search scheme develop ed in Section 4.

We will describ e the algorithm in terms of the combinational circuit D

asso ciated with T . By construction, every element w of D is asso ciated with

some no de v of T , namely w is one of the elements of the O 1-size circuit

CT asso ciated with the no de v . In fact, w will b e asso ciated with two no des

of T if it is an input element for the circuit asso ciated with v and an output

element for the circuit asso ciated with a child of v . Let v b e a level j no de,

0

1  j  k , and, as in Lemma 2.6, let T be the subtree of T containing all

v

v

the no des at or ab ove level j 1. Let D be the sub circuit of D induced

v

0

by the elements asso ciated with the internal no des in T , together with the

v

0

output elements of the circuits asso ciated with the leaves of T . Obviously,

v

the size and depth of D are prop ortional to the number of no des and the

v

0

heightofT , resp ectively. Thus, by Lemma 2.5, D has O r =r  elements

v j j 1

v

and depth O logr =r .

j j 1

i

Assuming the z 's are known for all level j 1 no des, we can use these

u

i

functions as inputs to D to determine all the z 's, 1  i  N . We simply

v

v

traverse the elements of D in top ological order, pro cessing them in the usual

v

way; the outputs of the circuit will be the desired values. We shall call this

pro cess evaluating D .

v

A more detailed description of the evaluator algorithm is given b elow.

AG

1. Construct a balanced parse tree T and the asso ciated circuit D for G.

2. Identify the levels in T .

3. for each level 0node v 2 T do

i

4. Determine all z 's by exhaustive enumeration.

v

5. for j =1;:::;k do

6. for each level j no de v do

i

7. Compute the z 's by evaluating D .

v

v 18

n o

i

9. return min f+1g [ fz : C is an accepting class g , where v is

i

v

the ro ot of T .

As discussed in Section 2, a balanced parse tree for G can be found in

linear time. Since the asso ciated circuit D can b e constructed in linear time,

line 1 takes O n time. As argued in Section 2.3, line 2 can be done in

O n time. Lines 3{4 take O n time, since they involve considering O n

primitive i.e., O 1-size graphs. The remaining steps take a total of O n

time, as they require examining each element of D exactly once, at a cost of

O 1 p er element. Thus, the total time taken by A is O n.

4 Parametric Search Problems

We now describ e the linear-time search algorithm. For concreteness and

brevity, we shall only discuss problems whose underlying non-parametric

versions require nding a minimum-weight subgraph; all of our results are

easily transferable to analogous problems involving maximization.

Our search pro cedure is based on Megiddo's parametric search metho d

[Meg79, Meg83]. This technique relies on simulating a non-parametric algo-

rithm for evaluating Z  the function describing the cost of the optimum

G

solution for any xed ; the goal is to determine the computation path



followed by the algorithm at  the value b eing sought. In our case, the

algorithm to be simulated will be pro cedure A of Section 3. Clearly, A can

be used to evaluate Z   for any given  : we simply need to determine

G 0 0

the vertex and edge weights at  and then run A as usual.

0

Before going into further details, we need to establish some terminology

and make some observations. Let d b e a nonnegativeinteger. The term d-th

degreepolynomial will b e used to refer to any p olynomial of degree at most d.

We shall assume a mo del of computation where evaluating and computing the

ro ots of a d-th degree p olynomial are constant-time op erations. A function

f : R ! R is a d-th degree piecewise function d-ppf if it is the

lower or upp er envelop e of some nite set of d-th degree p olynomials in .

Since the cost of every subgraph is a d-th degree p olynomial in , Z is a

G

d-ppf [FeSl94]. Furthermore, if weights are concave, Z will be concave.

G

Let f be a d-ppf and let I =[ ; ]bean interval. We can represent f

L R

within I by storing its breakp oints in a balanced binary search tree. Together 19 f3 f λ 2 3 f4

f4 λ f λ f f1 1 2 4 5

f5 λ λ L f1 2 f3 λ λλ λ λ λ

L 1 2 3 4 R

Figure 4: A d-ppf and its ecient representation.

with each breakp oint, we store the equation of the segmentoff corresp onding

to the interval to its right note that, to do this prop erly, we may have to

intro duce an arti cial breakp oint at  | see Figure 4. We shall call this

L

an ecient representation of f within I . This representation will allow us

to evaluate f  for any  2 I in O log r  time, where r is the number of

breakp oints of f that fall within I .

The simulation of A is done in a sequence of alternating lifting and nar-

rowing stages. During a lifting stage, the search algorithm simulates a p ortion

of A's computation in such a way as to nd all computation paths followed



by the algorithm over an interval I containing  . To do this, the search algo-

rithm carries out the steps of A, manipulating dth degree concave p olynomial

functions of  instead of numb ers. Thus, additions of numb ers b ecome ad-

ditions of d-ppf 's and nding the minimum of two numb ers translates into

taking the lower envelop e of two d-ppf 's [FeSl94, Meg83]. Lifting the compu-

tation of A is, in general, time consuming. The purp ose of a narrowing stage

is to reduce the size of the interval I under consideration, so as to make the

next lifting stage faster. Narrowing will require invoking an oracle B capable



of determining whether or not    ; this op eration will be referred to as

0

resolving  .

0 20

4.1 Oracles and evaluation

There is a close relationship between evaluating Z and resolving -values.

G

We shall argue that, for all problems studied here, resolving a value  reduces

0

in O 1 time to O 1 evaluations of Z .

G



In what follows, I will denote an interval known to contain  . All

invo cations of the oracle will use such an interval, which will be up dated

continually by the search algorithm. Let  2 R b e the value to b e resolved.

0



If  62 I , we can, in O 1 time, determine the p osition of  relative to 

0 0

by comparing it to the endp oints of I . Supp ose that  2I. When weights

0

are linear, oracles for problems P1{P3 can be obtained by using A to

evaluate Z   and then doing some additional O 1-time problem-sp eci c

G 0

work [FeSl94]. For example, for problem P2 which involves nding the

p oint at which Z crosses the -axis, assuming the slop es of all weights are

G

negative a common scenario in minimum-ratio optimization, we will know

 

that  < if Z   > 0; otherwise,    .

0 G 0 0

Evaluating Z is also an essential comp onent of the oracle for P3 when

G

weights are concave d-th degree p olynomials. Because Z is concave, we can

G



conclude that  < if there exists >0 such that Z  +  >Z   and

0 G 0 G 0



that  > if there exists >0 such that Z   >Z  . Otherwise,

0 G 0 G 0



we will have  =  . Thus, three evaluations of Z will b e enough to resolve

0 G

 : one at  itself and two a p oints that are \arbitrarily close" and to the

0 0

left and right of  .

0

We are left with the problem of evaluating Z  +  and Z  . We

G 0 G 0

do this by runnning A using input weights that are functions of . During

the execution of the algorithm,  is treated symb olically as an indeterminate

number assumed to be smaller than any other number that ever app ears

in the computation. Since  is xed and the only arithmetic op erations

0

are additions and subtractions, we shall at all times be manipulating dth

degree p olynomial functions in . To compare two functions f  and g ,

we examine h=f  g  to determine if there exists some  > 0 such

that h > 0 for all  2 0;]. This can be done in O 1 time under our

assumption that ro ots can be computed in O 1 time. Thus, each of A's

op erations can be carried out in O 1 time without explicit knowledge of 

and, hence, Z  +  can b e evaluated within the same time b ound as that

G 0

of A. We should note that a di erent approach for implementing the oracle

for P3 was prop osed by Toledo [Tol93]. 21

4.2 Building sublinear oracles

Supp ose we are given a balanced parse tree T of G in which levels have

b een identi ed, as describ ed in Section 2.3. We will show that, given a cer-

tain amount of precomputation, one can obtain a sequence of algorithms

A ;:::;A for evaluating Z , where, for 0  j  k , A runs in time

0 k G j

O n=r  log r . Given the close relationship between evaluating Z and

j j G

resolving -values see Section 4.1, this sequence of evaluators yields a se-

quence of oracles B ;:::;B , where B has the same asymptotic time b ound

0 k j

as A .

j

Pro cedure A will only b e required to evaluate Z   for  falling within

j G 0 0



a certain interval I containing  . For j =0;:::;k, A assumes that for each

j

level j no de w and each equivalence class i,wehave an ecient representation

i i

of Z within I as b efore, Z  denotes the function describing the cost

w w

of the optimum solution for the ith equivalence class of G . For brevity,

w

i

any such function Z will b e referred to as a level j function. Algorithm A

j

w

takes advantage of the precomputed level j functions to evaluate Z   as

G 0

follows.

A  

j 0

i

  for Step 1. For each level j no de w in the parse tree T of G, nd Z

0

w

i

each equivalence class i by accessing the ecient representation of Z .

w

0

Step 2. Let T denote the subtree of T consisting of all no des lying ab ove level

j

0

j . Traverse T in p ostorder. Whenever a no de u is visited, compute

j

i

Z   for each equivalence class i.

0

u

n o

i

Step 3. Return min f+1g[fZ  :C is an accepting class g , where v

0 i

v

is the ro ot of T .

The correctness of algorithm A can be deduced from the fact that it is

j

an adaptation of the dynamic programming algorithm of Section 3. Access-

i

ing the ecient representation of each level j function Z in step 1 takes

w

time logarithmic in the number of breakp oints of that function. Results

from an earlier pap er [FeSl94] imply that this number is p olynomial in r ,

j

where the degree of the p olynomial dep ends only on the regular problem

in question see also Lemma 4.1 b elow. Thus, the search time is O log r 

j 22

per function. Since, by Lemma 2.6, there are O n=r  level j functions to

j

evaluate a constant number per level j no de, the total time sp ent in step

0

1isO n=r  log r . By Lemma 2.6, the number of vertices in the tree T of

j j

j

step 2 is O n=r , and the time sp ent on each no de is constant. Thus, step 2

j

takes O n=r  time. Since step 3 takes O 1 time, A takes O n=r  log r 

j j j j

time.

Building ecient representations of the level j functions as required by A

j

can b e time-consuming if the interval I over which they must b e constructed

is large. The next lemma gives a condition under which the construction can

be done rapidly.

Lemma 4.1 Suppose j 2f1;:::;kg and let I be an interval within which the

total number of breakpoints of the level j 1 functions is O n=r . Then there

j

exists a constant , which depends only on the underlying regular problem,

such that the total number of breakpoints of the level j functions within I is

1

. Furthermore, given ecient representations of the level j 1 =r O nr

j 1 j

functions within I , we can construct ecient representations of al l level j

+1

functions within I in O nr =r  time.

j j 1

To prove this fact, we need two lemmas, the rst of which was given in

[FeSl94]. Let us write b f  to denote the number of breakp oints of a d-ppf

I

f within an interval I .

Lemma 4.2 Let f ;:::;f be d-ppf 's. Then

1 m

P P

m m

i b  f   b f , and

I j I j

j =1 j =1

P

m

ii b min f   sm; d b f +1 1,

I 1j m j I j

j =1

2

where sm; d= dm m=2+1.

The ab ove result was actually proved for the case where I =1; +1,

but essentially the same argument carries through for more restricted inter-

vals.

We use Lemma 4.2 to prove a result regarding parametric combinational

circuits; i.e., circuits such as the lifted version of D see Section 3 that

manipulate d-ppf 's instead of numb ers. The output of any element w in a

parametric circuit will be a function of  that we shall denote by f .

w 23

Lemma 4.3 Let D be a parametric combinational circuit whose elements

perform one of the fol lowing functions: i addition of two d-ppf 's, ii com-

puting the lower envelope of two d-ppf 's, iii multiplying a d-ppf by a con-

stant, iv subtracting a polynomial of degree d from a d-ppf. If al l inputs

to D are dth degree over some interval I and w is an element

k

at depth k in D , then b f  = O c , for some c that depends only on d.

I w

Moreover the outputs of al l elements within interval I can be computed in

D

O Mc  time, where M and D are the number of elements and the depth of

D , respectively.

k

Pro of. We prove that b f   c by induction on k . The base case k =0

I w

is trivial. Now consider any element w at depth k>0. Supp ose w is of typ e

i or ii and let the edges into w be u ;w and u ;w. Then, the depth

1 2

k 1

of u ;u is at most k 1, and, byhyp othesis, b f =O c , for i =1; 2.

1 2 I u

i

k 1

Using Lemma 4.2 with m = 2, we obtain b f   2d +1c + d, which

I w

k

is at most c if we cho ose c large enough. Elements of typ e iii or iv can

readily be shown to satisfy the claim, since neither multiplying a d-ppf by

constant nor subtracting a d-th degree p olynomial from a d-ppf a ect the

number of breakp oints of the d-ppf.

One can compute f for all w 2Dby pro cessing the elements in top ologi-

w

cal order. If d is xed, the output of each element can b e found in time linear

D

in the total number of breakp oints of its input functions, i.e., in O c  time

D

p er element. Thus all output functions can b e computed in O Mc  time. 2

Pro of of Lemma 4.1. The set of all breakp oints of level j 1 functions

0

sub divides I into several subintervals. Consider any such subinterval I of

I and let v be a level j no de. We will prove the lemma by showing that

i

there exists a constant such that, for each equivalence class i, Z has

v

0

O r =r   breakp oints within I , and that an ecient representation of

j j 1

i 0 +1

Z within I can be computed in O r =r   time. The result follows

j j 1

v

by adding up the contributions of all the level j functions over all O n=r 

j

subintervals of I .

0

Within I ,any level j 1 function is a p olynomial of degree d. Assuming

these functions are known, they can be used as inputs to a lifted version of

i

the circuit D of Section 3. The outputs of D will be the Z 's. As ob-

v v

v 24

served in Section 3, D has O r =r  elements and depth O logr =r .

v j j 1 j j 1

i

Thus, by Lemma 4.3, there exists a constant c such that every Z has

v

logr =r  0

j j 1

O c  breakp oints within I and all such functions can b e computed

log r =r  i

j j 1

in O r =r c  time. Thus Z has O r =r   breakp oints

j j 1 j j 1

v

0 +1

within I and can b e constructed in O r =r   time, where is a con-

j j 1

stant that dep ends only on c. 2

4.3 The search algorithm



We are now ready to discuss how to nd  . The search algorithm simulates

the level-by-level dynamic programming algorithm A of Section 3, maintain-



ing along the way an interval I containing  . The idea is to keep track of

al l computation paths followed by A over I . At the end of the simulation,

we will have a complete description of Z over this interval; the problem

G

will then be solved by doing a direct search on Z . Naturally, the number

G

of computation paths over a given interval can be very large, so we must

simultaneously nd away to narrow I . A basic to ol for this is the following

pro cedure.



NarrowI ;P;s;B : Given an interval I where  2 I , a list of p oints

0

P I , a number s, and an oracle B , return an interval I I such



0 0

that  2I and jP \I j s.

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

Cho ose a median elementofP and apply B to it; dep ending on the outcome of

the call, either resolve all elements of P larger than the median or all elements

smaller than the median. In either case, at least half of the elements in P 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 fewer than s p oints of P .

Lemma 4.4 NarrowI ;P;s;B  runs in O jP j + t  logjP j=s time, where

B

t is the running time of B .

B

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

q

least half, after q calls, the number of p oints will be at most jP j=2 . Hence, 25

q = log jP j=s calls suce to narrow I by the desired amount. The total

time is therefore O jP j + t  log jP j=s, where the O jP j term accounts

B

for the total overhead incurred in computing medians and the second term

accounts for the total time sp ent by the oracle calls. 2

The search algorithm, which shall be named algorithm C , is given be-

low. Pro cedures A ;:::;A and B ;:::;B are the evaluators and oracles

0 k 0 k

describ ed in Section 4.2.

C G

1. Construct a balanced parse tree T and the asso ciated circuit D for G.

2. Identify the levels in T .

3. I  1; +1.

4. for each level-0 no de v 2 T do

i

5. Construct ecient representations of all Z 's within I by

v

evaluating the circuit asso ciated with v .

6. Construct evaluator A and oracle B .

0 0

7. for j =1;:::;k do

8. Let P be the list of breakp oints of all level j 1 functions within I .

9. I  NarrowI ;P;n=r ; B 

j j 1

10. for each level-j no de v do

i

11. Construct ecient representations of all Z 's within I by

v

determining the outputs of D over all  2I.

v

12. Construct evaluator A and oracle B .

j j



13. Construct a complete description of Z within I and lo cate 

G

Assume that each oracle in the sequence B ;:::;B is correct. Then, the

0 k



prop erties of Narrow guarantee that at all times interval I will contain  ;

the correctness of C follows. As discussed in Section 4.2, all that we need

to implement A and B are ecient representations of the level j functions.

j j

For j = 0, these representations are obtained in lines 4{5, while for j > 0,

they are obtained in lines 10{11.

Lines 1 and 2ofC take O n time see Section 2. It takes O n time to

carry out lines 4{5, since there are O n level 0 functions, each of which can

be constructed in O 1 via exhaustive enumeration, b ecause it corresp onds

to a primitive graph i.e., a graph of constant-b ounded size

Let us refer to the lo op b eginning at line 7 of C as the main loop, and let

r =1, The following fact will be used to analyze the running time of C .

1 26

Lemma 4.5 At the beginning of iteration j  1 of the main loop, the set P

1

of breakpoints of the level j 1 functions within I has size O nr =r ,

j 1 j 2

where is the constant of Lemma 4.1.

Pro of. The claim holds for the rst iteration, since each level 0 function

has O 1 breakp oints and r =1. Assume the claim holds at the b eginning

0

of iteration j , 1  j  k . Then, Narrow will reduce I to an interval con-

taining at most n=r breakp oints of level j 1 functions. By Lemma 4.1, this

j

+1

 breakp oints of level j functions. Thus, =r same interval contains O nr

j 1 j

the claim holds at the b eginning of iteration j +1 as well. 2

The previous lemma, the fact that B runs in O n=r  log r  time,

j 1 j 1 j 1

and Lemma 4.4 together imply that Narrow takes

0 1

1

nr

n log r log r

j 1 j

j 1

@ A

O : +

r

r

j 1

j 2

time. After Narrow is applied, I will contain O n=r  breakp oints of level

j

+1

 =r j 1 functions. Thus, we can use Lemma 4.1 to construct in O nr

j 1 j

time the ecient representations of all level j functions within I required by

A and B . Hence, iteration j of the main lo op of C takes time

j j

1 0

1

nr nr

n log r log r

j 1 j

j j 1

A @

: 2 O + +

+1

r

r r

j 1

j 1 j 2

When the execution of C reaches step 13, we will have ecient representa-

i

tions of all the Z 's for the ro ot v of T , within interval I . Moreover, the pro of

v

1

of Lemma 4.5 implies that each of these functions has O nr =r  break-

k k 1

i

p oints within I . Z is the lower envelop e of the Z 's asso ciated with ac-

G

v

cepting classes. Since the numb er of equivalence classes is constant-b ounded,

+1

Lemma 4.2 implies that Z has O nr =r  breakp oints. Thus, a complete

G

k k 1

1

description of Z within I can b e obtained in O nr =r  time. The total

G

k k 1

time taken by C is therefore

0 0 11

1

k

X

r r

log r log r

j 1 j

j j 1

@ @ AA

O n : + +

+1

r

r r

j +1

j =1

j 1 j 2 27

Now, supp ose r = c and that, for j =1;:::;k 1, r =r = c, for some

1 j +1 j

j

constant c>1. Then, r = c and the total for iterations 1 through k is

j

11 0 0

k k

X X

j 1j 1

1

AA @ @

; + O n c

j 1 j +1

c c

j =1 j =1

which is clearly O n, indep endent of the number of terms, b ecause c and

are constants. We thus have our main result.

Theorem 4.6 Let w  1 and let P beapredicate that is regular with respect



to some set of composition operators R such that = R . Then, given

w

any weighted n-vertex graph G 2 , problems P1, P2, and P3 can be

w

solved in O n time.

5 Discussion and Further Results

The results of the previous section can b e used to obtain approximate para-

metric search algorithms for planar graphs. We shall rely on an idea by

Baker [Bak83], who develop ed ascheme whereby several NP-hard optimiza-

tion problems | including maximum indep endent set, partition into trian-

gles, minimum dominating set, minimum edge dominating set, and minimum

vertex cover | can be solved approximately on planar graphs. In the case

of maximization problems, for each xed k , her approach computes in linear

time a solution that is at least k=k + 1 times optimal or, in the case of min-

imization problems, at most k +1=k times optimal. Here we shall discuss

how Baker's scheme can be extended to do approximate parametric search

on planar graphs. We note that approximate parametric search algorithms

have b een discussed earlier by Toledo [Tol93].

For concreteness, like Baker [Bak83], we use the maximum indep endent

set problem to illustrate the technique. We assume that vertex weights are

convex d-th degree p olynomial functions; Z  will describ e the cost of the

G

maximum-weight indep endent set in G. The problem to be considered is to

 

nd  such that Z   = min Z . Similar results can be obtained

G G



regarding maximization of Z in minimum-weight subgraph problems. We

G

start by outlining Baker's approach as it is used in the non-parametric setting.

The rst step of the algorithm is to decomp ose the planar input graph G

into k -outerplanar graphs. A graph G is k -outerplanar if 28

 it is outerplanar, in which case it is said to b e 1-outerplanar, or

 it is planar and it has a planar emb edding such that if all vertices on

the exterior face are deleted, then the connected comp onents of the

remaining graph are all k 1-outerplanar.

It was shown by Bo dlaender [Bo d88] that k -outerplanar graphs have treewidth

at most 3k 1. For any given k , we can obtain k +1 k -outerplanar graphs

from G; the r -th of these, 0  r  k , is denoted G and is constructed by

r

removing from G every vertex with layer numb er congruenttor mo d k + 1.

To nd an approximate solution to the maximum indep endent set problem

on G, we rst solve the problem optimally on each of the G 's which takes

r

linear time, since the graphs have b ounded tree-width and then, from among

the answers obtained, we return the largest solution.

The algorithm is easily lifted to the parametric setting. The functions

Z describing the optimum solutions to each subproblem have p olynomially-

G

r

many breakp oints, since the G 's have b ounded tree-width and indep endent

r

set is a regular prop erty. The function F describing the solution returned

G

by the algorithm as a function of  is the upp er envelop e of the k +1 Z 's.

G

r

Thus, for each xed k , F has p olynomially-many breakp oints. Searching

G

for the maximum of F will require k searches in the Z 's. Since k is xed,

G G

r

our earlier results imply that the search will take O n time. Furthermore,



max F will be at least k=k +1 times Z  .

G G



Our results can also b e used for multiparameter problems using the tech-

niques of [CoMe93, AgFe92]. These metho ds rely on solutions constructed

recursively for optimization problems in one lower dimension, with the re-

cursion b ottoming out when the dimension drops to zero. We can use our

algorithm by changing the base case to be dimension one. This will result

d d1

in an improvement from O n log n to O n log n in the running time,

where d is the number of parameters | we refer the reader to [AgFe92] for

details. It is an op en problem, however, whether our approach can lead to

linear-time algorithms for problems with two or more parameters.

References

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

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

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

[ALS91] S. Arnb org, J. Lagergren, and D. Seese. Easy problems for tree-

decomp osable graphs. J. Algorithms, 12:308{340.

[Bak83] B.S. Baker. Approximation algorithms for NP-complete problems on pla-

nar graphs. In Proceedings of 24th Annual Symposium on Foundations of

Computer Science, pp. 265{273, 1983.

[BLW87] M.W. Bern, E.L. Lawler, and A.L. Wong. Linear time computation of

optimal subgraphs of decomp osable graphs. J. Algorithms, 8:216{235, 1987.

[BPT92] R.B. Borie, R.G. Parker, and C.A. Tovey. Automatic generation of

linear-time algorithms from predicate-calculus descriptions of problems on

recursively-constructed graph families. Algorithmica, 7:555{582, 1992.

[Bo d88] H.L. Bo dlaender. Some classes of graphs with b ounded tree-width. Bul-

letin of the EATCS, 36 1988, 116-126.

[Bo d93] H.L. Bo dlaender. A linear time algorithm for nding tree-decomp ositions

of small tree-width. In Proceedings of the 25th Annual ACM Symposium on

Theory of Computing, pp. 226{233, 1993.

[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 , pp. 120{129 1992.

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

rithms. MIT Press, Cambridge, Mass., 1990.

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

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

74{87, 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.

[FeSl89] D. Fern andez-Baca and G. Slutzki. Solving parametric problems on trees.

J. Algorithms, 10:381{402 1989.

[FeSl94] D. Fern andez-Baca and G. Slutzki. Parametric problems on graphs of

b ounded tree-width. J. Algorithms, 16:408{430 1994. 30

[FeSl94a] D. Fern andez-Baca and G. Slutzki. Linear-time algorithms for paramet-

ric problems on planar graphs. In preparation.

[Fis81] M. L. Fisher. The Lagrangian relaxation metho d for solving integer pro-

gramming problems. Management Science 271:1{18, 1981.

[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.

[Fre93] G.N. Frederickson. Maintaining regular prop erties in k -terminal graphs.

Manuscript, 1993.

[GoTa91] M.T. Go o drich and R. Tamassia. Dynamic trees and dynamic p oint lo ca-

tion. In Proceedings of the 23rdAnnual Symposium on Theory of Computing,

1991, pp. 523{533.

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

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

[Lag90] J. Lagergren. Ecient parallel algorithms for tree-decomp osition and re-

lated problems. In Proceedings of 31st Annual Symposium on Foundations of

Computer Science, pp. 173{182 1990.

[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.

[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.

[Ree92] B. Reed. Finding approximate separators and computing tree-width

quickly. Pro ceedings of 24th Annual Symposium on Theory of Computing,

pp. 221{228, 1992.

[RoSe86] N. Rob ertson and P.D. Seymour. Graph minors I I: Algorithmic asp ects

of tree-width. J. Algorithms, 7:309{322, 1986.

[vLe90] J. van Leeuwen. Graph Algorithms. In J. van Leeuwen ed. Handbook of

Theoretical Computer Science, MIT Press, Cambridge, Mass., 1990. 31

[SlTa83] D.D. Sleator and R.E. Tarjan. A data structure for dynamic trees. Journal

of Computer and System Sciences, 26:362{391 1983.

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

In Complexity in Numerical Computations, P.M. Pardalos, ed., pp. 429{446.

World Scienti c Press 1993.

[Tol93] S. Toledo. Approximate parametric searching. Manuscript, 1993.

[Wim87] T.V. Wimer. Linear algorithms on k -terminal graphs. Ph.D. Thesis, Re-

p ort No. URI-030, Clemson University 1987. 32