Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

The Directed Planar Reachability Problem - Paper 2 | 400 411, Papers of Food science

Material Type: Paper; Class: 400 - FOOD CHEMISTRY; Subject: FOOD SCIENCE; University: Rutgers University; Term: Unknown 1989;

Typology: Papers

Pre 2010

Uploaded on 09/17/2009

koofers-user-51c
koofers-user-51c 🇺🇸

10 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
The Directed Planar Reachability Problem
Eric Allender1, Samir Datta2, and Sambuddha Roy3
1Department of Computer Science, Rutgers University, Piscataway, NJ08855,
allender@cs.rutgers.edu
2Chennai Mathematical Institute, Chennai, TN 600 017, India sdatta@cmi.ac.in
3Department of Computer Science, Rutgers University, Piscataway, NJ08855,
samroy@paul.rutgers.edu
Abstract. We investigate the s-t-connectivity problem for directed planar graphs,
which is hard for L and is contained in NL but is not known to be complete. We
show that this problem is logspace-reducible to its complement, and we show that
the problem of searching graphs of genus 1 reduces to the planar case.
We also consider a previously-studied subclass of planar graphs known as grid
graphs. We show that the directed planar s-t-connectivity problem reduces to the
reachability problem for directed grid graphs.
A special case of the grid-graph reachability problem where no edges are directed
from right to left is known as the “layered grid graph reachability problem”. We
show that this problem lies in the complexity class UL.
1 Introduction
Graph reachability problems play a central role in thestudy and understanding of sub-
classes of P.Thes-t-connectivity problem for directed graphs (STCONN) is complete
for nondeterministic logspace (NL); the restriction of this problem to undirected graphs,
called USTCONN, has recently been shown to be complete for logspace (L) [Rei05];
thus this problem has the same complexity as the s-t-connectivity problem for graphs
of outdegree 1 (and even for graphs of indegree and outdegree at most 1 [Ete97]).
Grid graphs are an important restricted class of graphs for which the reachability
problem has significant connections to complexity classes. (The vertices in a grid graph
are a subset of IN ×IN , and all edges are of the form (i, j)(i+b, j )or (i,j )
(i, j +b),whereb∈{1,1}.) In most settings (and in particular in all of the results
we will present in this paper) it is sufficientto restrict attention to grid graphs wherethe
start vertex slies in the first column, and the terminal vertex tlies in the final column.
In [BLMS98], Barrington et al showed that the reachability problem in (directed or
undirected) grid graphs of width kcaptures the complexity of depth kAC0. Barrington
also considered general grid graphs without the width restriction, calling this the Grid
Graph Reachability problem (GGR) [Bar02]. The construction of [BLMS98, Lemma
13] shows that GGR reduces to its complement via uniform projections. (The problems
STCONN and USTCONN also reduce to their complements via uniform projections, as a
consequence of [Imm88,Sze88,Rei05,NTS95].) Reachability problems for grid graphs
have proved easier to work with than the corresponding problems for general graphs.
For instance, the reachability problem for undirected grid graphs was shown to lie in L
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download The Directed Planar Reachability Problem - Paper 2 | 400 411 and more Papers Food science in PDF only on Docsity!

The Directed Planar Reachability Problem

Eric Allender^1 , Samir Datta^2 , and Sambuddha Roy^3 (^1) Department of Computer Science, Rutgers University, Piscataway, NJ 08855, allender@cs.rutgers.edu (^2) Chennai Mathematical Institute, Chennai, TN 600 017, India sdatta@cmi.ac.in (^3) Department of Computer Science, Rutgers University, Piscataway, NJ 08855, samroy@paul.rutgers.edu

Abstract. We investigate the s-t-connectivity problem for directed planar graphs, which is hard for L and is contained in NL but is not known to be complete. We show that this problem is logspace-reducible to its complement, and we show that the problem of searching graphs of genus 1 reduces to the planar case. We also consider a previously-studied subclass of planar graphs known as grid graphs. We show that the directed planar s-t-connectivity problem reduces to the reachability problem for directed grid graphs. A special case of the grid-graph reachability problem where no edges are directed from right to left is known as the “layered grid graph reachability problem”. We show that this problem lies in the complexity class UL.

1 Introduction

Graph reachability problems play a central role in the study and understanding of sub- classes of P. The s-t-connectivity problem for directed graphs ( ST C ONN ) is complete for nondeterministic logspace (NL); the restriction of this problem to undirected graphs, called U ST C ONN , has recently been shown to be complete for logspace (L) [Rei05]; thus this problem has the same complexity as the s-t-connectivity problem for graphs of outdegree 1 (and even for graphs of indegree and outdegree at most 1 [Ete97]). Grid graphs are an important restricted class of graphs for which the reachability problem has significant connections to complexity classes. (The vertices in a grid graph are a subset of IN × IN, and all edges are of the form (i, j) → (i + b, j) or (i, j) → (i, j + b), where b ∈ { 1 , − 1 }.) In most settings (and in particular in all of the results we will present in this paper) it is sufficient to restrict attention to grid graphs where the start vertex s lies in the first column, and the terminal vertex t lies in the final column. In [BLMS98], Barrington et al showed that the reachability problem in (directed or undirected) grid graphs of width k captures the complexity of depth k AC^0. Barrington also considered general grid graphs without the width restriction, calling this the Grid Graph Reachability problem (GGR) [Bar02]. The construction of [BLMS98, Lemma 13] shows that GGR reduces to its complement via uniform projections. (The problems ST C ONN and U ST C ONN also reduce to their complements via uniform projections, as a consequence of [Imm88,Sze88,Rei05,NTS95].) Reachability problems for grid graphs have proved easier to work with than the corresponding problems for general graphs. For instance, the reachability problem for undirected grid graphs was shown to lie in L

in the 1970’s [BK78], although more than a quarter-century would pass before Reingold proved the corresponding theorem for general undirected graphs.

Barrington also defined what we will refer to as the layered grid graph reachability problem LGGR, in which no edges are directed from right to left in the grid. (That is, there is no edge of the form (i, j) → (i, j − 1); we use the convention that ver- tex (i, j) refers to the point in row i and column j.) Barrington originally called these graphs “acyclic” grid graphs, because this is a simple syntactic condition guaranteeing that a grid graph will have no cycles. (However, this terminology was confusing be- cause there are grid graphs without cycles that do not meet this syntactic criterion.) In personal communication, Barrington suggested the name “layered”, with the following justification. It is shown in [Bar02] that this problem is equivalent to the special case where all edges are directed from left to right or from top to bottom. Thus without loss of generality, the start node is in the top left corner. If such a grid graph is rotated 45 degrees counterclockwise, one obtains a graph whose “columns” correspond to the di- agonals of the original graph, where s is the only node in the first “column”, and all edges in one column are directed “northeast” or “southeast” to their neighbors in the following column. This is consistent with the usual usage of the word “layered” in graph theory.

Barrington showed that GGR and LGGR are hard for NC^1 under uniform pro- jections [Bar02], but the best upper bound that was identified by Barrington for these problems is NL.

Our focus in this paper is the restriction of ST C ONN to planar (directed) graphs P LANAR. ST C ONN. This problem is hard for L under uniform projections, as a conse- quence of [Ete97], and it lies in NL. Nothing else has been published regarding its com- putational complexity. Thus the class of problems ≤log m -reducible to P LANAR. ST C ONN can be viewed as a complexity class lying between L and NL. We show that this class is closed under complement, by presenting a ≤log m reduction of P LANAR. ST C ONN to its complement; we do not know if this reduction can be accomplished by uniform projec- tions or even by NC^1 reductions; in contrast to the case for ST C ONN, U ST C ONN , and GGR. We also show that this class contains the s-t-connectivity problem for graphs of genus 1; the generalization for graphs of higher genus remains open.

We have two separate proofs of closure under complement. We present a direct proof in Section 3. In Section 4 we present a reduction showing PLANAR. ST C ONN ≤log m GGR. This also proves closure under complement, because [BLMS98, Lemma 13] shows that GGR reduces to its complement.

Our final technical contribution is to show that LGGR lies in the complexity class UL. This must be viewed as a slight improvement, since it is shown in [ARZ99] that NL = UL if there is any problem in DSPACE(n) that requires circuits of exponential size, and it is shown in [RA00] that NL/poly = UL/poly (unconditionally). We actually show that LGGR lies in UL∩coUL, although (in contrast to all of the other reachability problems we consider) it remains open if LGGR reduces to its complement. (Note also that it remains open if UL = coUL.) Some other examples of reachability problems in UL were presented by Lange [Lan97]; these problems are obviously in UL (in the sense that the positive instances consist of certain graphs that contain only one path from s to t), and the main contribution of [Lan97] is to present a completeness result for a natural

between s and v 1 (and t and vm) are duplicated, with edges between s and v 1 ,a and v 1 ,b (and edges between t and vm,a and vm,b, respectively). This is illustrated in Figure 1.)

G’

s t

Fig. 1. Cutting along a st path

This new graph G′^ is planar, and has vertices s and t on the same face (the only new face created). Since we can embed any planar graph such that any specific face is the outer face, we re-embed our graph G′^ such that s and t are now on the outer face. From now on we assume G′^ has this embedding.

In the process of going from G to G′^ we have changed the connectivity of the graph; s and t might have been connected in G but they might not be connected in G′. In particular, any directed path in G from s to t that uses edges from both L and R is not replicated in G′. We solve this problem by pasting together copies of the graph G′, as follows. The outer face of G′^ consists of two undirected paths from s to t: s, v 1 ,a, v 2 ,a,... , vm,a, t and s, v 1 ,b, v 2 ,b,... , vm,b, t. The operation of “pasting” two copies of G′^ together consists of identifying the vertices v 1 ,a, v 2 ,a,... , vm,a in one copy with the vertices v 1 ,b, v 2 ,b,... , vm,b in the other copy. (Note that this amounts to “sewing together” two copies of the path that were “cut apart” in creating G′^ from G.) The graph G′′^ consists of 2 n + 1 copies of G′^ pasted together in this way: the “original copy” in the middle, and n copies pasted in sequence to the top boundary of the outer face, and n copies pasted in sequence to the bottom boundary.

G′′^ has (the original copies of) s and t on the outer face. A simple inductive argu- ment shows that there is a directed path from s to t in G if and only there is a directed path from (the original copy of) s to one of the copies of t in G′′. A pathological exam- ple showing that many copies of G′^ are needed is shown in Figure 2. To complete the reduction, we construct a graph H that consists of G′′^ along with a new vertex t′′^ with directed edges from each copy of t to t′′. The vertices s and t′′^ appear on the external face of H, and there is a directed path from s to t in G if and only if there is a directed path from s to t′′^ in H.

s t

G

P

Fig. 2. A pathological case

3 Closure Under Complement

In this subsection we reduce the s-t-connectivity problem for directed planar graphs with s and t on the outer face to the complement of the s-t-connectivity problem for directed planar graphs. It has recently come to our attention that a very similar theorem and proof appear in [HRS93][Theorem 3]. First, however, we define some terms more carefully. As observed in the preceding subsection, it is easy in logspace to enumerate all of the vertices that appear on a given face of a planar combinatorial embedding. Note however that the edges that connect these vertices around the face might not constitute a simple (undirected) cycle. How- ever, for any bounded face F of a planar embedding, there is always a simple undirected cycle called the boundary of F. Observe that the edges appearing on the boundary of F can also be enumerated in logspace (because they are the only edges that are traversed in only one direction while enumerating all of the vertices that appear on the face F ). With this observation in hand, we proceed with our discussion of the special case. We are given a directed graph G embedded in the plane with the source and sink vertices s and t on the outer face. The basic intuition is that if there is no directed path between s and t in G then there is a proof of this fact, consisting of a geometric curve C slicing across G with s on one side of C and t on the other side, where all of the edges crossing C are directed away from t; thus no path can start at s and reach t. We give a formal definition of such a curve (which we call a separating cut ), and observe that there is a separating cut if and only if there is not a path from s to t in G. Then we show how to construct a directed planar graph H such that there is a separating cut for G if and only if there is a directed path from s′^ to t′^ in H.

Definition 3.1. A separating cut for G is a simple closed curve C in the plane, with s embedded in the interior of C , and t embedded in the exterior of C , where C intersects no vertex of G , and all edges of G that intersect C are directed from the exterior to the interior of C_._

Lemma 3.2. Given a planar directed graph G with vertices s and t on the outer face, there is a separating cut if and only if if there is no directed path from s to t in G_._

upper boundary. Thus u and w are on the right side of C and v and x are on the left side. Note that for each edge ei that C crosses, the vertex on the right side of C is reachable from s and the vertex on the left side is not. Also, for each bounded face Fi that C en- ters, the edge ei is oriented counterclockwise around Fi, and ei+1 is oriented clockwise around Fi, and all vertices to the right of C on the boundary of Fi are reachable from s. Using these invariants, it is clear how to define e 2. We continue curve C over F 1 to cross over e 2 , where we now find ourselves either in the external face or in some bounded face F 2. In this way, we define e 3 , F 3 , etc., and extend C across them. We claim that C never crosses itself, and that in a finite number of steps the curve C reaches the external face by crossing an edge on the lower boundary. When we do, we continue through the external face around s and close the curve where we started above the upper boundary. Thus the proof will be complete once we establish this claim. In order to prove that that C never crosses itself, consider the first time C revisits some face Fi. (That is, consider any i and the least j > i such that Fi = Fj .) Assume also that up to this point C has not crossed the same edge twice, nor crossed itself. We will show that C can continue on without crossing itself or crossing the same edge twice. This is illustrated in Figures 4 and 5. The previous time that C crossed Fi it entered across edge ei and exited across edge ei+1. Our invariants tell us that all of the vertices on the boundary of Fi in the region running counterclockwise between ei and ei+1 are reachable from s, and also that, when curve C comes back to Fi = Fj by crossing edge ej , one of the endpoints of ej is not reachable from s. Thus ej must appear in the region running clockwise between ei and ei+1 (and hence the situation illustrated in Figure 4 cannot arise). The edge ei+1 is not equal to ej (because they are oriented in opposite directions) and by induction ei 6 = ej. Edge ej+1 is found by proceeding counterclockwise around Fj from ej and stopping when a vertex is encountered that is not reachable from s. Thus ej+1 will be found in the region strictly between ej and ei, and thus C can cross from ej to^ ej+1 without intersecting its earlier traversal from^ ei to ei+1.

s t

u (^) v e

e 1 w x

y z

F 0

0

Fig. 4. C crossing itself from left.

s t

u v e

e w x y

z

F

0

1

e 2

1

Fig. 5. C crossing itself from right.

C might return yet again to Fi = Fj = Fk , entering Fi along some edge ek. Retain- ing our inductive hypothesis, the same argument as above shows that ek cannot appear between ei and ei+1 or between ej and ej+1, and it cannot appear between ei+1 and ej because this would require C to cross itself, contrary to our inductive hypothesis. Thus ek must appear in the segment of the boundary of Fi running counterclockwise between ej+1 and ei. The same argument as with ej+1 shows that ek+1 must appear in the segment of the boundary of Fi running counterclockwise between ek and ei, and thus C can enter Fi across ek and exit over ek+1 without crossing itself. An inductive argument shows that no matter how many times C returns to face Fi, the edges it uses to enter and exit Fi form a sequence running counterclockwise around the boundary. We have now established that the curve C never crosses itself, and it never crosses the same edge twice. Since the graph contains only a finite number of edges, it is clear that C will enter the external face after a finite number of steps. In order to establish our claim and complete the proof, it remains only to show that when C does enter the external face, it must happen on the lower boundary. If C were to enter the external face along the upper boundary, then it cannot happen between t and e 0 , because none of the vertices in that segment of the upper boundary are reachable from s, whereas each edge that C is adjacent to a vertex that is reachable from s. On the other hand, if C were to enter the external face along the upper boundary between s and e 0 , then C could be extended to return to its starting point, with the property that for each directed edge (u, v) that crosses C, the vertex v on the left side of C (the exterior) is not reachable from s, but the vertex u on the right side (the interior) of C is reachable from s. This is a contradiction, since every path from s to the interior of C would have to pass through a vertex that is not reachable from s. (See Figure 6.) This completes the proof of the claim, and hence the lemma is proved.

We can now present the details of our reduction. We are given a directed graph G embedded in the plane with the source and sink vertices s and t on the outer face. In logspace, we can check if there is an edge that appears on both the upper and lower boundaries of G that is directed away from t and toward s on these boundaries. If this is the case, then clearly there is no path from s to

determines the orientation of all other edges of G. Thus, to determine which way e is oriented around face F , it suffices to apply the logspace algorithm for undirected s-t connectivity to determine the (unique) value of c such that (e, F, c) is in the same con- nected component as some triple (e′, F ′, c′) giving the correct information about some edge e′^ on the upper boundary. We have now shown that an encoding of H can be constructed in logspace. If there is no path from s to t in G, then there is a separating cut. As shown in the proof of Lemma 3.2, this cut starts above the upper boundary (in the position of s′) and enters a sequence of faces F 0 , F 1 ,... entering each Fi across an edge that is oriented counterclockwise around Fi, and departing across an edge that is oriented clockwise around Fi, before finally crossing the lower boundary. It is clear that this yields a directed path s′, F 0 ,... , t′^ in H. Conversely, assume that there is a directed path from s′^ to t′^ in H. Thus there is a simple path s′, F 0 , F 1 ,... , Fr , t′^ where each Fi is distinct. We can describe a curve starting above the upper boundary of G and crossing into F 0 , and from there into F 1 etc., eventually reaching the lower boundary. We then continue the curve around s and back to its starting point above the upper boundary. Clearly this is a simple curve, and all edges that cross the curve are directed from the exterior to the interior; thus it is a separating cut, demonstrating that there is no edge from s to t in G.

4 Grid Graphs

In this section, we present a ≤log m reduction of P LANAR. ST C ONN to GGR. Using the reduction of Section 2, we may assume that we are given a planar graph G with s and t on the external face. By applying the reachability algorithm on undirected graphs, we can merge all vertices that are joined by bidirected edges, and thus we can assume that all edges are unidirectional; note that the graph remains planar after this transformation. We may also assume without loss of generality that G has no vertex of degree (indegree + outdegree) greater than 3, and that s has degree two. (To see this, observe that if v is a vertex of degree d > 3 , then we may replace v with d vertices arranged in a directed cycle, with each one adjacent to one of the d edges that were connected to v. In order to compute this transformation it is important to note that we can compute the planar embedding in logspace. If the vertex s has degree three, then an additional vertex of degree two can be inserted into this cycle, and re-named s.) We can compute an (undirected) spanning tree T of G in logspace. The vertex s is a vertex of T , and we can consider it to be the root of T ; without loss of generality s has two children in T. By our assumptions on G, the tree T is a binary tree; the planar embedding of G imposes an ordering on the children of each node in T. As observed in [AM04], we can compute the height h(v) of each node v in T in logspace (by counting the number of vertices that are ancestors of v). For notational convenience, define the height of the root s to be 1, and if v has child u then h(u) = h(v) + 1. At this point, we are ready to assign each vertex of G to a grid point. Our grid graph will consist of a “fine grid” and a “coarse grid”. The coarse grid consists of points placed at the corners of large squares (of size (4n + 1) × (4n + 1)) of the fine grid. (The fine grid will be used to route non-tree edges between vertices placed on the coarse grid.)

For any node x, define w(x) to be the number of leaves of T that appear strictly to the left of x; w(x) can be computed easily in logspace by traversing T. Each vertex x is assigned to the point (h(x), w(x) + 1) in the coarse grid; note that the root s is placed at the top left corner (1, 1). If node x is at position (i, j) in the coarse grid, then the tree edge from x to its left child is embedded as a vertical path to point (i + 1, j) in the coarse grid. If x also has a right child y, then this edge is embedded as a horizontal path to location (i, w(y) + 1) followed by a vertical path to location (i + 1, w(y) + 1) in the coarse grid. This is illustrated in Figure 7.

w(e) w(e)

s s

w(e)

u

v

e

e

u v

Fig. 7. Embedding a graph on the grid. Edges used in the spanning tree are shown as dashed lines; non-tree edges are solid.

For every non-tree edge e in the tree we can find the number w(e) of non-tree edges enclosed by the unique cycle formed by adding e to the tree. (For edge e = (u, v), w(e) can be computed by finding the least common ancestor y of u and v and determining for each non-tree edge connected to a descendant of y if it is embedded to the right or left of the paths between y and u and v.) For any non-tree edge e = (u, v), note that u and v have degree at most two in the tree T , and thus there is no tree edge attached horizontally adjacent to u or v. The embedding determines if the path representing e should be attached to the east or west sides of u and v. If the embedding goes around a leaf z of the tree T , then the path is routed horizontally from u to a location w(e) fine grid points to the east or west of the column containing z, and vertically down to a point w(e) fine grid points below the level of the leaf of maximum height, and from there horizontally to a point w(e) fine grid points east or west of the column containing v, then vertically to the level of v, and then horizontally to attach to v. If the embedding

not appear to be known if testing if a graph has genus g > 0 can be accomplished in logspace, even for g = 1 [MV00].) Given such an embedding, using [AM04], we can check in logspace if the minimal genus of the graph is 1. We introduce here some terminology and definitions relating to graphs on surfaces. It will be sufficient to give informal definitions of various notions; the interested reader can refer to [MT01] for more rigorous definitions. A closed orientable surface is one that can be obtained by adding handles to a sphere in 3 -space. The genus of the resulting surface is equal to the number of handles added; see also the text [GT87]. Given a graph G, the genus of the graph is the genus of the (closed orientable) surface of least genus on which the graph can be embedded. Given a graph G embedded on a closed orientable surface, and a cycle of the graph embedded on the surface, there are two (possibly intersecting) subgraphs, called the two sides of the cycle with respect to the embedding. Informally, a side of a cycle is the set of vertices of the graph that are path-connected (via a path in the graph, each edge of the graph being considered regardless of direction) to some vertex on the cycle, such that this path does not cross the cycle itself. (In the considerations below, we are concerned only with genus 1 graphs for which this notion of path-connectivity suffices.) A cycle thereby has two sides, which are called the left and the right sides. If the left and right sides of a cycle have nonempty intersection, then we call the cycle a surface- nonseparating cycle. Note that a graph embedded on a sphere (i.e., a planar graph) does not have any surface-nonseparating cycles. Also, it is easy to see that a facial cycle (one that forms the boundary of a face in the embedding of the graph on the surface) cannot be surface-nonseparating. Given a cycle C in an embedded graph, it is easy to check in logspace, if C is surface-nonseparating or not: merely check if there is a vertex v ∈ G, such that v is path-connected to both sides of C (on the embedding).

Lemma 6.1. Let G be a graph of genus g > 0 , and let T be a spanning tree of G_. Then there is an edge_ e ∈ E(G) such that T ∪ {e} contains a surface-nonseparating cycle.

Proof. The proof follows ideas from [Tho90] which introduces the “ 3 -path condition”:

Definition 6.2. Let K be a family of cycles of G as follows. We say that K satisfies the 3 -path condition if it has the following property. If x, y are vertices of G and P 1 , P 2 , P 3 are internally disjoint paths joining x and y , and if two of the three cycles Ci,j = Pi ∪Pj ( 1 ≤ i < j ≤ 3 ) are not in K , then also the third cycle is not in K_._

We quote the following from [MT01].

Proposition 6.3. (Proposition 4. 3. 1 of [MT01]) The family of Π -surface-nonseparating cycles satisfies the 3 -path condition.

Suppose, that ∀e, (T ∪ {e}) does not have a surface-nonseparating cycle. We will prove that no cycle C in the graph G can be surface-nonseparating, by induction on the number k of non-tree edges in C. This contradicts the fact that every non-planar graph has a surface-nonseparating cycle ([MT01, Lemma 4.2.4 and the following discussion]) and thus suffices to prove the claim. The basis (k = 1) follows from the above supposition. For the inductive step from k − 1 to k, let a cycle C be given with k edges not in T.

Take any non-tree edge e = (x, y) on C. Consider the tree path P between x and y. If P never leaves the cycle C, then C is a fundamental cycle and we are done by the assumption for k = 1. Otherwise, we can consider a maximal segment S of P not in C. Let S lie between vertices u and v of C. Now, we have three paths between u and v : the two paths between u and v on C (call these C 1 , C 2 ), and path S. Note that both S ∪ C 1 and S ∪ C 2 have less than k non-tree edges. Hence they are not surface- nonseparating cycles by the induction assumption. So, by the 3 -path condition, neither is C = C 1 ∪ C 2. This completes the induction, and the proof.

At this point we are able to describe how to reduce the s-t-connectivity problem for graphs of genus 1 to the planar case. Given a graph G of genus 1 and an embedding Π of G onto the torus, construct an (undirected) spanning tree T of G. (It follows from [NTS95,Rei05] that spanning trees can be constructed in logspace.) For each edge e of G that is not in T , determine if the unique cycle Ce in T ∪ {e} is surface-nonseparating, as follows. Let Ce = {v 1 , v 2 , · · · , vr }. Let Ge be the graph obtained from G by cutting along the cycle Ce (as described in [MT01, p. 105]). (For the purposes of visualization, it is useful to imagine cycles as embedded on an inner tube. Cutting along a surface- separating cycle amounts to cutting a hole in the inner tube (resulting in two pieces). In contrast, if Ce is surface-nonseparating, then it is embedded either like a ribbon tied around the tube, or like a whitewall painted on the inner tube. In the former case, cut- ting along Ce turns the inner tube into a bent cylinder with a copy of Ce on each end; in the latter case cutting along Ce results in a flat ring with one copy of Ce around the inside and one around the outside. In this latter case, the graph is again topolog- ically equivalent to a cylinder with a copy of Ce on each side.) More formally, the graph Ge has two copies of each of the vertices {v 1 , v 2 , · · · , vr }, which we denote by {v 1 , 1 , v 2 , 1 , · · · , vr, 1 }, and {v 1 , 2 , v 2 , 2 , · · · , vr, 2 }. For every edge (u, vj ) (or (vj , u)) on the right side of Ce (according to Π), Ge has the edge (u, vj, 1 ) ((vj, 1 , u), respectively), and for every edge (u, vj ) ((vj , u),respectively) on the left side of Ce we have the edge (u, vj, 2 ) (or (vj, 2 , u)) in Ge. The graph Ge also has two copies of the cycle Ce, which we denote by Ce, 1 and Ce, 2. That is, we have edges between vj,b and vj+1,b for each b ∈ { 1 , 2 } and each 1 ≤ j ≤ r, directed as in Ce. An important property of cutting along the cycle Ce is that if Ce was surface-nonseparating, then the resulting graph Ge is planar, and the the cycles Ce, 1 and Ce, 2 are facial cycles ([MT01, p. 106,Lemma 4.2.4]). (Otherwise, Ge will not be planar.) Thus in logspace we can determine if Ce is surface-nonseparating. By Lemma 6.1, we are guaranteed to find a surface-nonseparating cycle by test- ing each edge e that is not in T. The graph Ge does not have the same connectivity properties as G; s and t might have been connected in G but not in Ge. In particular, any directed path in G from s to t that uses edges from both the right and left sides of Ce is not replicated in Ge. As in Section 2, we solve this problem by pasting to- gether copies of the graph Ge, as follows. The operation of “pasting” two copies of Ge together consists of identifying the vertices v 1 , 1 , v 2 , 1 ,... , vr, 1 in one copy with the vertices v 1 , 2 , v 2 , 2 ,... , vm, 2 in the other copy. (Note that this amounts to “sewing together” two copies of the path that were “cut apart” in creating Ge from G.)

it did not make good guesses and aborts. By the properties of the weight function, there will be exactly one path that makes the correct guesses and does not abort.) It suffices now to show that a UL machine can compute the values ck and Σk. Observe first of all that c 1 is easy to compute (by simply walking up and down column 1 from s and counting how many vertices are reachable), and Σ 1 = 0. Assuming that the values ck and Σk are available, the numbers ck+1 and Σk+1 can be computed as follows. Initialize ck+1 and Σk+1 to zero. For each vertex v in column k + 1, for each edge of the form x → y to a vertex y in column k + 1 such that there is a path in column k + 1 from y to v, if x ∈ Ck via a minimal-weight path of weight wx, then compute the weight w′ x of the path to v through x. Let wv be the minimum of all such x. Increment ck+1 by one (to indicate that v is reachable) and increase Σk+ by wv. (This algorithm is actually more general than necessary; it is easy to show that the minimal-weight path to v will always be given by the “topmost” vertex x ∈ Ck for which there is an edge x → y to a vertex y that can reach v in column k + 1.) This completes the proof.

We observe that we have shown that a UL algorithm can also determine if there is not a path from s to t, and thus LGGR is in UL ∩ coUL.

Acknowledgments

We acknowledge many people for sharing with us their thoughts about what was al- ready known about this problem, including David Mix Barrington, Til Tantau, Omer Reingold, Paul Beame, Pierre McKenzie, Jeff Edmunds, Anna Gal, Vladimir Trifonov, K.V. Subrahmanyam, Meena Mahajan, and Tanmoy Chakraborty. The first and third authors acknowledge the support of NSF Grant CCF-0514155. We also acknowledge the helpful comments provided to us by the program committee.

References

[AM04] Eric Allender and Meena Mahajan. The complexity of planarity testing. Information and Computation , 189:117–134, 2004. [ARZ99] E. Allender, K. Reinhardt, and S. Zhou. Isolation, matching, and counting: Uniform and nonuniform upper bounds. Journal of Computer and System Sciences , 59(2):164– 181, 1999. [Bar02] David A. Mix Barrington. Grid graph reachability problems. Talk presented at Dagstuhl Seminar on Complexity of Boolean Functions, Seminar number 02121,

[BH91] Samuel R. Buss and Louise Hay. On truth-table reducibility to SAT. Inf. Comput. , 91(1):86–102, 1991. [BK78] Manuel Blum and Dexter Kozen. On the power of the compass (or, why mazes are easier to search than graphs). In IEEE Symposium on Foundations of Computer Sci- ence (FOCS) , pages 132–142, 1978. [BLMS98] David A. Mix Barrington, Chi-Jen Lu, Peter Bro Miltersen, and Sven Skyum. Searching constant width mazes captures the AC^0 hierarchy. In 15th International Symposium on Theoretical Aspects of Computer Science (STACS) , number 1373 in Lecture Notes in Computer Science, pages 73–83. Springer, 1998.

[BST93] Harry Buhrman, Edith Spaan, and Leen Torenvliet. The relative power of logspace and polynomial time reductions. Computational Complexity , 3:231–244, 1993. [Ete97] Kousha Etessami. Counting quantifiers, successor relations, and logarithmic space. Journal of Computer and System Sciences , 54(3):400–411, Jun 1997. [GT87] Jonathan Gross and Thomas Tucker. Topological Graph Theory. John Wiley and Sons, New York, 1 edition, 1987. [HRS93] Magn´us Halld´orsson, Jaikumar Radhakrishnan, and K. V. Subrahmanyam. Directed vs. undirected monotone contact networks for threshold functions. In IEEE Sympo- sium on Foundations of Computer Science (FOCS) , pages 604–613, 1993. [Imm88] N. Immerman. Nondeterministic space is closed under complementation. SIAM Jour- nal on Computing , 17:935–938, 1988. [JLR01] A. Jakoby, M. Liskiewicz, and R. Reischuk. Space efficient algorithms for series- paralle graphs. In 18th International Symposium on Theoretical Aspects of Computer Science (STACS) , number 2010 in Lecture Notes in Computer Science, pages 339–

  1. Springer, 2001. To appear in J. Algorithms. [Lan97] Klaus-J¨orn Lange. An unambiguous class possessing a complete set. In 14th Inter- national Symposium on Theoretical Aspects of Computer Science (STACS) , number 1200 in Lecture Notes in Computer Science, pages 339–350. Springer, 1997. [LL76] R. Ladner and N. Lynch. Relativization of questions about log space reducibility. Mathematical Systems Theory , 10:19–32, 1976. [MT01] Bojan Mohar and Carsten Thomassen. Graphs on surfaces. John Hopkins University Press, Maryland, 1 edition, 2001. [MV00] Meena Mahajan and Kasturi R. Varadarajan. A new NC-algorithm for finding a per- fect matching in bipartite planar and small genus graphs. In ACM Symposium on Theory of Computing (STOC) , pages 351–357, 2000. [NTS95] N. Nisan and A. Ta-Shma. Symmetric Logspace is closed under complement. Chicago Journal of Theoretical Computer Science , 1995. [RA00] K. Reinhardt and E. Allender. Making nondeterminism unambiguous. SIAM Journal of Computing , 29:1118–1131, 2000. [Rei05] O. Reingold. Undirected st-connectivity in log-space. In Proceedings 37th Symposium on Foundations of Computer Science , pages 376–385. IEEE Computer Society Press,

[Sze88] R. Szelepcs´enyi. The method of forced enumeration for nondeterministic automata. Acta Informatica , 26:279–284, 1988. [Tho90] C. Thomassen. Embeddings of graphs with no short noncontractible cycles. J. Comb. Theory Ser. B , 48(2):155–177, 1990.