<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Depth-first search in directed planar graphs, revisited</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>08/01/2022</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10351682</idno>
					<idno type="doi">10.1007/s00236-022-00425-1</idno>
					<title level='j'>Acta Informatica</title>
<idno>0001-5903</idno>
<biblScope unit="volume">59</biblScope>
<biblScope unit="issue">4</biblScope>					

					<author>Eric Allender</author><author>Archit Chauhan</author><author>Samir Datta</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[We present an algorithm for constructing a depth-first search tree in planar digraphs; the algorithm can be implemented in the complexity class AC 1 (UL∩co-UL), which is contained in AC 2 . Prior to this (for more than a quarter-century), the fastest uniform deterministic parallel algorithm for this problem had a runtime of O(log 10 n) (corresponding to the complexity class AC 10 ⊆ NC 11 ). We also consider the problem of computing depth-first search trees in other classes of graphs and obtain additional new upper bounds.
PrefaceKlaus-Jörn Lange has made fundamental contributions to the study of subclasses of NC (such as [20,25]) and he also was one of the first to identify subtleties in the formulation of unambiguity in the logspace setting [13] and he contributed to our understanding of unambiguous computation [5,[30][31][32].In our contribution to the celebration of Klaus-Jörn Lange's work, we bring together these two research threads, in order to give a better understanding of the computational complexity of constructing depth-first search trees in planar digraphs.
B Eric Allender]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>Depth-first search trees (DFS trees) constitute one of the most useful items in the algorithm designer's toolkit, and for this reason, they are a standard part of the undergraduate algorithmic curriculum around the world. When attention shifted to parallel algorithms in the 1980s, the question arose of whether NC algorithms for DFS trees exist. An early negative result was that the problem of constructing the lexicographically least DFS tree in a given digraph is complete for P <ref type="bibr">[34]</ref>. But soon thereafter significant advances were made in developing parallel algorithms for DFS trees, culminating in the RNC 7 algorithm of Aggarwal, Anderson, and Kao <ref type="bibr">[1]</ref>. This remains the fastest parallel algorithm for the problem of constructing DFS trees in general graphs, in the probabilistic setting, or in the setting of non-uniform circuit complexity. It remains unknown if this problem lies in (deterministic) NC (and we do not solve that problem here).</p><p>More is known for various restricted classes of graphs. For directed acyclic graphs (DAGs), the lexicographically least DFS tree from a given vertex can be computed in AC<ref type="foot">foot_0</ref>  <ref type="bibr">[16]</ref>. (See also <ref type="bibr">[9,</ref><ref type="bibr">17,</ref><ref type="bibr">19,</ref><ref type="bibr">22,</ref><ref type="bibr">23,</ref><ref type="bibr">33]</ref>.) For undirected planar graphs, an AC 1 algorithm for DFS trees was presented by Hagerup <ref type="bibr">[21]</ref>. For more general planar directed graphs, Kao and Klein presented an AC 10 algorithm. Kao subsequently presented an AC 5 algorithm for DFS in strongly connected planar digraphs <ref type="bibr">[27]</ref>. In stating the complexity results for this prior work in terms of complexity classes (such as AC 1 , AC 10 ), we are ignoring an aspect that was of particular interest to the authors of this earlier work: minimizing the number of processors. This is because our focus is on classifying the complexity of constructing DFS trees in terms of complexity classes. Thus, if we reduce the complexity of a problem from AC 10 to AC 2 , then we view this as a significant advance, even if the AC 2 algorithm uses many more processors (so long as the number of processors remains bounded by a polynomial). Indeed, our algorithms rely on the logspace algorithm for undirected reachability <ref type="bibr">[35]</ref>, which does not directly translate into a processor-efficient algorithm. We suspect that our approach can be modified to yield a more processor-efficient AC 3 algorithm, but we leave that for others to investigate.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.1">Our contributions</head><p>First, we observe that, given a DAG G, computation of a DFS tree in G logspace-reduces to the problem of reachability in G. Thus, for general DAGs, computation of a DFS tree lies in NL, and for planar DAGs, the problem lies in UL &#8745; co-UL <ref type="bibr">[12,</ref><ref type="bibr">38]</ref>. For classes of graphs where the reachability problem lies in L, so does the computation of DFS trees. One such class of graphs is planar DAGs with a single source (see <ref type="bibr">[2]</ref>, where this class of graphs is called SMPDs, for Single-source, Multiple-sink, Planar DAGs).</p><p>For undirected planar graphs, it was shown in <ref type="bibr">[4]</ref> that the approach of Hagerup's AC 1 DFS algorithm <ref type="bibr">[21]</ref> can be adapted in order to show that construction of a DFS tree in a planar undirected graph logspace-reduces to computing the distance between two nodes in a planar digraph. Since this latter problem lies in UL &#8745; co-UL (see Theorem 1), so does the problem of DFS for planar undirected graphs.</p><p>Our main contribution in the current paper is to show that a more sophisticated application of the ideas in <ref type="bibr">[21]</ref> leads to an AC 1 (UL &#8745; co-UL) algorithm for construction of DFS trees in planar directed graphs. (That is, we show DFS trees can be constructed by unbounded fan-in log-depth circuits that have oracle gates for a set in UL &#8745; co-UL.) 1 Since UL &#8838; NL &#8838; SAC 1 &#8838; AC 1 , the AC 1 (UL &#8745; co-UL) algorithm can be implemented in AC 2 . Thus this is a significant improvement over the best previous parallel algorithm for this problem: the AC 10 algorithm of <ref type="bibr">[28]</ref>, which has stood for 28 years.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">Preliminaries</head><p>We assume that the reader is familiar with depth-first search trees (DFS trees), but we provide a few reminders here, to establish the conventions that we will follow.</p><p>Given any node r in a directed graph G, a depth-first traversal of G starting at r is a traversal of all of the nodes reachable in G from r obtained by starting with r as the only node on a stack, and repeating the following steps until the stack is empty: (1) Pop a node v off the stack and ignore it if it has already been visited. <ref type="bibr">(2)</ref> Otherwise mark it as visited, and push all unvisited out-neighbors of v onto the stack. Different depth-first traversals of G result if the out-neighbors of v are placed onto the stack in different orders. Each depth-first traversal gives rise to a depth-first search tree (namely, the directed tree rooted at r where the children of each node v are the out-neighbors x of v having the property that when x is first marked visited, x has no in-neighbor other than v that has been marked as visited). Of course, given a depth-first search tree T , it is possible to traverse T in an order that is not a depth-first traversal of G. Thus, it is more correct to say that we are constructing a depth-first traversal of G, but we follow the established convention by abusing notation and referring to depth-first search trees (DFS trees) and depth-first traversals interchangeably throughout the paper.</p><p>In this paper, a DFS tree is always a directed rooted tree as detailed above. On the other hand, when we call a digraph a tree (as opposed to a DFS tree), we mean only that the underlying undirected graph forms a connected acyclic graph. Similarly, if the underlying undirected graph is acyclic, the directed graph is said to be a forest, and when we refer to the k-connected components of G, we are referring to the subgraphs of G corresponding to the k-connected components of the underlying undirected graph.</p><p>A graph embedded in the plane with no edge crossings is called a plane graph. A graph is planar if it can be so embedded in the plane. Any (directed) cycle C in a plane graph divides the plane into two connected regions: the interior and the exterior. Any vertex not on C that is embedded in the interior region is said to be enclosed by C. We shall have opportunity to speak of colored graphs; when we say that v is immediately enclosed by the colored cycle C, it means that v is enclosed by C and there is no other colored cycle C enclosing v whose interior is a subset of the interior of C. A subgraph H is strictly enclosed by C if no edge of H lies on C and every edge of H (except possibly its endpoints) is embedded in the interior of C.</p><p>We further assume that the reader is familiar with the standard complexity classes L, NL and P (see, e.g., the text <ref type="bibr">[8]</ref>). We will also make frequent reference to the logspace-uniform circuit complexity classes NC k and AC k . NC k is the class of problems for which there is a logspaceuniform family of circuits {C n } consisting of AND, OR, and NOT gates, where the AND and OR gates have fan-in two and each circuit C n has depth O(log k n). (The logspace-uniformity condition implies that each C n has only n O (1) gates.) AC k is defined similarly, although the AND and OR gates are allowed unbounded fan-in. An equivalent characterization of AC k is in terms of concurrent-read concurrent-write PRAMs with running time O(log k n), using n O (1) processors. For more background on these circuit complexity classes, see, e.g., the text <ref type="bibr">[41]</ref>.</p><p>A non-deterministic Turing machine is said to be unambiguous if, on every input x, there is at most one accepting computation path. If we consider logspace-bounded non-deterministic Turing machines, then unambiguous machines yield the class UL. A set A is in co-UL if and only if its complement lies in UL.</p><p>The construction of DFS trees is most naturally viewed as a function that takes a graph G and a vertex v as input and produces as output an encoding of a DFS tree in G rooted at v. But the complexity classes mentioned above are all defined as sets of languages, instead of as sets of functions. Since our goal is to place DFS tree construction into the appropriate complexity classes, it is necessary to discuss how the complexity of functions fits into the framework of complexity classes.</p><p>When C is one of {L, P}, it is fairly obvious what is meant by " f is computable in C"; the classes of logspace-computable functions and polynomial-time-computable functions should be familiar to the reader. However, the reader might be less clear as to what is meant by " f is computable in NL." As it turns out, essentially all of the reasonable possibilities are equivalent. Let us denote by FNL the class of functions that are computable in NL; it is shown in <ref type="bibr">[24]</ref> each of the three following conditions is equivalent to " f &#8712; FNL."</p><p>1. f is computed by a logspace machine with an oracle from NL. 2. f is computed by a logspace-uniform NC 1 circuit family with oracle gates for a language in NL. 3. f (x) has length bounded by a polynomial in |x|, and the set {(x, i, b)</p><p>is b} is in NL.</p><p>Rather than use the unfamiliar notation "FNL," we will abuse notation slightly and refer to certain functions as being "computable in NL."</p><p>The proof of the equivalence above relies on the fact that NL is closed under complement. Thus, it is far less clear what it should mean to say that a function is "computable in UL" since it remains an open question if UL is closed under complement (although it is widely conjectured that UL = NL) <ref type="bibr">[7,</ref><ref type="bibr">36]</ref>). However, the proof from <ref type="bibr">[24]</ref> carries over immediately to the class UL &#8745; co-UL. That is, the following conditions are equivalent:</p><p>1. f is computed by a logspace machine with an oracle from UL &#8745; co-UL. 2. f is computed by a logspace-uniform NC 1 circuit family with oracle gates for a language in UL &#8745; co-UL. 3. f (x) has length bounded by a polynomial in |x|, and the set {(x, i, b)</p><p>Thus, if any of those conditions hold, we will say that " f is computable in UL &#8745; co-UL."</p><p>The important fact that the composition of two logspace-computable functions is also logspace-computable (see, e.g., <ref type="bibr">[8]</ref>) carries over with an identical proof to the functions computable in L C for any oracle C. Thus, the class of functions computable in UL &#8745; co-UL is also closed under composition. We make implicit use of this fact frequently when presenting our algorithms. For example, we may say that a colored labeling of a graph G is computable in UL &#8745; co-UL, and that, given such a colored labeling, a decomposition of the graph into layers is also computable in logspace, and furthermore, that-given such a decomposition of G into layers-an additional coloring of the smaller graphs is computable in UL &#8745; co-UL, etc. The reader need not worry that a logspace-bounded machine does not have adequate space to store these intermediate representations; the fact that the final result is also computable in UL &#8745; co-UL follows from closure under composition. In effect, the bits of these intermediate representations are re-computed each time we need to refer to them.</p><p>The following theorem, due to <ref type="bibr">[39]</ref>, gives an important example of a function that is computable in UL &#8745; co-UL.</p><p>Theorem 1 <ref type="bibr">[39]</ref> The function that takes as input a directed planar graph G and two vertices x and y and produces as output the length of the shortest path from x to y lies in UL &#8745; co-UL.</p><p>Proof <ref type="bibr">Thierauf and Wagner [39,</ref><ref type="bibr">Section 4]</ref> show that the techniques of <ref type="bibr">[2,</ref><ref type="bibr">12,</ref><ref type="bibr">36]</ref> can be combined to show that distance in planar graphs can be computed in UL &#8745; co-UL, by reducing the computation of distance to the planar reachability problem.</p><p>More precisely, Thierauf and Wagner observe that, given a planar graph G, the argument in <ref type="bibr">[2]</ref> shows how to produce a grid graph G with certain edges labeled as "distinguished," with the property that every path p between two vertices in G can be associated with a unique path p in G , where furthermore the length of the path p is equal to the number of "distinguished" edges in p . (Essentially, edges in G are mapped to paths in G , and some of the edges in G are marked as corresponding to "real" edges in G.) They then show that a modification of the weight function from <ref type="bibr">[12]</ref> has the property that, given the weight of a path in G , one can easily determine the number of "distinguished" edges in the path and thereby determine the distance between two vertices in G.</p><p>Finally, we will consider AC k circuits augmented with oracle gates for an oracle in UL &#8745; co-UL, which we denote by AC k (UL &#8745; co-UL).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">DFS in DAGs logspace-reduces to reachability</head><p>In this section, we observe that constructing the lexicographically least DFS tree in a (notnecessarily planar) DAG G can be done in logspace given an oracle for reachability in G.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>But first, let us define what we mean by the lexicographically least DFS tree in G:</head><p>Definition 2 Let G be a DAG, with some ordering on the neighbors of each vertex. (For example, with adjacency lists, we can consider the ordering in which the neighbors are presented in the list. But we will also need to consider different orderings.) For any such ordering, the lexicographic-least DFS traversal of G is the traversal done by Algorithm 1.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Input: (G, v)</head><p>Output: Sequence of edges in DFS tree visited[v] &#8592; 1 visited[w] &#8592; 0 for all w = v for every out neighbor w of v, in the given order do if visited[w] = 0 then print(v, w) DF S(G, w) end end Algorithm 1: Static DFS routine That is, the lexicographically least DFS tree is merely a DFS tree, but with the (very natural) condition that the children of every vertex are explored in the given order. Importantly, when we apply this procedure as part of our algorithm for DFS in planar graphs, the ordering on the neighbors of v will be determined dynamically. (Note that in the algorithm that defines the lexicographically least DFS traversal, no reference is made to the ordering of the neighbors of v until it is visited; thus, it causes no problems if this ordering is not determined until that time.) Also, we will need to apply our algorithm to directed acyclic multigraphs (i.e., graphs with parallel edges between vertices) where there is a logspace-computable function f (v, e) that computes the ordering of the neighbors of vertex v, assuming that v is entered using edge e-where e can also be "null" if v is the root of the traversal. (That is, if the DFS tree visits vertex v from vertex x, and there are several parallel edges from x to v, then the ordering of the neighbors of v may be different, depending on which edge is followed from x to v.) <ref type="foot">2</ref>As is observed in <ref type="bibr">[16]</ref>, the unique path from s to another vertex v in the lexicographically least DFS tree in G rooted at s is the lexicographically least path in G from s to v. <ref type="foot">3</ref>Now consider the following simple algorithm for constructing the lexicographically least path in a DAG G from s to v, shown in Algorithm 2: The correctness of this algorithm is essentially shown by the proof of Theorem 11 of <ref type="bibr">[16]</ref>. The algorithm for computing the lexicographically least DFS tree rooted at s can thus be presented as the composition of two functions g and h, where g(G, s) = (G, s, L), where L is a list, containing the lexicographically least path from s to each vertex v. Note that the set of edges in the DFS tree in G rooted at s is exactly the set of edges that occur in the list L in g(G, s) = (G, s, L). Then, h(G, s, L) is just the result of removing from G each edge that does not appear in L. The function h is computable in logspace, whereas g is computable in logspace with an oracle for reachability in G.</p><p>As discussed in Sect. 2, a DFS tree is not only a list of edges; one must also know the order in which to explore the children of a node. Given a node v with children x and y, in order to determine whether x should be visited prior to y, one can simply compute the lexicographically least path from s to x and from s to y, and compare.</p><p>Since reachability in DAGs is a canonical complete problem for NL, we obtain the following corollary:</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Corollary 3 Construction of lexicographically least DFS trees for DAGs lies in NL.</head><p>Similarly, since reachability in planar directed (not-necessarily acyclic) graphs lies in UL &#8745; co-UL <ref type="bibr">[12,</ref><ref type="bibr">38]</ref>, we obtain:</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Corollary 4 Construction of lexicographically least DFS trees for planar DAGs lies in UL &#8745; co-UL.</head><p>A planar DAG G is said to be an SMPD if it contains at most one vertex of in-degree zero. Reachability in SMPDs is known to lie in L <ref type="bibr">[2]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Corollary 5 Construction of lexicographically least DFS trees for SMPDs lies in L.</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Overview of the algorithm</head><p>The main algorithmic insight that led us to the algorithm in this paper was a generalization of the layering algorithm that Hagerup developed for undirected graphs <ref type="bibr">[21]</ref>. We show that this approach can be modified to yield a useful decomposition of directed graphs, where the layers of the graph have a restricted structure that can be exploited. More specifically, the strongly connected components of each layer are what we call meshes; we exploit the properties of meshes to construct paths (which will end up being paths in the DFS trees we construct) whose removal partitions the graph into significantly smaller strongly connected components.</p><p>The high-level structure of the algorithm is thus:</p><p>1. Construct a planar embedding of G.</p><p>2. Partition the graph G into layers (each of which is surrounded by a directed cycle).</p><p>3. Identify one such cycle C that has properties that will allow us to partition the graph into smaller weakly connected components. 4. Depending on which properties C satisfies, create a path p from the exterior face either to a vertex on C or to one of the meshes that reside in the layer just inside C. Removal of p partitions G into weakly connected components, where each strongly connected component therein is smaller than G by a constant factor. 5. Let the vertices on this path p be v 1 , v 2 , . . . , v k . The DFS tree will start with the path p and append DFS trees for subgraphs G 1 , G 2 , . . . , G k to this path, where G i consists of all of the vertices that are reachable from v i that are not reachable from v j for any j &gt; i.</p><p>(This is obviously a tree, and it will follow that it is a DFS tree.) Further, decompose each G i into a DAG of strongly connected components. Build a DFS tree of that DAG, and then work on building DFS trees of the remaining (smaller) strongly connected components. 6. Each of the steps above can be accomplished in UL &#8745; co-UL, which means that there is an AC 0 circuit with oracle gates from UL &#8745; co-UL that takes G as input and produces the list of much smaller graphs G 1 , . . . , G k , as well as the path p that forms the spine of the DFS tree. We now recursively apply this procedure (in parallel) to each of these smaller graphs. The construction is complete after O(log n) phases, yielding the desired AC 1 (UL &#8745; co-UL) circuit family.</p><p>In the exposition below, we first layer the graph in terms of clockwise cycles (which we will henceforth call red cycles), and obtain a decomposition of the original graph into smaller pieces. We then apply a nested layering in terms of counterclockwise cycles (which we will henceforth call blue cycles); ultimately we decompose the graph into units that are structured as a DAG, which we can then process using the tools from Sect. 3. The more detailed presentation follows.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1">Degree reduction and expansion</head><p>Definition 6 (of Exp (G) and Exp (G)) Let G be a plane digraph. The "expanded" digraph Exp (G) (respectively, Exp (G)) is formed by replacing each vertex v of total degree d(v) &gt; 3 by a clockwise (respectively, counterclockwise) cycle C v on d(v) vertices, where the d(v) edges incident on v now connect to the d(v) vertices on C v (so that each of those vertices now has degree 3), respecting the cyclic ordering of edges around v.</p><p>We will also find it useful to refer to the process of converting Exp (G)</p><p>Exp (G) and Exp (G) each have maximum degree bounded by 3, i.e., they are subcubic. Next, we define the clockwise (and counterclockwise) dual for such a graph and also a notion of distance.</p><p>Recall that for an undirected plane graph H , the dual (multigraph) H * is formed by placing, for every edge e &#8712; E(H ), a dual edge e * between the face(s) on either side of e (see Section 4.6 from <ref type="bibr">[18]</ref> for more details). Faces f of H and the vertices f * of H * correspond to each other as do vertices v of H and faces v * of H * . There is also a well-studied notion of duality for directed plane graphs. The graph that is called the dual of a directed graph in sources such as <ref type="bibr">[10,</ref><ref type="bibr">11,</ref><ref type="bibr">26,</ref><ref type="bibr">29]</ref> corresponds to the edges of weight one in what we define below as the clockwise dual of G; for technical reasons we also include additional edges (in the reverse direction) of weight zero, and we also make use of a counterclockwise dual: Definition 7 (of Duals G and G ) Let G be a plane digraph. Then, the clockwise dual G (respectively, counterclockwise dual G ) is a weighted bidirected version of the undirected dual of the underlying undirected graph of G. If e is an edge in G with faces f and g to the left and right, respectively (in the direction of travel on e), then there is an edge with weight one in G that is oriented from f * to g * (thus corresponding to rotating e 90 degrees in a clockwise direction). The edge in the other direction, from g * to f * , receives weight zero. (The weights in G are the opposite, with the weight one edge resulting from a counterclockwise rotation, and the other direction having weight zero.). We inherit the definition of dual vertices and faces from the underlying undirected dual.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Definition 8</head><p>Let G be a plane subcubic graph, and let f and g be faces of G. Define d ( f , g) to be the weight of the minimal-weight path from f * to g * in G . We define d ( f , g) similarly.</p><p>Definition 9 For a plane subcubic digraph G, let f 0 be the external face. Define the type type ( f ) (respectively, type ( f )) of a face to be the singleton set {d ( f 0 , f )} (respectively, {d ( f 0 , f )}). Generalize this to edges e by defining type (e) (respectively, type (e)) as the set consisting of the union of the type (respectively, type ) of the two faces adjacent to e. Also, for a vertex v, define type (v) (respectively, type (v)) to be the union, over all faces f incident on v, of type ( f ) (respectively, type ( f )).</p><p>It is easy to see by definition of the duals that the types of adjacent faces can differ by at most one, and hence, no vertex can be adjacent to faces with three distinct types. We formalize this in the lemma below:</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Lemma 10 In every subcubic graph G, the cardinality |type (x)|, |type (x)| where x is a face, edge or a vertex is at least one and at most 2 and in the latter case consists of consecutive non-negative integers.</head><p>Further</p><p>Proof We first observe that if ( f 1 , f 2 ) is a dual edge with weight 1, then by the triangle inequality we have,</p><p>of a subcubic graph is incident on at most 3 faces the only case in which |type (v)| &gt; 2 corresponds to three distinct faces f 1 , f 2 , f 3 being incident on a vertex. But here the undirected dual edges form a triangle such that in the directed dual the edges with weight 1 are oriented either as a cycle or acyclically. In the former case by three applications of the above inequality, we get that</p><p>In the latter case, suppose the edges of weight 1 are</p><p>), then by the above inequality again we get: We will see later how to apply both the duals in G to get red and blue layerings of a given input graph.</p><p>We enumerate some properties of red(G) and blue(G), where G is subcubic:</p><p>Red vertices and edges in red(G) form disjoint clockwise cycles.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">No clockwise cycle in red(G) consists of only white edges (and hence white vertices). Similar properties hold for blue(G).</head><p>Proof 1. Firstly, note that a red edge must have red endpoints, as they are adjacent to the same faces that the edge between them is adjacent to. It is immediate from Lemma 10 that if v is a red vertex, it has exactly one red incoming edge and one red outgoing edge, proving that they form disjoint cycles. Now consider a red cycle C. The type of each edge of C must be the same, since if there are two consecutive edges in C of different types, it would make the common vertex adjacent to at least three vertices of different types contradicting Lemma 10. This means that the distance in G of each face bordering the "outside" of C from the external face is one less than the distance of each face bordering the "inside" of C. But in any counterclockwise cycle, the distance in G from the external face to both sides of C are the same (by the way distances are defined in G ). Thus, C is clockwise.</p><p>2. Suppose C is a clockwise cycle. Consider the shortest path in G from the external face to a face enclosed by C. From the Jordan curve theorem (Theorem 4.1.1 <ref type="bibr">[18]</ref>), it must cross the cycle C. The edge dual to the crossing must be red.</p><p>The definitions above, which apply only to subcubic plane graphs, can now be extended to a general plane graph G, by considering the subcubic graphs Exp (G) (and Exp (G)). But first, we must make a simple observation about red(Exp (G)) (respectively, about blue(Exp (G))).</p><p>Lemma 13 Let v &#8712; V (G) be a vertex of degree more than 3. Let C v be the corresponding expanded cycle in Exp (G). Suppose at least one edge of C v is white in red(Exp (G)). Then, there is a unique red cycle C that shares edges with C v .</p><p>Proof First we note that C v does not contain anything inside it since it is an expanded cycle. By Lemma 12, we know that C v has at least one red edge. Suppose it shares one or more edges with a red cycle R 1 . Since both cycles are clockwise and C v has nothing inside, the cycle R 1 must enclose C v . Now suppose there is another red cycle R 2 that shares one or more edges with C v . Then, R 2 must also enclose C v . But two cycles cannot enclose a cycle while sharing edges with it without touching each other, which contradicts the above lemma that all red cycles in a subcubic graph are vertex disjoint.</p><p>The last two lemmas allow us to consistently contract the red cycles in red(Exp (G)), in order to obtain a colored version of G which we call Col (G). We make this more precise in the following: Definition 14 The colored graph Col (G) (respectively, Col (G)) is obtained by labeling a vertex v &#8712; V (G) having degree more than 3 as red iff the cycle C v in red(Exp (G)) has at least one red edge and at least one white edge. Otherwise, the color of v is white. <ref type="foot">4</ref> All the edges of G, and all of the vertices of G having degree &#8804; 3 inherit their colors from red(Exp (G)). The coloring of Col (G) is similar.</p><p>We can now characterize the colorings in the graph Col (G):</p><p>Lemma <ref type="bibr">15</ref> The following hold:</p><p>is not connected via a red edge to any vertex in its interior. <ref type="foot">5</ref></p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Every 2-connected component of the red subgraph of Col (G) is a simple clockwise cycle.</head><p>Proof Both parts of the lemma follow, if we can establish that the red subgraph of Col (G) consists of a collection of connected components, each of which is a remnant of exactly one red cycle in red(Exp (G)), where furthermore, each connected component consists of a collection of red cycles that intersect at cut vertices (as illustrated in Fig. <ref type="figure">5</ref>). Recall that Col (G) results from taking the subcubic graph Exp (G) and contracting each cycle C v where v is a vertex in G of degree &gt; 3. The red subgraph of red(Exp (G)) consists of disjoint cycles, by Lemma 12. Contracting any cycle C v in red(Exp (G)) does not increase common cut-vertex v. Furthermore, for any other C x that contains edges from R, after C v is contracted, C x now shares edges with exactly one of the cycles R i . (This is because C x is embedded inside R. If it is possible to start at a vertex in C v &#8745; R, and travel to C x and then back to C v , it follows that C x is embedded in the closed region between R and C v . When C v is contracted, that segment of R becomes one of the cycles R i , and C x is embedded inside it.) Thus, when C x is contracted, R i in turn is transformed into a collection of cycles with x as a cut vertex. Inductively, this establishes the claim that, in turn, completes the proof of the lemma.</p><p>Although the above lemmas have been proved for the clockwise dual, they also hold for counterclockwise dual with red replaced by blue.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.2">Layering the colored graphs</head><p>Definition 16 Let x &#8712; V (Col (G))&#8746;E(Col (G)). Let (x) be one more than the minimum integer that occurs in type (x ), for each We had already noted above that the red subgraph of G had simple clockwise cycles as its 2-connected components. We note a few more lemmas about the structure of a layer of G:</p><p>Lemma <ref type="bibr">18</ref> We have:</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">A red cycle in a layer L k+1 (Col (G)) does not contain any vertex/edge of the same layer inside it. 2. Any clockwise cycle in a layer consists of only red vertices and edges. Dually, a blue cycle in a layer does not contain any vertex or edge of the same layer inside it.</head><p>Remark <ref type="bibr">19</ref> Notice that the conclusion in the second part of the lemma fails to hold if we allow cycles spanning more than one layer.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Proof</head><p>The first part is a direct consequence of Proposition 17. For the second part, we mimic the proof of the second part of Lemma 12. Consider a clockwise cycle C &#8838; L k+1 (Col (G)) that contains a white edge e. Every face adjacent to C from the outside must have type = {k} because C is contained in layer k + 1. Then, the type of the faces on either side of e is the same and therefore must be {k}. Let f be a face enclosed by C that has type ( f ) = {k}. Thus, it must be adjacent to a face of type = {k -1}. But this contradicts that every face inside and adjacent to C must have type = {k } for k &#8805; k.</p><p>The lemmas above show that the strongly connected components of the red subgraph of a layer consist of red cycles touching each other without nesting, in a tree like structure. This prompts the following definition: where R &#8838; L k (Col (G)) is the red cycle immediately enclosing x. In this case, we say that x belongs to sublayer L k+1,l+1 (Col(G)).</p><p>Moreover, this defines the colored graph Col(G) by giving x the color red if it is red in Col (G), and also giving x the color blue if it is blue in Col (G R ). (Notice it could be both red and blue). The vertex x is white if it is white in both Col (G R ) and Col (G R ).</p><p>By Proposition 17, we can also say that a sublayer L k+1,l+1 (Col(G)) thus consists of edges/vertices that are strictly enclosed inside k red cycles and inside l blue cycles that are contained inside the red cycle that immediately encloses them.</p><p>We now present some observations and lemmas regarding the structure of a sublayer. Since every edge/vertex in L k+1,l+1 (Col(G)) has the same red and blue layer number, it is clear that there can be no nesting of colored cycles. Also we have:</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Lemma 22 Every clockwise cycle in a sublayer L k+1,l+1 (Col(G)) consists of all red edges and vertices and any every counterclockwise cycle in the sublayer consists of all blue vertices and edges. (Some edges/vertices of the cycle can be both red as well as blue)</head><p>Proof This is a direct consequence of Lemma 18 applied to the sublayer L k+1,l+1 (Col(G)), which is a (counterclockwise) layer in graph G R for some red cycle R.</p><p>Thus, we can refer to clockwise cycles and counterclockwise cycles as red and blue cycles, respectively.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Definition 23</head><p>For a red or blue colored cycle C of layer L k,l (Col(G)), we denote by G C the graph induced by vertices of L k ,l (Col(G)) enclosed by C, where {k , l } is {k + 1, 1} or {k, l + 1} according to whether C is a red or a blue cycle, respectively.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Note that:</head><p>Proposition 24 Two cycles of the same color in L k+1,l+1 (G) cannot share an edge. This is since neither is enclosed by the other as they belong to the same layer, and as they also have the same orientation. Cycles of different colors can share edges but we note: 123</p><p>We consider the strongly connected components of a sublayer and note the following lemmas regarding them:</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Lemma 26</head><p>The trivial strongly connected components of a sublayer (those that consist of a single vertex) are white vertices. Let H be a non-trivial strongly connected component of a sublayer, and let o be the external face of H . Then, </p><p>By definition of topological sort, all edges across this partition must be directed from A to B; hence, it is a directed cut, and therefore, it must also contain a subset which is a minimal directed cut. But clearly the minimal cut is not the set of edges adjacent to f * since it has both out and in-degree at least one, hence proving the claim. Hence, every face in H must be a directed (hence colored) cycle (by Lemma 22). 3. We observed from the proof above that no vertex in the dual of H , except possibly the vertex o * corresponding to the outer face of H , can have both in-degree and out-degree more than zero (i.e., every dual vertex except o * is a source or a sink). Therefore, if any dual vertex f * has a directed path to o * or vice versa, then the path must be an edge and we are done. Suppose there is no directed path from f * to o * and w.l.o.g. let f * be a source. Consider the trivial directed cut C 1 :</p><p>This is a cut since there are no edges from B to A, and this cut clearly corresponds to the directed cycle which is the boundary of face f in H . Now consider the cut C 2 :</p><p>Clearly, this is a f * -o * cut with no edge from a vertex in A to a vertex in B and o * &#8712; B . But this f * -o * cut is different from C 1 since f * is a source vertex and hence A has at least one more vertex than just f * . Hence, this corresponds to a directed cycle in H that strictly encloses at least some edge of f , and we again get a contradiction of Lemma 18.</p><p>The strongly connected components of a sublayer hence consist of intersecting red and blue facial cycles, with every face having at least one boundary edge adjacent to the outer face of the component.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Definition 27</head><p>We call the strongly connected components of a sublayer L k,l meshes.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Mesh properties</head><p>Definition 28 Given a subgraph H of G embedded in the plane, we define the closure of H , denoted by H , to be the induced graph on the vertices of H together with the vertices of G that lie in the interior of faces of H (except for the outer face of H ).</p><p>For convenience, we call a face of a graph that is not the outer face an internal face. From Lemmas 22 and 26, we have a bijection: every face of a mesh, except possibly its outer face, is a directed cycle, and every directed cycle in a mesh is the boundary of a face of the mesh.</p><p>G is a set of vertices of H whose removal from H separates H into subgraphs, where no strongly connected component has size greater than &#945;|G|. An (&#945;, r ) path separator is a sequence of vertices v 1 , . . . , v n , that is an &#945; separator and also is a directed path. Here, r = v 1 is called the root of the path separator. We will have occasion to omit either or both of &#945;, r when they are clear from the context.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Definition 30</head><p>Let G be a graph and let M be a mesh in a sublayer of G. For an internal face f of M, we define its weight, denoted by w( f ), to be |V ( f )|. Let w(H ) where H is a subgraph of M be defined as |V ( H )|.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Definition 31</head><p>For a mesh M, we call a vertex that is adjacent to the outer face of M an external vertex, and a vertex that is not adjacent to the outer face an internal vertex. We call vertices of degree more than two junction vertices.</p><p>. . , v k-1 are all vertices of degree two, but v 1 , v k have degree more than two 6 , then we call p a segment. We call v k the out junction neighbor of v 1 and v 1 the in junction neighbor of v k .</p><p>We call a segment with all edges adjacent to the outer face an external segment, and a segment with no edge adjacent to the outer face an internal segment. If the end points of an internal segment are both internal vertices also, we call the segment an i-i-segment.</p><p>The rest of this section is devoted to a proof of the following, which asserts that we can construct a path separator in a mesh, assuming that no internal face of the mesh is too large.</p><p>Lemma 32 Suppose w( f ) &lt; w(G)/12 holds for every internal face f of a mesh M that is a subgraph of G. Then, from any external vertex r of M, we can find (in UL &#8745; co-UL) an 11 Fig. <ref type="figure">7</ref> An example of a mesh Fig. <ref type="figure">8</ref> An example of a path separator. The vertex v is a central node, and the green path is a separator</p><p>The high level idea is that using a clique sum decomposition of 2, 3-cliques (see Fig. <ref type="figure">12</ref>) we find a "central" vertex v in the mesh M, such that we can find a path from the external vertex r to v, and then extend the path around one of the faces adjacent to v to get the path separator (all faces are directed cycles by <ref type="bibr">Lemma 26)</ref>. Because every face touches the outer face and the weight of every face is small by the hypothesis of the lemma, we can always find a face adjacent to v to encircle such that removing the path leaves no large (weakly) connected component.</p><p>The vertices of M with degree two (in-degree 1 and out-degree 1 because M is strongly connected) are not important since they can be seen as just "subdivision" vertices. Now we will look at the structure of a mesh around an internal junction vertex, and the way the rest of the mesh is attached to that structure. Also, we state here that we will abuse the notion of 3-connected components by ignoring the non-junction vertices for convenience.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Lemma 33</head><p>If v is an internal junction vertex of a mesh and e 1 , . . . , e k are the edges adjacent to v in the cyclic order of embedding, then the edges alternate in directions, i.e., if e 1 is outgoing from v, then e 2 is incoming to v and e 3 is outgoing and so on. Consequently, v has even degree (at least 4).</p><p>Proof Let e i , e i+1 be two edges adjacent to v, that are also adjacent in the cyclic order of the drawing. Since they are adjacent in the drawing, they must enclose between them, a region, and hence a face, which is not the outer face. But, by Lemma 26, the boundary of every non-outer face in a mesh is a directed cycle, hence v, e i , e i+1 lie on a directed cycle, with both edges adjacent to v. Hence one of them must be an out edge from v, and the other incident toward v.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Definition 34</head><p>Let v be an internal junction vertex of degree 2d in a mesh M, and let its junction neighbors be (u 1 , w 1 , u 2 , w 2 , . . . , u d , w d ) in clockwise order starting from edge u 1 , v (the w i 's are out neighbors, and u i 's the in neighbors, since junction neighbors alternate).</p><p>Every adjacent pair of edges incident to v borders a face that is not the outer face. Let f u,v,w denote the face bordered by v and the junction neighbors u and w of v which are adjacent in cyclic order around v. The boundary of f u,v,w can be written as three disjoint parts (except for endpoints), segment(u, v) + segment(v, w) + petal w,u , where the third part denotes a simple path from w to u along the face boundary. We will use the notation petal w,u to denote the corresponding boundary for any face f u,v,w adjacent to v. We define flower(v) as {vertices on the boundary of faces adjacent to v} (see Fig. <ref type="figure">9</ref>).</p><p>We note the following property of petals.</p><p>Proposition 35 For all adjacent junction neighbor pairs w i , u j of an internal vertex v, petal w i ,u j are disjoint, except possibly the end points.</p><p>Proof Petals of two faces must be internally disjoint because the corresponding faces share the vertex v and two faces cannot have a non-contiguous intersection, by Lemma 25.</p><p>For an internal junction vertex v, the union of the petals around flower(v) thus form an undirected cycle around v, with at least four alternations in directions. Now we define bridges of the cycle, which (roughly) are components of M we get after removing flower(v), leaving the points of attachment intact. We use the formal definition of bridges from <ref type="bibr">[40]</ref>: Definition 36 For a subgraph H of M, a vertex of attachment of H is a vertex of H that is incident with some edge of M not belonging to H . Let J be an undirected cycle of M. We define a bridge of J in M as a subgraph B of M with the following properties:</p><p>1. each vertex of attachment of B is a vertex of J . 2. B is not a subgraph of J . 3. no proper subgraph of B has both the above properties.</p><p>We denote by 2-bridge, bridges with exactly two vertices of attachment to the specified cycle, and by 3-bridge, bridges with three or more vertices of attachment.</p><p>Note that for the cycle formed by petals of flower(v), the vertex v along with paths leading to/ coming from flower(v) also form a bridge, but we call that a trivial bridge and do not take it into consideration.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Lemma 37 1. The vertices of attachment of a 2-bridge of flower(v) must both lie on one</head><p>petal of flower(v).</p><p>2. The vertices of attachment of a 3-bridge of flower(P) can lie on one, or at most two, adjacent petals. Moreover, in the latter case the junction neighbor of v common to both petals must be a vertex of attachment of the 3-bridge. 3. For an internal vertex v, and an external vertex r of M, let p = r , . . . , u 1 , v be a simple path from r to v, where u 1 is an in junction neighbor of v. Let the other junction neighbors of v be named as in Definition 34 in cyclic order from u 1 . For j &#8712; {i, i + 1}, consider an extended path of p, p w i ,u j = r , . . . , u 1 , v, w i + petal w i ,u j + u j , . . . , v , excluding the last edge incident to v in the sequence. That is, p w i ,u j goes from r to v, then to an out junction neighbor w i , and then wraps around f u j ,v,w i by taking petal w i ,u j and then the segment back toward v from u j . If there is a bridge of flower(v) of which u 1 is a point of attachment and which also includes the edge of p incoming to u 1 , we denote it by B in . The set V ( M)\V ( p w i ,u j ) can be partitioned into four disconnected parts, called V left , V right , V f , and V rem , such that:</p><p>&#8746; {vertices in the closure of bridges attached to the petals of these faces, excluding B in } &#8746; {the "left" part of B in (see Fig. <ref type="figure">13</ref>)})\V ( p w i ,u j )</p><p>&#8746; {vertices in the closure of bridges attached to petals of these faces, excluding B in } &#8746; {the "right" part of B in (see Fig. <ref type="figure">13</ref>) }\V ( p w i ,u j )</p><p>V rem = ( {vertices in the closure of all bridges that have vertices of attachment only in petal w i ,u j })\V ( p w i ,u j ).</p><p>There is no undirected path between any vertex of one of these four sets to any vertex of another. The path p w i ,u i is therefore a path separator that gives these components.</p><p>Proof 1. Let x, y be the two vertices of attachment of the 2-bridge B on flower(v). Since bridges are connected graphs without the edges of the corresponding cycle (by the third property of Definition 36), there must be an undirected path, p in the bridge connecting x, y, without using any edge of flower(v). If x and y were not on the same petal, then this path along with the other petals in flower(v), must clearly enclose a junction neighbor of v, say w (see Fig. <ref type="figure">9</ref>). Thus, w is not adjacent to the outer face. Now since w is an internal junction vertex, and two of its adjacent faces are also adjacent to v, look at another face f adjacent to w and not adjacent to v. (Internal junction vertices have at least four adjacent faces.) The boundary of this face cannot touch B since that would make it a part of B and consequently w would be a vertex of attachment of B to flower(v). Therefore the boundary of f is enclosed within the paths p and the part of flower(v) that is also enclosed by p. Therefore f has no external edge, contradicting Lemma 26. 2. Let x 1 , x 2 , . . . , x k be the vertices of attachment of the bridge B on flower(v), in the cyclic order of boundary of flower(v). Clearly, if the vertices of attachment lie on more than two petals of v, then at least one petal will be completely enclosed by B, which is Let us say they lie on two adjacent petals, and the junction neighbor common to both of them is w. By the same argument as above, w must have an edge other than those of adjacent petals of v, that connect it to B. Therefore, w must be a vertex of attachment of B to flower(v). 3. First we note that petal w i ,u j will have an external vertex in it since the boundary of every face has at least one external vertex (Lemma 26), and segments (u j , v) and (v, w i ) are internal. Let z be an external vertex on petal w i ,u j . The path p starts at external vertex r , comes to u 1 , v, w i , and reaches external vertex z on its way back to v. It will clearly divide M into at least two parts by the Jordan curve theorem. Since p w i ,u j is just a wrap around the face f u j ,v,w i after z, it is clear that removing p puts all of the vertices of f u,v,w in one disconnected region, while w 1 , u 2 , . . . , w i-1 and everything connected to them lie in another region, which we call V left , and w i+1 , u i+2 , . . . , w d and everything connected to them lie in yet another (V right ).</p><p>We introduce another notation for an extension of a bridge:</p><p>Definition 38 For a bridge B of flower(v), we define B &#8226; as B along with segments of flower(v) that lie between consecutive vertices of attachment of B. We call this the closed bridge of B. Now we will give definitions/lemmas regarding the "internal structure" of meshes, that will be useful to define the "center" of a mesh.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Definition 39</head><p>For a mesh M, we call its internal-skeleton, denoted by I (M), the induced subgraph on the vertices of i-i-segments of M (see Fig. <ref type="figure">11</ref>).</p><p>Lemma 40 1. For a mesh M, the graph I (M) is a forest.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">If H is a 3-connected induced subgraph of M(ignoring subdivision vertices), then I (H )</head><p>is a tree. Proof 1. Suppose there were an undirected cycle in M of all internal segments, then this cycle must enclose a face whose boundaries are also all internal segments. This contradicts Lemma 26 as it states that every face must have at least one external edge, and hence an external segment. Hence there can be no cycle (directed or undirected) consisting of all internal segments, and consequently, no cycle (directed or undirected) of all internal vertices. 2. Let H be a 3-connected induced subgraph of M. By definition, I (H ) is obtained from M by removing all external edges and external non-junction vertices. Suppose I (H ) is not a tree, and hence consists of two or more disconnected trees. Let T 1 and T 2 be any two trees in I (H ). Let x be a vertex in T 1 and y be a vertex in T 2 . Since H is 3-connected, there must be at least three disjoint paths (undirected) between x and y. Clearly in a plane graph, if there are three disjoint paths between two vertices, one of the paths must be strictly enclosed in the closed region formed by other two. Therefore there must a path between x and y that is strictly enclosed inside the boundary of H , and hence does not contain any edge or vertex adjacent to the outer face of H . Hence x and y cannot become disconnected after removing external edges and external non-junction vertices leading to a contradiction that I (H ) is disconnected. Therefore, I (H ) must be a tree.</p><p>We will next give a procedure to define a "center" of a mesh.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Definition 41</head><p>For a mesh M, let T M denote the tree obtained by the 1, 2-clique sum decomposition of M. The nodes of T M are of two types, clique nodes (cut vertices or separating pairs), and piece nodes, which are either 3-connected parts or cycles. Every piece node is adjacent to a clique node and vice versa. (See [15, Section 3] for background about this decomposition in the special case when the graph is 2-connected. For general planar graphs, we can first identify the cut vertices and find the block cut tree. For every clique node of a cut vertex v that is attached to a piece node of block B containing a 3-connected separating pair, we replace the block B by its triconnected decomposition tree, T B , and attach the clique node of v to a piece node of the triconnected block of T B that contains v).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Proposition 42</head><p>The tree T M defined above is a tree decomposition.</p><p>Proof It is easy to see that every vertex, as well as every edge of the graph occurs in at least one piece node. To see the coherence property, we observe that the only vertices that occur in more than one node are those that are part of a 3-connected separating pair or a cut vertex. If v is such a node and is not a cut vertex then it occurs in a subtree of the biconnected block it belonged to after the block cut decomposition(since the triconnected decomposition is a tree decomposition). If it is a cut vertex, then in our construction, we have joined the subtrees in the triconnected decomposition trees to the clique node of v, which again gives a subtree.</p><p>We will now use a modified version of the tree vertex separator theorem, to show that vertices of one of the nodes of T M form a 1  2 -separator of M. We use the following fact from the proof of <ref type="bibr">[14,</ref><ref type="bibr">Lemma 7.19]</ref>.</p><p>Proposition 43 Let T G be a tree decomposition of a graph G. The vertices of one of the bags of T G from a 1  2 separator of G.</p><p>Now we define the center of a mesh.</p><p>Definition 44 Consider the 1 2 separator node of T M as described in Proposition 43. If it is a separating pair, a cut vertex, or a face cycle, we call that subgraph the center of M.</p><p>If it is a 3-connected node P, look at its internal skeleton I (P). We construct a new graph I (P) which is isomorphic to I (P) but has edges directed differently. Let u, v be two adjacent internal junction vertices of M. To give direction to a segment(u, v) in I (P), we consider Fig. <ref type="figure">10</ref> An example of a mesh Fig. <ref type="figure">11</ref> The internal skeleton of the mesh. One of its components is a single node For a path p w i ,u j (where j &#8712; {i, i + 1}) we sometimes use the notation V rem (w i , u j ) to specify the petal where the bridges of V rem are attached.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.1">Mesh separator algorithm</head><p>Now we give the algorithm to find an (&#945;, r ) path separator in a mesh M(G), with r &#8712; V (M), assuming the hypothesis of Lemma 32. Recall from Definition 29 an (&#945;, r ) path separator is a directed path starting at (the "root") r that is also an &#945; separator.</p><p>1. Find the decomposition tree, T M of M with 2-cliques and 1-cliques as the separating sets. 2. Find the center of the mesh M. It will either be a cut vertex, a separating pair, a cycle, or flower(v) for some internal vertex v. 3. If it is a cut vertex, we just find a path from the root r to it. If it is a separating pair (u, v), both the vertices must lie on a same face, which is a directed cycle. In both this case, and also the case in which the center is a cycle, find a path from the root to any vertex of the face that touches it the first time, and then extend the path by encircling the cycle. 4. If it is flower(v) for some internal vertex v, find a path p = r , . . . , u 1 , v to v. Let the junction neighbors of v in clockwise order starting from (u 1 , v), be w 1 , u 2 , w 2 , . . . , w d , with the w's being out junction neighbors and the u's being in junction neighbors. Starting clockwise from segment u, v , find the first index i and j &#8712; {i, i + 1} s.t. after removing the extended path p w i ,u j , (defined in Lemma 37) the remaining strongly connected components are smaller than 11  12 w(G).</p><p>Fig. <ref type="figure">12</ref> The tree decomposition of the mesh using 1,2-clique sums. The nodes encircled red are clique separator nodes Fig. <ref type="bibr">13</ref> An example of a path separator. The vertex v is a central node, and the green path is a separator</p><p>The algorithm above can clearly be implemented in logspace with an oracle for planar reachability, and thus, it can be implemented in UL &#8745; co-UL.</p><p>It remains to show that the "first i" mentioned in the final step actually exists.</p><p>Lemma 49 If the center of M is flower(v) for some internal vertex v, then there will always exist an adjacent face f u i ,v,w i s.t. the path p w i ,u i is an 11  12 -separator.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Proof</head><p>We have the following two cases:</p><p>1. For some i and j &#8712; {i, i + 1}, w(V rem (w i , u j )) &#8805; 1 2 w(M).</p><p>on R (v i ) for i from k -1 downto 1. Given G, the encodings of p and R (v i ) can all be computed in AC 0 (UL &#8745; co-UL). 3. For any v i , R (v i ) can be written as a DAG of SCCs (strongly connected components), where each SCC is smaller than 11  12 |G|. In AC 0 (UL &#8745; co-UL), we can compute this DAG and we can compute an encoding of the tuple (i, M, v) where M is an SCC in R (v i ) and v is a vertex in M. Recursively, in parallel, we compute a DFS tree of M for each tuple (i, M, v), using v as the root. Now we need to show how to sew together (some of) these DFS trees, to form a DFS tree for G with root r . Namely, for each i, for each M &#8712; R (v i ), we will select exactly one v such that the DFS tree for G will incorporate the DFS tree computed for (i, M, v), as described next. 4. Given a triple (i, M, v), let x 0 , x 1 , . . . , x s be the order in which the vertices of M appear in a DFS traversal where the root x 0 = v. If v is such that the DFS tree for (i, M, v) is incorporated into the DFS tree that we are constructing for G, then our DFS will correspond to first following the edges from x 0 that lead to other SCCs in R (v i ). (No vertex reachable in this way can reach any x j , or else that vertex would also be in M.)</p><p>And then we will move on to x 1 and repeat the process, etc. Thus, let R i,M,v (x j ) = ((R(x j ) &#8745; R (v i ))\M)\( k&lt; j R(x k )).</p><p>Our DFS tree for G is composed by using Algorithm 2 of Sect. 3, on the multigraph that has a vertex for each SCC in the DAG of SCCs that makes up any R i,M ,v (x j ). Crucially, the ordering on the edges that leave any node M in this multigraph is determined by the order in which the vertices of M are visited in the DFS tree of M . Let us see in more detail how to use the DFS trees that we computed for each (i, M, v), by considering how to process the DAG of SCCs in some R i,M ,v (x j ). Every SCC in this DAG is reachable from x j . We will be using Algorithm 2 from Sect. 3 to compute the lexicographically least path from x j to any SCC M in R i,M ,v (x j ). We can use any ordering for the edges that leave x j (such as the order in which the edges are presented).</p><p>For the other SCCs in the DAG, the ordering must be chosen more carefully. Let us say that the first edge that leaves x j that lies on some path to a node in M is (x j , y); this edge will be in our DFS tree for G. The node y is in some SCC N in R i,M ,v (x j ). A DFS tree T i,N ,y was computed for (i, N , y); the order in which the nodes of T i,N ,y are visited imposes an order on the edges that leave N in the acyclic multigraph. That is the order that is used, in applying Algorithm 2. More generally, when executing the while loop in Algorithm 2, if the variable current currently is set to some SCC M 1 , and M 2 is the first SCC adjacent to M 1 (using the ordering on the edges of M 1 ) that lies on a path to M , and this is because there is an edge (w, z) where w is the first node in the traversal of M 1 that is adjacent to any node of M 2 , then on the next pass through the while loop, the ordering on the edges leaving M 2 is determined by the traversal order of the DFS tree that was computed for (i, M 2 , z). Let us denote this node z by v M 2 ; the edge (w, v M 2 ) will be in the DFS tree for G. 5. The final DFS tree for G thus consists of the path p = r , v 1 , v 2 , . . . , v k along with the DFS trees that were computed for each (i, M, v M ) (for the unique vertex v M identified in the preceding step).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="8">Conclusions and open problems</head><p>Although we give an improved upper bound for the problem of finding DFS trees in planar digraphs, we do not completely resolve the question of this problem's complexity. Computing DFS trees in planar graphs is clearly at least as hard as the reachability problem in planar graphs, and we know of no better lower bound for this problem.</p><p>In any class of graphs, computing breadth-first search trees is no harder than computing distance in the graph. Reachability always reduces to the problem of computing distance, but the complexity of these problems can differ. (Reachability in undirected graphs lies in logspace <ref type="bibr">[35]</ref>, whereas computing distance in undirected graphs is complete for NL <ref type="bibr">[37]</ref>.) For directed planar graphs, we have noted that both these problems lie in UL&#8745;co-UL (Theorem 1). Thus, we can also ask whether breadth-first search trees are easier to compute in planar directed graphs, than DFS trees.</p><p>Note that, for undirected planar graphs, both breadth-first and depth-first search trees reduce to computing distance in directed planar graphs <ref type="bibr">[4]</ref>. We know of no better lower bound for computing DFS trees in undirected planar graphs than the corresponding reachability problem.</p><p>Of course, the outstanding open question in this area is to resolve the complexity of computing DFS trees in general (directed or undirected) graphs. The RNC 7 algorithm of <ref type="bibr">[1]</ref> is unlikely to be optimal. It would be of interest to improve the complexity even in terms of non-uniform circuit complexity classes.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>An earlier version of this work claimed a stronger upper bound, but there was an error in one of the lemmas in that version<ref type="bibr">[3]</ref>.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1"><p>Let us give additional motivation for having a dynamically computed ordering on the neighbors of v. We will be considering a DAG whose vertices consist of strongly connected components (SCCs) of the original graph G. We will have already pre-computed several DFS trees of each SCC: one rooted at each node in the SCC. Our final DFS tree will consist of (a) one DFS tree for each SCC (where the root of the DFS tree for SCC C is some node r C &#8712; C) along with (b) a selected edge (v D , r C ) connecting any two SCCs D and C that are adjacent in the DFS tree of the DAG. But of course, to fully specify the DFS tree, we also need to have an ordering on the neighbors of each vertex. In practice, we will be using the (precomputed) DFS tree of D (rooted at r D ) to determine the order of neighbors of vertex D in the DAG (whose vertices are SCCs). The "lexicographically least" property of our DFS tree of the DAG depends only on the ordering of the neighbors (and not on the selection of the specific edge between vertices in the directed acyclic multigraph).</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_2"><p>In case a more detailed definition is necessary, here is what is meant by "the lexicographically least path from s to v." Let p and p be two paths from s to v. If p is shorter than p , then p precedes p in the lexicographic ordering. If p and p have the same length and are not equal, then they each start with s and agree up through some vertex x, and first differ at the next vertex. Let us say that p has the edge (x, w) and p has the edge (x, w ) The vertex x is entered via some edge e (where if x = s, then e is the null edge). The neighbors of x are ordered according to f (x, e). If w precedes w in the ordering f (x, e), then p precedes p in the lexicographic ordering.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_3"><p>This may seem counterintuitive. If C v is not entirely red, then v participates in some red cycle containing edges not in C v . Whereas if C v is all red, then v is not connected to other red parts of G, and thus we color it white.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="5" xml:id="foot_4"><p>The interior of a cycle is the subgraph of G induced on the vertices that are embedded inside C, but not on C.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="12" xml:id="foot_5"><p>path separator of M, starting at r .<ref type="bibr">6</ref> Notice that here we explicitly allow k = 1 so that v 1 = v k .</p></note>
		</body>
		</text>
</TEI>
