<<

A Contraction Pro cedure for Planar Directed Graphs

y

Stephen Guattery Gary L Miller

Scho ol of Computer Science

Carnegie Mellon University

Pittsburgh PA

lem Many graph algorithms either implicitly or explic Abstract

itly solve this problem For sequential algorithm design

We show that testing in a planar DAG

the two classic paradigms for solving this problem are



can b e p erformed in parallel in O log n log n time

BFS and DFS They only require time at most prop or

O log n time using randomization using O n pro

tional to the size of the graph Parallel p olylogarithmic

cessors In general we give a paradigm for contracting

time algorithms for the problem now use approximately

a planar DAG to a p oint and then expanding it back

O M n pro cessors where M n is the numb er of pro

This paradigm is develop ed from a prop erty of planar di

cessors needed to multiply two n n matrices together

rected graphs we refer to as the Poincare index formula

in parallel Ullman and Yannakakis give a probabilis

p

Using this new paradigm we then overlay our appli

tic algorithm which that works in O n time using n

cation in a fashion similar to parallel contraction

pro cessors for sparse graphs UY This blowup in

MR MR We also discuss some of the changes

the amount of work for parallel algorithms makes work

needed to extend the reduction pro cedure to work for

with general directed graphs on negrain parallel ma

general planar digraphs Using the stronglyconnected

chines virtually impossible One p ossible way around

components algorithm of Kao Kao we can compute

this dilemma is to nd useful classes of graphs for which

multiplesource reachability for general planar digraphs

the problem can b e solved eciently In pioneering

3

in O log n time using O n pro cessors This improves

pap ers Kao and Shannon KS and Kao and Klein

the results of Kao and Klein KK who showed that

KK showed that the reachability problem and many

5

this problem could b e p erformed in O log n time using

related problem could b e solved in p olylogarithmic time

O n pro cessors This work represen ts initial results of

using only a linear numb er of pro cessors Their meth

an eort to develop ecient algorithms for certain prob

o ds require one to solve each of many related problems

lems encountered in parallel compilation

by reducing one problem to another Each reduction in

tro duces more logarithmic factors to the running time

5

In the end they used O log time to solve the planar

Intro duction

reachability problem for multiple start vertices

In this pap er we give a general paradigm for contract

Testing if there exists a path from a vertex x to a vertex

ing planar directed acyclic graphs DAGs to a p oint

y in a directed graph is known as the reachability prob

We will show that after O log n rounds of contraction

an nno de directed planar DAG will b e reduced to a

This work supp orted in part by the Avionics Lab oratory

Wright Research and Development Center Aeronautical Sys

p oint There have b een several contraction rules pro

tems Division AFSC US Air Force WrightPatterson AFB

p osed for undirected planar graphs Phi Gaz but

Ohio under Contract FC ARPA Or

this is the rst for a class of directed planar graphs

der No and by National Science Foundation Award CCR

After we presen t the rules for contraction it will b e a

y

This work supp orted in part by National Science Foundation

relatively simple matter to overlay rules necessary to

grant DCR

compute multiplesource reachability

These results are part of a larger eort to develop a set

of reduction rules for arbitrary planar directed graphs

ie those with cycles as well as DAGs The algorithm

for the general case is more complicated and is not pre

sented here though we discuss changes involved in ex

tending the reduction pro cedure to the general case We is the head of the arc We say that an arc is out of

feel that the class of directed planar graphs are impor its tail and into its head An arc a is incident to a

tant for at least two reasons First the class includes vertex v if v is the head or the tail of a The

several important classes including tree and series paral of a vertex v is the numb er of arcs incident to it we

lel graphs Second the ow graph for many structured represen t this numb er as deg r eev The indegree of

programming languages without function calls is planar a vertex v is the numb er of arcs that have v as their

Our goal is to develop the basic algorithmic foundation head the outdegree of v is the numb er of arcs with v

for a class of planar graphs so that a theory of planar as their tail

ow graphs could b e based on it

For any directed graph G we can dene an undirected

0

In the interest of simplicity we only present the de

graph G on the same set of vertices in the following way

0

tails of the DAG case here On the other hand we feel for each arc u v in G we include an edge u v in G

0

that our algorithm for planar DAGs is interesting in its We refer to G as the underlying graph of G In this

own right First ignoring our algorithm for the general pap er we will distinguish b etween edges and arcs edges

case we can improve the computation of manysource are undirected and lie in the underlying graph while

2

reachability by a factor of log n time by simply using

arcs are directed When we refer to arcs in G as edges

0

the strong connectivity of Kao Kao Our algorithm

we are actually referring to the asso ciated edges in G

for general planar digraphs removes one further log n

A directed path is a sequence of vertices

factor Second it uses new top ological techniques in

v v v such that the v s are distinct with the

0 1 k i

particular the Poincare index formula This should b e

exception that we might have v v and for all

0 k

of interest in parallel algorithm design for digraphs

i k we have the arc v v in A A directed

i1 i

Throughout the pap er we will assume that the graph

is a directed path such that v v A digraph

0 k

G V A is a directed emb edded planar graph If

that contains no directed cycles is called a directed

an an emb edding is not given we can construct one acyclic graph DAG

in O log n time using n pro cessors using the work of

A planar directed graph is a directed graph that

Gazit Gaz and Ramachandran and Reif RR We

can b e drawn in the plane in such a way that its arcs

assume that the emb edding is given in some nice com

intersect only at vertices A sp ecication of some par

binatorial way such as the cyclic ordering of the arcs

ticular way in which such a graph can b e drawn in the

radiating out of each vertex

plane is called a planar emb edding of the digraph In

This pap er is divided into seven sections The sec

an emb edded planar digraph we dene parallel arcs as

ond gives the main denitions necessary to dene and two arcs u v and u v such that either u u

1 1 2 2 1 2

analyze the directed graph contraction algorithm The

and v v or u v and v u and the arcs are

1 2 1 2 1 2

third gives the contraction algorithm for sp ecial case of

consecutive in the cyclic order at b oth u and v Par

1 1

of a planar DAG The theorems in Sections and show

allel edges in the underlying graph are edges asso ciated

that the reduction algorithm for planar DAGs works

with parallel arcs in the graph

in a logarithmic numb er of reduction steps The sixth

If the p oints corresp onding to the arcs in an emb ed

section explains how the reduction pro cedure can b e

ded planar digraph are deleted the plane is divided into

applied to the manysources reachability problem and

a numb er of connected regions These regions are called

calculates the running time Finally in Section we

faces The b oundary of a face is the set of arcs that are

discuss work in progress including some of the steps

adjacent to that face We denote the set of faces by F

necessary to extend this result to the case of general

Eulers formula which holds for emb edded connected

planar digraphs

planar graphs relates the numb ers of arcs vertices and

faces

Preliminaries

jV j jE j jF j

If the graph also has or more vertices no selfloops

Planar Directed Graphs

and no parallel edges then each face will have at least

We will assume that the reader is familiar with basic

three edges in its b oundary and it is easy to prove the

denitions and results from that apply to

following inequality

undirected graphs see for example textb ooks such as

the one by Bondy and Murty BM

jE j jV j

A directed graph digraph GV A is a set of

vertices V and a set of arcs A Each arc a A is The formula corresp onding to with jAj substituted

an drawn from V V We say that arc for jE j holds for emb edded planar digraphs that have

a u v is directed from u to v u is the tail and v a connected underlying graph since the orientations of

the arcs do not aect the quantities involved The in not distinguish b etween the notation used in these two

equality corresp onding to with jAj substituted for cases

jE j holds for an emb edded planar digraph G if Gs un

Our approach dep ends on combinatorial arguments

0

derlying graph G is connected and has no selflo ops or

based on the following simple but fundamental theorem

parallel edges

which we refer to as the Poincare index formula

Theorem For every embedded connected planar di

The Poincare Index Formula

graph the fol lowing formula holds

Let GV A b e a connected emb edded planar digraph

X X

with faces F We say that a vertex of G is a

indexv indexf

sourcesink if its indegreeoutdegree is zero The

v 2V f 2F

alternation numb er of a vertex is the numb er of di

A pro of of this result is given in the Technical Re

rection changes ie from in to out or vice versa as we

p ort GM The pro of applies the Euler formula along

cyclically examine the arcs radiating from a vertex Ob

with the observation that if at each vertex we cycle

serve that the alternation numb er is always even Thus

through its incident arcs in order according to the em

a source or a sink has alternation numb er zero A vertex

b edding each transition from one arc to the next results

is said to b e a ow vertex if the alternation numb er is

in exactly one alternation either for the vertex or for the

two It is a saddle vertex if the alternation numb er is

face for which the two arcs lie on the b oundary see Fig

or more Vertex alternations are indicated by asterisks

ure each alternation is adjacent in this way to exactly

in Figure

one vertex

* * * ** * * * * * * * *

source flow vertex saddle vertex vertex alternations face alternations at a vertex at a vertex Figure 1

Figure 3

The alternation numb er of a face can b e dened in a

similar way Here we count the numb er of times the arcs

This formula is important b ecause it tells us a great

on the b oundary of the face change direction as we tra

deal ab out the structure of a planar digraph emb edding

verse its b oundary Thus a cycle face has alternation

For example the observations ab ove ab out alternation

numb er zero a ow face has alternation numb er two

numb er tell us the following ab out the contributions of

and a saddle face has an alternation numb er greater

various typ es of faces and vertices in this formula

than two Face alternations are indicated by asterisks

Sinks sources and cycle faces each have index

in Figure b elow

These are the only elements that make negative

contributions to the sums in the formula since the

* *

sums must come to it is clear that every em

ust have at least two such

* * b edded planar digraph m

elements For example a strongly connected pla

* *

nar digraph cannot have any sinks or sources so it

ust have two cycle faces cycle face flow face saddle face m

Figure 2

Flow faces and ow vertices have index and con

tribute to the sum There can b e an arbitrary

We denote the alternation numb er of vertex v by v

numb er of such elements

and the alternation numb er of face f by f it will b e

clear from the context whether refers to a vertex or a

Saddle vertices and saddle faces have p ositive inte

face

ger indices that dep end on their alternation num

A concept related to alternation numb er is index b ers Since the sum must always b e the em

The index of a vertex v denoted indexv is dened b edded graph must contain a sink source or cycle

as indexv v The corresp onding deni face for every pair of alternations b eyond the rst

tion holds for the index of a face Once again we do on each saddle

We will use the formula b elow to develop invariants and increases by at most a constant

to help us count for example we use it to count par

ticular typ es of arcs

Mo dels of Parallel Computation

The reduction algorithm is sp ecied for the Parallel

RandomAccess Machine PRAM model of com

We discuss the algorithm for this model in the

putation Figure 4

cases where memory accesses are allowed to b e concur

rent read concurren t write CRCW We also assume

the ARBITRARY model for concurren t writes ie an

No vertex has b oth indegree and outdegree of

arbitrary one of the values b eing written to a memory

ie there are no degree ow vertices Such ver

lo cation during a concurrent write will end up in that

tices are considered to b e internal vertices of topo

lo cation

logical arcs such arcs are treated as single arcs

We have also considered this algorithm in terms of

with resp ect to the algorithm though op erations on

the exclusive read exclusive write EREW model plus

these arcs may require the internal vertices to p er

unittime SCANS see Section This model is based

form op erations such as splicing connectivity p oint

on Blellochs parallel vector models Ble

ers For top ological arcs we dene the leader as the

rst arc from the original graph in the top ological

arc ie the arc into the rst internal vertex of the

Graph Reduction

top ological arc The rank of the vertices will b e

maintained on each top ological arc

In this section we intro duce a collection of reduction

rules and an asso ciated data structure for planar DAGs

Its not hard to see that any connected emb edded

The reduction rules allow us to convert a graph into a

planar DAG can b e transformed in O log n time so that

smaller graph such that we can recursiv ely solve the

these conditions are true without changing the reacha

problem on which were working Once the problem

bility with resp ect to the vertices in the original graph

is solved for the reduced graph we can expand the

graph out in reverse order and generate a solution for

the original graph In Sections and we show that

Terminology

at each stage the reduction pro cess removes a constant

In order to simplify the presentation of the reduction

prop ortion of the arcs thus the rules could b e imple

rules we rst intro duce some concepts and terminology

mented as an O log jAjstep reduction pro cedure for

Let f b e a ow face then the arcs on its b oundary

planar DAGs Inequality in Section thus implies

decomp ose into two paths a left and a right we refer

that the reduction pro cedure is O log n where n jV j

to any arc that is b oth on the left and the right path

in the original graph The rules listed b elow represen t

as an internal arc There is also a unique top and a

an abstraction of the reduction pro cedure that can b e

unique b ottom vertex on f Thus the left path starts at

applied with slight variations to implement dierent al

the top vertex and in a counterclo ckwise fashion with

gorithms These variations would b e algorithmspecic

resp ect to the face go es to the b ottom vertex and the

actions that would b e p erformed for each rule we will

1

right goes from top to b ottom in a clo ckwise fashion

sp ecify such actions in the algorithm description in Sec

A topbottom arc of f is any arc out ofinto the

tion

topb ottom vertex An arc may b e b oth a top and

We will assume that the input to the algorithm is a

a b ottom arc for the same face An arc is referred to

connected emb edded planar DAG G that has no par

simply as topb ottom if it is the topb ottom arc for

allel arcs and hence no parallel edges We prepro cess

some ow face We will mark top arcs with T and

the graph such that the following are true of G these

b ottom arcs with B

prop erties will remain true throughout the algorithm

In applying the rules we may modify the connectivity

G has only ow faces This can b e accomplished by

of the graph Therefore we asso ciate a data structure

putting a source in each saddle face and putting an

1

Clo ckwise and counterclockwise with respect to a face can

arc from this source to every vertex that is a local

b e understo o d in terms of the the clo ckwise order

source with resp ect to the saddle face b oundary

of edges on the b oundary of a face is the same as the order of

Figure It is straightforward to show that the

the corresp onding edges in the clo ckwise cyclic order at the dual

vertex corresp onding to the face numb er of edges and hence the numb er of vertices

with ow faces that will allow us to maintain connectiv We dene the op eration of arc contraction as fol

ity information For each vertex on a ow face that lows the contracted arc is removed from the graph and

is neither a top or b ottom vertex we have a cross the head and tail vertices are combined into a single ver

p ointer p ointing from left to right or right to left tex The cyclic order of the arcs at this new vertex is the

Initially each crossp ointer is set to the b ottom vertex cyclic order at the tail with the arcs at the head vertex

Intuitively the connectivity on f as determined by its inserted in their original order where the contracted

crossp ointers and b oundary arcs should b e the same as edge was

obtained using using arcs and vertices on the b ound

ary of f or those removed from the interior of f by the

reduction rules For each vertex other than top and

b ottom on a ow face we will also keep the highest and

lowest vertex on the opp osite side of the face that p oint

Reduction Rules

to this vertex initially the high p oint in will b e set to

b ottom and the low p oint in will b e set to top

We are now ready to list the reduction rules

For b oth the left and right path of each ow face

the top arc will serve as the leader of the path if the

TB Rule If an arc a is marked b oth T and B then

top arc is internal it will serve as leader for b oth sides

remove a If a is top ological any p ointers through in

Each arc will know the two faces common to it Using

ternal vertices of a must b e adjusted by setting any

concurren t reads a leader for each face and top ological

crossp ointer into a vertex internal to a to p oint to the

arc and the ranking of vertices internal to top ological

vertex p ointed to by the crossp ointer out of a on its

edges the vertices can now co ordinate their actions For

opp osite side The remaining p ointers are unchanged

example p ointers can now b e tested in constant time

Information on the structure of the face must b e up

to see if they are forward p ointers simply test if the

dated eg the left and right leaders and any new or

head and tail are on the same side of the face The

changed top ological arcs must b e up dated Pointer up

co ordination actions we will use take constant time in

dating is shown in Figure the lighter arrows indicate

the CRCW model

p ointers the darker ones arcs

We will refer to saddle vertices by their indices For

example saddle vertices with index represen ts the

set of saddle vertices with fewest alternations

Some reduction rules dep end on knowing whether an

arc is the unique arc into some vertex or the unique

arc out of some vertex We will refer to such arcs as

uniquein uniqueout arcs Note that it is p ossible for an arc to b e b oth uniquein and uniqueout In some

Figure 5 cases an arc a might not b e uniquein but at the head

of a the next arcs in b oth the clo ckwise and counter

clo ckwise cyclic ordering may b e outarcs In that case

we say that a is locally uniquein a symmetric de

Degree Rule If a source or a sink is of degree

nition holds for lo cally uniqueout Note that we will

then remove it and its arc The leaders on the left and

always use lo cally to imply that there is at least one

right b oundaries of the face are reset if necessary

other edge intoout of the headtail though that edge

is not adjacent in the cyclic order

UniqueinUniqueout Arc Contraction Rule If

a is a uniquein arc out of a source and a is clean con The existence of top ological arcs and the intro duc

tract a The leaders on the left and right b oundaries of tion of reachability p ointers as describ ed ab ove leads

the face are reset if necessary The corresp onding rule to complications in the application of reduction rules

holds for uniqueout arcs into sinks In particular we need to distinguish certain uniquein

and lo cally uniquein arcs out of a source We call such

Adjacent Degree Sources and Sinks Rule If an arc a clean if it has the following prop erties

a degree source and a degree sink incident to clean a has no internal vertices and for each face f that

arcs are in the conguration shown in Figure remove has a on its b oundary there are no p ointers across f

the source and sink and their arcs as shown ins this into the head of a Clean uniqueout and clean lo cally

and subsequen t gures straight arrows represen t arcs uniqueout arcs into sinks are dened similarly with the

and curved arrow represen t segments of face b oundaries exception that the second condition prohibits p ointers

that may b e longer than a single arc across adjacent faces out of the tail of the arc t2

s t1 t s s t

Figure 6

Figure 7c

Consecutive Rule Let s b e a source with a clean

SourceSinkSource stsSinkSourceSink t

lo cally uniquein arc out If at the head of the lo cally

st Rule Let s b e a degree or degree source hav

uniquein arc there are clean locally uniqueout arcs into

ing only clean locally uniquein arcs out If at two of

sinks adjacent in the cyclic order in b oth the clo ckwise

the saddle vertices adjacent to s there are clean lo cally

and counterclo ckwise directions do the following re

uniqueout arcs out of distinct sinks adjacent in the

move the lo cally uniquein arc from the source com

cyclic order to the arcs from s take the following ac

bine the two sinks into a single sink and combine the

tions

two locally uniqueout arcs into a single arc see Figure

A corresp onding rule applies for a sink and adjacent

If s has degree remove the source and its arcs

sources

and combine the two sinks into a single sink see

Figure a since all faces are ow faces each sink

s s

will b e at the b ottom of one of the two faces on the

h s lies b oundaries of whic t

t1 t2

If s has degree remove the arc out of s common

to the two faces on the b oundaries of which the two

sinks lie then combine the two sinks into a single

sink Figures b and c Figure 8

A corresp onding rule applies for sinks and adjacent

sources If a large numb er of vertices are combined into

Index Saddle Rule If a source has a clean arc

a single vertex a pro cessor must b e selected to represen t

to a saddle vertex of index and if the only other arc

that vertex Although this could take time Olog n

into the saddle is a clean arc from another source then

this computation can b e done in parallel with the rest

contract one or b oth of the inarcs see Figure a A

of the algorithm without aecting the running time

corresp onding rule holds if there are exactly two clean

to sinks Fig b As for the sts and tst

t1 outarcs

Rules if a large numb er of vertices are combined into a

single highdegree vertex a pro cessor must b e selected

to represen t that vertex t

t2 s1 s2 s2 Figure 7a

t2

Figure 9a

s s

t

v t1 v

Figure 7b

Main Reduction While there are arcs left in

the graph rep eat the following sequence of steps

t1

Perform any applicationspecic actions

t2 

 Clean up the current graph

 Apply the reduction rules in the order theyre Applicationspecic pro

Figure 9b listed in Section

cessing may b e required as each rule is applied

In the CRCW model it is easy to determine in con

Perform any applicationsp ecic pro cessing needed

stant time if the conditions for rule application are met

prior to the expansion phase

These conditions can b e checked locally in the graph

Ignoring the time to do conict resolution for now rule

Reconstruct the graph by reversing the steps in the

applications can b e done in constant time

reduction pro cess note that this requires that we

have stored in order all changes made during the

reduction pro cess

Cleaning Up the Graph

Many of the rules ab ove require that the arcs involved b e

clean These arcs will not necessarily b e clean however

Op erability Lemmas

Therefore we intro duce a parallel algorithm for cleaning

up arcs out of sourcesinto sinks that runs in constant

In the next two sections we prove that the reduction



time in the CRCW model The cleanup algorithm will

pro cedure given ab ove works in O log n log n time us

b e run as a subroutine in the reduction algorithm It

ing O n pro cessors We start by showing that at each

will also b e run with resp ect to an invariant relative to

step of the algorithm a constant prop ortion of the arcs

the particular problem to which the reduction algorithm

are candidates for removal

is applied eg in the case of manysource reachability

the essence of the invariant is that the vertices in the

Denition An arc is op erable if one of the rules

curren t graph that are reachable from one of the starting

would remove it

vertices are either marked as reachable or have a path

consisting of p ointers and edges from some vertex that

Lemma Op erability Lemma In any connected

is marked Applying cleanup with resp ect to the in

embedded planar DAG consistent with our invariants a

variant will add computation to the cleanup algorithm

constant proportion of the arcs are operable

in general we try to cho ose an invariant in such a way

that it do esnt increase the asymptotic running time of

Pro of The lemma follows immediately from Lem

the basic cleanup algorithm

mas and b elow which prove the result for two

We do not clean up all sources and sinks To insure

cases that dep end on the ratio of sources and sinks to

that cleanup do esnt take to o long only sources and

the numb er of vertices in the graph 2

sinks of degree less than or equal to a constant d to b e

sp ecied later and incident only to uniquein or lo cally

Lemma In any connected embedded planar DAG

uniqueinuniqueout or locally uniqueout arcs will b e

consistent with our invariants and in which the number

cleaned up note that such sources and sinks have no

of sources and sinks is less than n of the arcs

parallel arcs out or in Not all of these conditions are

are operable

necessary to insure limited running time some are re

lated to the pro ofs in Section

In the interest of brevity we will only outline the

Details of the cleanup algorithm are presen ted in the

pro ofs of this lemma and Lemma Full pro ofs are

Technical Rep ort

given in the Technical Rep ort To prove this lemma we

show that in graphs meeting the conditions stated there

Overview of the General Reduction

are many arcs that either are op erable by the Degree

Pro cess

Rule or are op erable by the TB Rule The following

lemma is a useful to ol in the latter case

The general algorithm for reducing an emb edded planar

DAG can now b e stated

Lemma Flow Face Op erability An arc be

Prepro cess the graph to make it consistent with our tween two ow faces is operable if it is neither uniquein

invariants local ly uniquein uniqueout nor local ly uniqueout

Pro of Because the arc is neither globally nor lo cally to cases in which either our invariants arent maintained

uniqueout there must b e an adjacent outarc in the or in which the rule applications cannot b e completed

cyclic ordering at its tail vertex which thus must b e in the time available An example in which invariants

the top vertex of one of the ow faces Therefore the arent maintained include removing b oth B arcs from

arc is a T arc A symmetrical argument shows that the a ow face when these arcs are the only arcs into the

arc is also a B arc Thus the arc is op erable by the TB b ottom vertex an example of a p otential time problem

rule 2 is where removal of many TB arcs causes arbitrarily

many p ointers to b e spliced together The second con

The pro of of Lemma pro ceeds by showing that

ict arises when applications of a particular rule make

there are many arcs that either uniquein or uniqueout

arcs that were formerly op erable by another rule in

and incident to degree sources and sinks or that are

op erable This conict aects our counting argument

neither uniquein nor uniqueout This follows from the

aimed at showing a constant prop ortion of the arcs are

fact that our graphs have no degree ow vertices and

removed in each pass through the main loop

that the graph induced by the uniquein and unique

out arcs is a forest This isnt quite enough to prove

the lemma however we must then show that most of

Conict Resolution for a Single Rule

the nonuniquein and nonuniqueout arcs are neither

lo cally uniquein nor lo cally uniqueout This follows

We will deal with conicts b etween applications of a

from the Poincare Index Formula and the conditions of

single rule by building a conict graph that relates

2

the lemma

the conicting arcs The graph consists of a vertex

We use a counting argument to prove the second half

for each arc op erable by the rule in question and an

of Lemma

edge b etween each pair of vertices if the removal of the

corresp onding arcs would cause a problem with resp ect

Lemma In any embedded planar DAG consistent

to our invariants or the running time of the removal

with our invariants in which the number of sources and

step The edges are undirected b ecause the conicts are

sinks is greater than n a constant proportion of the

symmetrical here

arcs are operable

The conict graphs for our rules with one exception

have b ounded degree see the Technical Rep ort for de

As ab ove see the Technical Rep ort for a full pro of

tails they are not necessarily planar however They

An outline of the pro of follows First we show that a

are easily constructed in constant time in the CRCW

high degree source or sink v ie deg r eev d

model

either is incident to a TB arc or is uncommon in the

It is obvious that a maximal indep endent set MIS

sense that the numb er of such sources and sinks is less

of vertices from a conict graph represen ts a set of ver

than a constant prop ortion of the numb er of sources

tices that can b e removed in parallel without problems

and sinks in the graph given the conditions in the lemma

it is also obvious that a MIS in a b oundeddegree graph

statement Next we show that at least of the sources

contains a constant prop ortion of the vertices There

and sinks with degree  d are incident to an op era

fore we can use the techniques develop ed by Goldberg

ble arc Such vertices will b e pro cessed in the cleanup

Plotkin and Shannon GPS to resolve conicts in

phase so any sourcesink incident to an arc that is not



O log n time Intro ducing randomness into the model

lo cally uniquein lo cally uniqueout has an op erable

of computation allows us to nd an indep endent set that

arc outin In the remaining cases all incident arcs are

includes a constant prop ortion of the vertices in the con

lo cally uniquein or lo cally uniqueout by a counting ar

ict graph in constant time

gument based on the Poincare Index Formula we show

that at least must b e incident to an op erable arc

The lemma follows from there

Conict Resolution Between Rules

We deal with the second typ e of conict by proving the

following lemma

Conict Resolution

Lemma In applying any reduction rule in the or

In the previous section we showed that in any emb ed

der specied in the algorithm description at a particular

ded connected planar DAG meeting certain invariants a

source or sink the number of arcs operable by subsequent

constant prop ortion of the arcs are op erable However

applying the reduction rules to these op erable arcs leads

2

The case for the TB Rule is actually somewhat more com

to two typ es of conicts we must deal with The rst

plicated We divide the arcs op erable by the TB Rule into three

sort of conict arises when we try to apply a single rule

classes and build a dierent conict graph for each class in turn

See the Technical Rep ort for details to all arcs that are op erable by that rule Doing so leads

rules excluding those removed by this rule application Planar DAG ManySource Reacha

is reduced by at most a constant number

bility

The pro of is by examination of all cases

The abstract reduction pro cedure can b e used to solve

the manysource reachability problem for planar DAGs

The problem can b e stated as follows given a planar

Pro of of Main Lemma

DAG and a set of vertices in that DAG as the input

The only step left in proving that the reduction algo

compute the set of vertices that are reachable via di

rithm runs in a logarithmic numb er of iterations of the

rected paths from the input set of vertices To do this

main lo op is to show that applying the conict reso

we must come up with a set of applicationspecic ac

lution scheme ab ove will allow the reduction algorithm

tions to take at various p oints in the reduction algo

to remove a constant prop ortion of the op erable arcs in

rithm plus an invariant that will allow us to prove that

each pass through the main lo op

the result is correctly computed

We intro duce two ags at each vertex a ag indi

Lemma Main Lemma For any embedded con

cating whether or not the vertex has b een marked as

nected planar DAG consistent with our invariants the

reachable from one of the initial vertices and an ac

generalized reduction algorithm wil l work in O log n it

tive mark ag that we will use to determine where to

erations of the main loop using O n processors

propagate marks during the reduction phase The algo

rithm starts with the input set of vertices having b oth

Pro of The result follows from Lemma b elow

their active mark and reachable ags set Marks

and Lemma if the numb er of sources and sinks is

are propagated as follows

less than n It follows from Lemma b elow and

Lemma otherwise 2

 At the start of each iteration of the main loop each

vertex reachable either via a connectivity p ointer or

Lemma When applied to any embedded connected

a directed arc from a vertex with an active mark

planar DAG consistent with our invariants the gener

sets b oth of its ags Any with an active mark

alized reduction algorithm wil l remove a constant pro

unsets its active mark ag

portion of the TB arcs on each pass through the main

 At the start of each cleanup phase each active mark

loop

at an internal vertex of a top ological arc out of

a source of degree less than or equal to the de

The pro of of this lemma is based on showing that for

each TB arc removed at most a constant numb er of gree d is propagated across its crossp ointers a

other TB arcs are not removed b ecause of conicts This numb er of times equal to the degree of the source

Then all active marks at such sources and at ver

implies that a constant prop ortion of the TB arcs are

tices internal to top ological arcs out of such sources

removed

are propagated to the heads of the arcs out of the

Lemma When applied to any embedded connected

source A symmetrical pro cedure is done at sinks

planar DAG consistent with our invariants the gener

 When applying each reduction rule one or two

alized reduction algorithm wil l remove a constant pro

propagation steps are done for the arcs removed

portion of the operable arcs

See the Technical Rep ort for details

Pro of For each arc removed consider the numb er of

In addition sinks are never marked during the reduction

op erable arcs with which it conicts By Lemma and

phase

the fact that the conict graph for each rule is b ounded

Between the contraction and expansion phases any

this numb er is b ounded by a constant Since every op er

top ological arc removed during contraction that has a

able arc is either removed or is sub ject to a conict with

mark at the tail or an internal vertex propagates the

an arc that is removed at least a constant prop ortion

mark down the arc This can b e done using list ranking

of the op erable arcs are removed 2

techniques

During the expansion phase as top ological arcs are

added back to the graph their internal vertices may need

Applications

to b e marked This involves checking the lowest cross

In this subsection we present an application that uses p ointer that can reach each internal vertex to see if its

the abstract reduction pro cedure presen ted ab ove We tail vertex is marked Also during expansion any ver

also presen t the running time and numb er of pro cessors tices that b ecame sinks or were merged with sinks are

needed to run this application marked as necessary as they revert from b eing a sink

Sinks are marked at the end of the expansion phase if graph size Making conict resolution deterministic by

they have a marked neighb or using the techniques of Goldberg Plotkin and Shannon



To prove that this pro cess correctly marks the reach will add an additional factor of log n to the time

able vertices we use the following invariants one for the

contraction phase and one for the expansion phase The

Reducing Planar Digraphs with Cy

term active set refers to vertices in the curren t graph

cles

that are not sources sinks or vertices that represen t the

The techniques ab ove can b e expanded to work with pla

combination of two or more vertices from the original

graph The contraction invariant is as follows nar graphs that have cycles This is particularly useful

in that we can then compute strongly connected compo

Lemma During the contraction phase a vertex v in

nents and thus we can compute manysource reachabil

the active set that is reachable in the original graph from

ity for any planar digraph by rst computing strongly

one of the input set vertices if and only if it is either

connected components and then contracting them then

marked as reachable or there exists an active mark at

computing manysource reachability then expanding

some vertex u in the active set and a directed path of

back out the strongly connected components

arcs and crosspointers from u to v that includes only

The reduction algorithm for the cyclic case is more

vertices from the active set

complicated as are the pro ofs of its correctness We

summarize some of the dierences b elow

The expansion invariant is as follows

 We must intro duce two new rules an arc contrac

Lemma During the expansion phase al l vertices in

tion rule and an arc removal rule for cycle faces

the active set are correctly marked

The invariant changes to allow cycle faces as well

as ow faces

These invariants are sucient to prove that at the

completion of the algorithm the graph is correctly

 In addition to crossp ointers on ow faces we must

marked See the Technical Rep ort for details

keep backp ointers to the highest p oint reachable on

the same side of the face

Running Time and Pro cessor Count

 Cleanup is more complex b ecause of the backp oint

ers We must now clean up two levels of arcs

The running time is determined by observing that the

from sources or sinks In addition we must sp end

main lo op is executed O log n times in the reduction

O log n time determining the connectivity implied

and expansion phases The running time of the main



by the backp ointers during cleanup

lo op is dominated by the O log n time it can take to

resolve conicts for some of the reduction rules Pre

 The op erability pro ofs must b e modied to take

pro cessing time is dominated by the time for the main

into account the existence of cycle faces in the



lo op so the running time is O log n log n this can b e

graph

reduced to O log n through the use of randomization

Acknowledgements We would like to thank Ming

as noted ab ove The algorithm can b e run using one

Yang Kao John Reif and Doug Tygar for their useful

pro cessor p er face vertex and arc which is linear in

discussions comments and suggestions

the size of the input graph When combined with Kaos

strongly connected components algorithm Kao the

3

running time b ecomes Olog n

References

Ble Guy E Blello ch Vector Models for Data

Work in Progress

Paral lel Computing MITPress Cambridge

MA

We are currently working on extensions to other models

and to planar digraphs that include cycles

BM J A Bondy and U S R Murty Graph Theory

with Applications NorthHolland New York

Extensions to Other Mo dels

We are in the pro cess of writing up an extension of this Gaz H Gazit Optimal EREW parallel algorithms

work to the exclusive read exclusive write EREW plus for connectivity ear decomposition and st

unittime SCANS PRAM model We exp ect that the numb ering of planar graphs In Fifth Inter

reduction algorithm will run in time O log n using ran national Paral lel Processing Symposium May

domization and a numb er of pro cessors linear in the To app ear

GM S Guattery and G L Miller A parallel con

traction pro cedure for planar dags Techni

cal Rep ort CMUCS Carnegie Mellon

University To App ear

GPS Andrew Goldberg Serge A Plotkin and Gre

gory Shannon Parallel symmetrybreaking

in sparse graphs In Proceedings of the th

Annual ACM Symposium on Theory of Com

puting pages New York May

ACM

Kao MingYang Kao Linearpro cessor nc algo

rithms for planar directed graphs i Strongly

connected components Accepted to SIAM

Journal on Computing

KK MingYang Kao and Philip N Klein To

wards overcoming the transitiveclosure b ot

tleneck Ecient parallel algorithms for pla

nar digraphs In Proceedings of the th An

nual ACM Symposium on Theory of Comput

ing Baltimore May ACM

KS MingYang Kao and Gregory E Shannon Lo

cal reorientation global order and planar

top ology In Proceedings of the th Annual

ACM Symposium on Theory of Computing

pages ACM May

MR Gary L Miller and John H Reif Parallel

tree contraction and its application In th

Symposium on Foundations of Computer Sci

ence pages Portland Oregon Octo

b er IEEE

MR Gary L Miller and John H Reif Parallel tree

contraction part Fundamentals In Silvio

Micali editor Randomness and Computation

pages JAI Press Greenwich Connecti

cut Vol

Phi Cynthia Phillips Parallel graph contrac

tion In Proceedings of the ACM Sym

posium on Paral lel Algorithms and Architec

tures pages Santa Fe June

ACM

RR Vijaya Ramachandran and John Reif An op

timal parallel algorithm for graph planarity

In th Annual Symposium on Foundations of

Computer Science pages NC Oct

Nov IEEE

UY Jeery Ullman and Mihalis Yannakakas High

probability parallel transitive closure algo

rithms In Proceedings of the ACM Sym

posium on Paral lel Algorithms and Architec

tures pages Crete July ACM