Manuscript Offprint
arXiv:2610.27879Space Complexity of Reachability in Simple Path Graphs
Abstract
One of the central questions in space complexity is whether nondeterministic logspace computations (NL) can be simulated in unambiguous logspace (UL). A stronger notion, reach unambiguity (ReachUL UL coUL), requires every configuration reachable from the start to have exactly one computation path [BJLR91]. It is known that directed graph reachability is NL-complete, planar graph reachability is in UL, and undirected graph reachability is in deterministic logspace (L). In this work, we study the space complexity of reachability problem for restricted directed graph families and show the following.
-
For reach unambiguous graphs (graphs with at most one path from start vertex to every vertex), Lange [Lan97] showed that reachability is in ReachUL. As our main result, we show that for simple path graphs (introduced in [KKR08], which contains reach unambiguous graphs), where each vertex has at most one simple path from the start, the reachability problem lies in UL ∩ coUL. The key difficulty lies in recognizing whether the input graph is a simple path graph or not.
-
Our first result can also be equivalently stated as follows: the recognition problem for simple path graphs is in UL ∩ coUL if and only if the reachability problem restricted to simple path graphs is also in UL ∩ coUL. Inspired by this, we investigate the complexity of graph recognition versus graph reachability for other directed graph classes. Observe that for any graph class, solving reachability (for the class) also solves the recognition problem for that class. We show that for reach unambiguous graphs, solving recognition is as hard as solving reachability (making both of them ReachUL-complete).
*Department of Computer Science and Engineering, Indian Institute of Technology Palakkad, Kerala, India. Email: {kdinesh,112303001}@iitpkd.ac.in
1 Introduction
One of the central problems in space complexity asks if nondeterministic computation (captured by the class NL consisting of languages accepted by machines using logspace with potentially multiple accepting paths on any run) can be made unambiguous (captured by the class UL consisting of languages accepted by machine using logspace with at most one accepting path on any run) [RA00]. A stricter form of unambiguity, namely, reach unambiguity (captured by the class ReachUL ⊆ UL ∩ coUL) introduced in [BJLR91] requires that for every configuration reachable (which can be accepting, rejecting or aborting) from the start configuration, there is exactly one path in the configuration graph of the machine . Note that there are two existing definitions for ReachUL. Buntrock et al. [BJLR91] says that the configuration graph of the run of a reach unambiguous machine could have multiple accepting configurations, while Lange’s [Lan97] definition has a fixed unique accepting configuration. Both definitions yield the same class [BJLR91]. In this work, we use Lange’s definition.
Fig. 1 gives a visual representation of how the configuration graph of machines associated with each of the above complexity classes looks like.

NL

UL

ReachUL
start
L
Figure 1: The gray vertices denote the accepting configuration, solid black vertices denote reject configuration, and black outlined vertices denote abort configuration. The gray paths are accepting paths, dotted paths are rejecting and dashed paths are aborting. The path constraints are as follows: NL allows an arbitrary number of paths, UL requires at most one accepting path, ReachUL requires at most one accept, reject, and abort paths (to each vertex), L has exactly one computational path ending in either accept or reject configuration.
A natural way to get a better understanding of these classes is by studying problems complete for them (under many-one logspace reductions). While the general problem of directed graph reachability is complete for NL, we do not know of any natural complete problem for UL.
Surprisingly, for the stricter notion of reach unambiguity, Lange [Lan97] showed that reachability for a certain restricted family of graph is complete for ReachUL (under logspace reductions). Of particular interest in this work is a special family of directed graphs called reach unambiguous graphs (where there is at most one path from start vertex to every other vertex) for which the reachability problem is in ReachUL. This family of graphs is of interest as it is the only family of directed graphs for which reachability for n vertex graphs can be checked deterministically in space, beating what is achievable with Savitch's theorem (for more details, see [AL98,
See Section 2 for a formal definition.
All23]). For connections to logspace algorithms in the quantum setting, see [AE25]). Also, showing that a problem is in ReachUL implies that it can be solved in in simultaneous polynomial time and poly-logarithmic space, which places it in the class SC [BJLR91, Coo79]. It is an open problem to design such algorithms solving reachability for general directed graphs [Wig92].
Kannan et al. [KKR08] considered a strict generalization of this family called simple path graphs, where there is at most one simple path from the start vertex to any other reachable vertex . They gave a simultaneous sub-linear space and polynomial time algorithms for solving graph reachability restricted to this class. Towards improving this result, if we could show that the reachability for simple path graphs is solvable reach unambiguously in logspace, then it gives a polynomial time and poly-logarithmic space algorithm (as ReachUL SC ).
Towards this, as our first contribution, we show that the reachability problem for simple path graphs (denoted SimplePath-Reach) is in UL ∩ coUL (Theorem 1). Note that all the graphs considered in this work are directed.
Theorem 1 (Main). Given a graph, checking if it is a simple path graph, is in UL ∩ coUL. In particular, this means that the reachability problem restricted to this class SimplePath-Reach ∈ UL ∩ coUL.
Observe that if a graph G with s as a start vertex is guaranteed to be a simple path graph, then there is at most one simple path to any other vertex reachable from s. Hence, such a path must also be the shortest path, which is unique. A result of Reinhardt and Allender [RA00] shows that given a graph G and two vertices s and t, if there is a logspace computable weight assignment to the edges of a graph that guarantees that the minimum weight path from s to t is unique, checking reachability from s to t in G is in UL ∩ coUL. Hence, assigning unit weights to each edge (which is indeed logspace computable), immediately shows that the reachability problem SimplePath-Reach is in UL ∩ coUL. Hence, the difficult part is in recognizing whether the given graph is indeed a simple path graph . In such graphs, the vertices that are not reachable from the start vertex could have arbitrary structure (see Fig. 2). This also adds to the difficulty of the recognition problem for simple path graphs.
Due to this, it is not clear if one could design a (logspace computable) weighting scheme to check if a given graph is a simple path graph (via an application of Reinhardt and Allender's result). Instead, we build on the algorithm of Lange [Lan97] for reach unambiguous graphs (which can be viewed as a depth bounded depth first search) and extend the same to simple path graphs.
Motivated by the relation between the recognition and reachability for simple path graphs, as our second contribution, we explore this relation for other graph classes also. In general, the complexity of reachability restricted to a specific family of graphs seems to give a lot of information on the power and limitations of space bounded complexity classes. A celebrated result due to Reingold [Rei08] showed that if the graphs are undirected, then the reachability problem is solvable in logspace. On the other hand, the problem stays complete for NL if the graphs are restricted to be acyclic. Interestingly, the reachability problem is solvable in UL if the graph family is planar [BTV09] (or even of higher genus [GST19]).
This is indeed a strictly larger family, as the vertices reachable from the start vertex must form a tree in reach unambiguous graphs while a simple path graph is allowed to contain directed cycles.
We thank the anonymous reviewers for pointing this out to us.
In this context, it is natural to ask about the complexity of the reachability problem for a special family of graphs G, called the G-Reach problem. For such a problem, it is also necessary to check if the graph belongs to the family of graphs G, called as the G-Rec problem. Note that, in general, the reachability problem for a family of graphs can be harder than the recognition problem. For instance, if G is the family of directed bipartite graphs , where the edges may go from S to T, T to S or both, checking if the underlying undirected graph G is bipartite is in logspace [AG00], while reachability restricted to bipartite graphs is complete for NL. We ask if the same holds true for complexity classes below NL.
When G is reach unambiguous graphs, we show that the recognition problem is as hard as the reachability problem (Proposition 2), thereby exhibiting a class below NL for which the previous statement is not true. Note that, since G-Reach for reach unambiguous graphs is in ReachUL [Lan97], and as the recognition problem reduces to it, the recognition problem for reach unambiguous graphs is also solvable in ReachUL. Hence the recognition and reachability problems reduces to each other for reach unambiguous graphs.
Proposition 2. Let G be reach unambiguous graphs, let M be a reach unambiguous machine by which G-Rec is in ReachUL. Then, there exists a reach unambiguous machine which makes exactly one oracle query to , solving the G-Reach problem.
Towards proving the above, note that a ReachUL algorithm with a ReachUL oracle access can be simulated in ReachUL. Such a result is known when the base machine is in deterministic logspace [BJLR91]. We state this as a proposition.
Proposition 3. ReachUL = ReachUL
Indeed, ReachUL ReachUL . To see the other direction, any machine N with an oracle access to in ReachUL, where N accepts a language in ReachUL can be simulated reach unambiguously. As ReachUL = coReachUL [BJLR91], the answers to oracle queries in can be found reach unambiguously.
Our techniques and overview of proofs: We describe the main ideas that goes in proving Theorem 1. We start by describing Lange's procedure and highlight the challenges involved in solving reachability for simple path graphs.
Lange’s procedure can be viewed as a depth bounded depth first search. More precisely, the procedure proceeds in rounds (starting with ), where each round starts by performing a pre-order traversal of the subgraph of the original graph consisting of all the vertices that are reachable from the start vertex up to a fixed depth . To facilitate the pre-order traversal, the procedure takes advantage of the graph structure and uses nondeterminism to correctly identify the next vertex in the pre-order traversal. If the nondeterministic choices are correct, the accepts and rejects will be unambiguous. The non-trivial part of Lange’s algorithm is that if the nondeterministic choices are incorrect, the procedure aborts and does so unambiguously, making the overall algorithm reach unambiguous.
For each value of d, the procedure verifies that the above subgraph (vertices reachable from s at distance at most d) is indeed reach unambiguous. The run of this procedure eventually defines a DFS tree rooted at s consisting of all the vertices reachable from s. Note that this tree is never stored explicitly.
We now discuss the challenges involved in adapting Lange’s procedure to simple path graphs. Simple path graphs are those graphs for which any DFS tree starting from s does not have a forward or cross edges (See Lemma 10). It can be argued that Lange’s procedure [Lan97] detects if the input graph has a forward, back edge or cross edge and rejects in all the three cases unambiguously. In particular, this means that the procedure will reject simple path graphs.
The first challenge is to make sure that the procedure does not reject on a back edge. This requires us to unambiguously identify if an edge is a back edge or not. We achieve this using the procedures IsLeftChildBackEdge (Alg. 1) and IsRightChildBackEdge, which takes in a vertex y and height h of y in the DFS tree and checks if its left or right child forms a back edge unambiguously. However, it need not abort unambiguously. Note that Lange's algorithm [Lan97] does not need to perform such checks.
The second challenge is to identify the next vertex to visit in the traversal. Consider the case where the subgraph reachable from s is a tree with back edges. Suppose that the current vertex (being explored) has a left child which is not part of a back edge. Then, the pre-order traversal must next visit the left child. In a different case, if the current vertex is the left child of the parent and is also a leaf vertex, then the next vertex to visit in the pre-order is the right child of the parent. However, it could be that the right child is a back edge . Lange's procedure does not have to handle this case as ReachUL configuration graphs do not have back edges.
To understand the third challenge, let us describe how the next vertex in the pre-order traversal is found if there are no more left child or right child left to move. This is because they have already been traversed or because they are back edges or leads to a deeper depth. Consider the case when the current vertex is a leaf and is the right child of its parent. Additionally, let the parent be the left child of its grandparent. In this case, the next vertex to visit is the grandparent's right child. However, it could be that this child could form a back edge.
We handle both of these issues in the Next and PathUncle procedure (Alg. 3, Alg. 4). The rest of this paper is organized as follows.
Organization of the paper: After giving the necessary background in Section 2, we first shows that reachability in simple path graphs is in UL ∩ coUL in Section 3, which prove Theorem 1. Towards this, we introduce a few procedures such as the Main (explained in Section 3.2) that performs a depth bounded depth first search on the input graph and checks for reachability. For this traversal, Main uses the procedure Next (explained in Section 3.3) that returns the pre-order successor of a given vertex in a special subgraph induced on the input graph. Two supporting algorithms used in Next are explained in Sections 3.1 and 3.4. Finally, we conclude with a discussion on the recognition vs reachability for special family of graphs in Section 4, proving Proposition 2 from Section 1.
AI Disclosure The TikZ code for Figs. 2, 3 and 6 to 9 were generated with the help of ChatGPT-5 and Claude-4. All other parts of this manuscript did not use any form of generative AI (open or proprietary).
Forward and cross edges are not possible by Lemma 10.
Acknowledgements We are grateful to the anonymous reviewers for their comments and suggestions and, in particular, for pointing out to us that recognizing simple path graphs also solves the reachability problem unambiguously (see Page 3). C. S. thanks the Department of Computer Science and Engineering, IIT Palakkad for the extended financial support received.
As mentioned in the introduction, all the graphs considered are directed. One such graph class discussed in this work is reach unambiguous graphs. It is defined as follows in [Lan97].
Definition 4 (Reach Unambiguous Graph ). A directed graph G is a reach unambiguous graph if there exists at most one path from the start vertex to any other vertex in G. Moreover, the out-degree of each vertex is either 0 or 2 and each vertex is marked as internal or leaf.
A strict generalization of Reach unambiguous graphs are Simple Path Graphs (Definition 5) introduced by [KKR08]. It is defined as follows.
Definition 5 (Simple Path Graph). For a directed graph G and a vertex s, the pair is a simple path graph if there exists at most one simple path from s to any vertex in the graph. Moreover, the out-degree of each vertex is either 0 or 2, and each vertex is marked as internal or leaf. For a fixed embedding of the graph, vertex v with nonzero out-degree, we denote to be v's right child and to be v's left child.

Figure 2: A simple path graph . The shaded region in gray denotes the unreachable vertices from s.
Note that the graph induced by the unreachable vertices from s does not have any restrictions on its structure. Moreover, unlike reach unambiguous graph, simple path graphs may have walks from s to any other vertex reachable in G. Additionally, when it is clear from the context, vertex s is omitted while describing a simple path graph.
We also need the definition of (Definition 6) and uncle of a vertex in (Definition 7) to understand Lange's algorithm. They are defined as follows.
Definition 6 ( of a simple path graph ). For a simple path graph , is the induced subgraph of formed by all vertices reachable from within distance .
Definition 8 (DFS Tree, Tree edges). A DFS tree of a graph G for a DFS traversal (that is, pre-order traversal) is a subgraph of G with and being the set of edges taken during the traversal. These edges are also known as tree edges.
In a DFS tree of a directed graph G, the edges of G graph are classified as follows. This well
Definition 7 (Uncle of a vertex v for a depth d). For a simple path graph , an uncle of a vertex v is defined as follows. If v is s, uncle is . Otherwise, uncle is the next vertex to be visited in the pre-order traversal of subtree , assuming all the vertices of the subtree of rooted at v is visited. See Fig. 3 for an example.

Figure 3: Example illustrating the uncle of a vertex v at different positions.
known [CLRS09] formalization is described below.
Definition 9 (Edge classification in DFS). In a depth-first search (DFS) tree of a directed graph, edges in G not appearing in the DFS tree can be classified as follows. A forward edge is an edge that connects a vertex to a descendant in the DFS tree, but not directly to its immediate child. A cross edge is an edge that connects two vertices where neither is a descendant of the other. Finally, a back edge is an edge that points from a vertex to one of its ancestors in the DFS tree. This edge indicates the presence of a directed cycle in a directed graph. The dashed edge in Fig. 2 is a back edge.
Note that trees, by definition, do not contain forward, cross or back edges. Simple path graphs can be viewed as generalizations since they cannot contain forward or cross edges (but may contain back edges). We use this characterization crucially in Section 3.
Lemma 10 (Lemma 2 of [KKR08]). A pair where is a directed graph and is a simple path graph iff for any DFS tree produced from any vertex reachable from does not contain forward or cross edges.
Complexity Preliminaries and Definitions We begin by recalling two unambiguous logspace complexity classes that play a central role in our results. The class UL captures nondeterministic logspace computations with a unique accepting computation path, while ReachUL imposes the stronger requirement of unambiguity, allowing at most one computation path from the start configuration to any configuration. These notions are formalized below.
Definition 11 (UL). UL is the complexity class containing decision problems that can be solved by a nondeterministic TM using a logarithmic amount of memory space and on every input have at most one computation path from the start configuration to any accepting configuration.
Definition 12 (ReachUL [BJLR91]). ReachUL is the complexity class containing decision problems that can be solved by a nondeterministic TM using a logarithmic amount of memory space and on every input have at most one computation path from the start configuration to any other configuration.
Now, we consider the language defined in [Lan97] where it was shown that it is ReachUL-complete.
Definition 13 ( ). The language describes the family of graphs G together with a vertex labeling of G and a source vertex s with the property that from the source node s to every other vertex in G, there is at most one path. Moreover, the vertex labeling marks each node as either a leaf or an inner node, with children specified as left or right.
For a structured family of graphs , we consider the problem of checking whether a graph belongs to a graph family (called -Rec) as well as the graph reachability problem restricted to this family of graphs ( -Reach) defined as follows.
Definition 14. -Rec =
Definition 15. -Reach = -Rec and there is an to path in
3 Reachability in Simple Path Graphs is in UL ∩ coUL
In this section, we show that reachability in simple path graphs is in UL ∩ coUL (Theorem 1). Before going into the details of the algorithm, we give a brief background for the problem.
Note that the simple path graphs introduced by [KKR08] is a strict generalisation of the graphs considered in (see Definition 13), which is the set of all graphs such that there is at most one path from start to any vertex in the graph. [KKR08] showed that for any , recognition as well as the reachability problem in simple path graphs can be done in time and space where the hides the polynomial in factors. In this section, we build on an algorithm due to Lange [Lan97]. Lange's algorithm checks whether belongs to , reach unambiguously, and we extend it to our setting. In the next section, we start by discussing how the back edges are detected unambiguously.
3.1 Detecting Back Edges Unambiguously (Alg. 1)
In this section, we first describe the procedure IsLeftChildBackEdge that takes in a vertex y and its height h in the subgraph rooted at s and checks whether or is a back edge, respectively. Let denotes this subgraph. The procedure assumes is a simple path graph and the correct height of y is h. These checks are not a part of the procedure. The algorithm for IsRightChildBackEdge is exactly same as that of IsLeftChildBackEdge except that in line 3, is replaced by .
Algorithm 1: IsLeftChildBackEdge(y, h)
1 flag ← False, w ← s; 2 for count ← 0 to h - 1 do 3 if w == L(y) then 4 flag ← True; 5 w ← a neighbor of w guessed nondeterministically; 6 if w == y then 7 Return flag; 8 else 9 Abort;
Proposition 16. Given a graph G, vertex y and its height h with being a simple path graph, if is a back edge in the subgraph then IsLeftChildBackEdge returns True or Aborts. Conversely, if IsLeftChildBackEdge returns True, then is a back edge in the subgraph . Moreover, IsLeftChildBackEdge runs unambiguously.
Proof. We start by arguing the correctness of IsLeftChildBackEdge. The argument for the correctness of IsRightChildBackEdge is similar.
Suppose is a back edge in the subgraph . Then there exists a path from s to y of length h such that will be visited before y is reached. The lines 2-5 precisely does this check and the flag will be set to True in that nondeterministic choice. Hence, the procedure returns True if the path ends in y. If the path does not end in y, since h is the length of the shortest path from s to y, it must be that the nondeterministic choices took at least one back edge during the traversal. In such cases, the procedure aborts in line 9.
We now argue that if IsLeftChildBackEdge returns True, then is a back edge in the subgraph . To argue this, suppose is not a back edge. Then, in any path from s to y, will not be visited. Hence, in lines 2-5, the flag is never set to True in all nondeterministic choices. Hence, the procedure returns False if the path ends in y. If the path does not end in y, since h is the length of the shortest path from s to y, it must be that the nondeterministic choices took at least one back edge during the traversal. In such cases, the procedure aborts in line 9.
Unambiguity of IsLeftChildBackEdge: We argue the unambiguity of the procedure when it returns True or False. We recall that is already a simple path graph and h is the length of the shortest path from s to y. We start with the case when the function returns True. Suppose the IsLeftChildBackEdge on returns True for two nondeterministic choices. This corresponds to two walks from s to y. We claim that both of them must be paths of length h. To see this, suppose one of them is a walk of length h where a vertex v is repeated (such a v must exist). Then we can obtain a path of length strictly smaller than h by removing the vertices that appear between two consecutive v. We repeat this for every such v. This shows that y is at a distance strictly smaller than h, which is a contradiction.
With two paths of length h from s to y, the graph is no longer a simple path graph, which contradicts that is a simple path graph. The argument for the unambiguity of IsRightChildBackEdge returning True is similar.
Now, suppose that the procedure returns False. The same argument holds verbatim with “True” replaced by “False”. Since the procedure returns True and False unambiguously, the procedure is in UL ∩ coUL.
Remark 17. The above procedures are not reach unambiguous as it is possible to have multiple walks in the graph that reach the same vertex (different from y) and end up aborting ambiguously.
3.2 Main Procedure (Alg. 2): Correctness and Unambiguity
In this section, we describe the procedure Main. We start with an overview, followed by a detailed description. This procedure takes in a graph G, two vertices, s and t, and accepts if and only if G is a simple path graph and there is a unique path from s to t in G. For each value of d, this procedure proceeds by verifying that up to a depth d, the given graph G is a simple path graph.
During this traversal, for each value of the depth, two pointers are maintained. The procedure simultaneously checks two properties. First, it checks whether appears as a neighbor of any visited vertex. Second, for each at height , it does an inner traversal using a second pointer to verify that does not violate the conditions for a simple path graph for . Specifically, the inner traversal checks that not a cross edge or a forward edge, and no two internal vertices at depth share a common neighbor. After we traverse the whole of the graph and all depth values have been processed, the algorithm accepts if and only if reached is True.
For the traversal, this procedure invokes Next that takes in a vertex y, its height h, and a depth d and returns the next vertex after y in the pre-order traversal of . The details of Next as well as the correctness and unambiguity will be explained in the next section (Section 3.3).
The description of Main is given in Alg. 2.
Algorithm 2: Main(G, s, t)
1 reached ← False, n ← |V(G)|; 2 for d ← 1 ... n - 2 do 3 (y, h) ← (s, 0); 4 repeat 5 if t ∈ {L(y), R(y)} then 6 reached ← True; 7 if h == d and y is internal then 8 (y', h') ← (s, 0); 9 repeat 10 if y' ∈ {L(y), R(y)} then 11 if ¬(IsLeftChildBackEdge(y, h) or IsRightChildBackEdge(y, h)) then 12 Reject; 13 if h' == d and y ≠ y' and y' is internal and {L(y'), R(y') } ∩ {L(y), R(y)} ≠ ∅ 14 then 15 Reject; 16 (y', h') = Next(y', h', d); 17 until (y', h') = (s, 0); 18 (y, h) = Next(y, h, d); 19 until (y, h) = (s, 0); 20 if reached then 21 Accept; 22 else 23 Reject;
To argue correctness, we show the following.
Proposition 18. Given a graph G and two distinct vertices s and t in , iff Main accepts. Moreover, Main runs unambiguously in Accept and Reject.
Proof. Suppose that . Then, it could be that either G is not a simple path graph or G is a simple path graph but there is no s to t path. We start with the former case.
Let and be two different simple paths from to a vertex in a graph . In the figures that follow (Figs. 4 and 5), they are as dashed and dotted respectively. Without loss of generality, let be the first point of convergence of and . Let appear on as a neighbor of and appear on as a neighbor of . The paths and can either be of the same length or of different length. On one hand, if they are of the same length (see Fig. 4), either or forms a cross edge and the graph is rejected in line 14.
On the other hand, if the paths are of different lengths, without loss of generality, say have less height than y. Suppose, for a contradiction, the algorithm accepts. Then, the “Reject” at line 12 was never executed. . We do not consider the “Reject” at line 14 since this is only executed when and are of same length.
There could be two reasons why the “Reject” at line 12 was never executed. (1) is a back edge and is a child of y, and (2) is not a child of y. For case (1), if is a back edge, the path and meet at for the first time and not v (see Fig. 5). This is a contradiction as is different from v. Then the algorithm must have rejected in this case. Now, for case (2), if is not a child of y, we have to show that the algorithm rejects. Since the inner loop compares y with every of height height of y, for some y, becomes v and y is the parent of . Now, is not a tree edge (since y and appear on different paths) and not a cross edge (which would lead to reject at line 12), it must be a back edge, leading to a “Reject” in line 12.

Figure 4: (shown as dashed), (shown as dotted) are of same length

Figure 5: (shown in dashed), (shown in dotted) are of different length.
Now, consider the case where G is a simple path graph, but there is no s to t path. Observe that the algorithm visits every vertex reachable from s in G. This is because the Next procedure is guaranteed to find the pre-order successor of the current vertex. Hence, as t was not reachable, the algorithm would reject.
Suppose . Then, is a simple path graph and there is an to path.
In this case, none of the reject checks succeed, and for some vertex y reachable from s, the vertex t will be a child of y. The algorithm is guaranteed to find such a y because Next gives the pre-order successor of the current vertex every time it is called. Consequently, reached is set to True in line 6. Hence, the algorithm accepts.
Unambiguity of Main: The main procedure does not use any nondeterminism directly and uses nondeterminism only in the subroutines. Observe that all the subroutines (IsLeftChildBackEdge and IsRightChildBackEdge) are unambiguous in both "yes" and "no" instances by Proposition 16. Moreover, Next returns the pre-order successor of y and its height in the subgraph unambiguously by Proposition 19. Hence, in Main, there cannot be two nondeterministic choices that ends in Accept. Same holds for Reject.
Proof of Theorem 1. To show that SimplePath-Reach ∈ UL∩coUL, we see that Main accepts SimplePath-Reach and the accept and reject are unambiguous by Proposition 18. This completes the proof.
3.3 Next Procedure (Alg. 3): Correctness and Unambiguity
In this section, we describe the procedure Next as Alg. 3. This procedure takes in a vertex y and two numbers h and d where it is guaranteed that the height of y in the subgraph is h. This procedure returns the pre-order successor of y in the subgraph . The procedure assumes that h is the correct height of y and is a simple path graph.
Now, let us briefly see how Next returns a vertex. We consider three cases for a vertex y at height h < d. In Figs. 6 to 9, the vertex highlighted with a gray fill and black border denotes the current vertex y, while the vertex with a white fill and black border denotes the vertex returned by Next(y, h, d). The shaded region indicates vertices that are unreachable from s. We now describe the cases.
Case 1: Left child of y is not a back edge. In this case, is returned as the pre-order successor (Fig. 6).
Case 2: Left child y is a back edge, but the right child is not. In this case, is returned as the pre-order successor (Fig. 7).
Case 3: Both children of y are back edges. Then, pre-order successor of y in is returned (Fig. 8).
Case 4: Now, suppose y is at height h = d. Even if y has children that are at a greater depth than d, Next does not return it. Instead Next returns the pre-order successor of y in (Fig. 9).
The algorithm is described in Alg. 3. Following this, we argue the correctness.
Proposition 19. Given a graph G, vertex y, its height h and depth d of the subgraph , Next returns the pre-order successor of y in the graph and its height. Moreover, Next returns y and its height unambiguously or aborts.
Proof. The purpose of the procedure Next(y, h, d) is to return the pre-order successor of y in the graph . Below, we show that this indeed is the case. The pre-order successor of y can appear

Next(y, h, d)
Depth d

Depth d
Next(y, h, d)
Figure 6: Case 1: When left child of y is not a back edge.
Figure 7: Case 2: When left child of y is a back edge, but the right child is not.

Depth d
Figure 8: Case 3: When both children of y are back edges.

Depth d
Figure 9: y is at height h = d.
as a left child of y if the left child is not a back edge. If it is a back edge, the pre-order successor will be the right child of y, provided is not a back edge. If both left and right child of y are back edges, then the pre-order successor is not immediately clear as it needs to be computed. This is achieved using a call to PathUncle.
Suppose the next vertex in the pre-order traversal is the left child and is not a back edge. In this case, the procedure returns the left child and terminates. Suppose the next vertex in the pre-order traversal is the right child and is not a back edge. In this case, the procedure returns the right child and terminates.
If the current vertex is the final vertex in the pre-order traversal of the graph , we return the source and terminate the procedure. Computing this final vertex is achieved in lines 10 to 18. If y is not the final vertex, we call PathUncle to return the next vertex.
Unambiguity of Next: The procedure Next is unambiguous since it contains no nondeterministic statements except within the subroutines PathUncle, IsLeftChildBackEdge, and IsRightChildBackEdge. The subroutine IsLeftChildBackEdge and IsRightChildBackEdge are unambiguous in both “yes” and “no” instances by Proposition 16. Path uncle unambiguously returns the correct uncle of x along with its height by Proposition 20. Hence, Next is unambiguously returns a value or aborts.
We remark that the only difference with the Next procedure appearing in Lange [Lan97] is that in our case, (1) we need to check for back edges (Lemma 10) and (2) the “right most” vertex in need not be the last vertex in the pre-order traversal; this needs to be computed.
Algorithm 3: Next(y, h, d)
1 if y is internal and ¬IsLeftChildBackEdge(y, h) and h < d then
2 Return (L(y), h + 1);
3 else
4 if y is internal and ¬IsRightChildBackEdge(y, h) and h < d then
5 Return (R(y), h + 1);
6 else
7 ;
8 ;
9 flag ← False;
10 while w is internal and and flag == False do
11 if ¬IsRightChildBackEdge(w, h) then
12 ;
13 ;
14 else if ¬IsLeftChildBackEdge(w, h) then
15 ;
16 ;
17 else
18 flag ← True;
19 if y == w then
20 Return (s, 0);
21 else
22 ;
23 Return (u, )
Algorithm 4: PathUncle(x, g)
1 , ;
2 , , ;
3 while and w is an internal vertex do
4 Guess ;
5 if then
6 if ¬IsLeftChildBackEdge(w, ) then
7 if ¬IsRightChildBackEdge(w, ) then
8 ;
9 ;
10 ;
11 ;
12 else
13 if ¬IsRightChildBackEdge(w, ) then
14 ;
15 ;
16 ;
17 if then
18 Return (u, );
19 else
20 Abort;
Figure 10: Algorithms Next and PathUncle
3.4 PathUncle Procedure (Alg. 4): Correctness and Unambiguity
This procedure is executed as a subroutine of the previously defined algorithm Next. Given a vertex x and its height g, the algorithm PathUncle(x, g) unambiguously returns the correct uncle of x along with the uncle's height. This is achieved by guessing a path from the root s to x, at each step storing the latest encountered potential uncle u (i.e., the right child of the current node) and its corresponding height . To ensure guesses form a valid path, the algorithm avoids traversing edges that are identified as back edges, using the procedures IsLeftChildBackEdge and IsRightChildBackEdge. The algorithm verifies the correctness of its guesses by checking that the guessed path ends at x. If the path is invalid, the algorithm aborts. Otherwise, it returns the uncle that is farthest from s along the simple path to x.
Proposition 20. Given a vertex x and its height g, the algorithm PathUncle(x, g) unambiguously returns the correct uncle of x along with the uncle's height or aborts.
Proof. We argue the correctness of PathUncle.
Note that there is exactly one path from s to x as x is reachable from s and is a simple path graph. Observe that the while loop (lines 3 to 16) eventually terminates because, in each iteration, the value of count is incremented irrespective of the guess taken.
We show that the uncle u must appears as a right child of one of the vertices in .
To argue this, we claim the following "(1) Uncle of w is u with as its height (2) is the height of " is maintained at the end of line 16. Item (2) is necessary for ensuring correctness of call to IsLeftChildBackEdge and IsRightChildBackEdge functions.
We argue the invariant by induction on count. For count = 1, w = s and the uncle u of w is . Moreover and are the correct heights of u and w respectively. Hence, the base case holds.
Moving to the induction case, let count = c for some and w be an internal vertex reached. By induction hypothesis, the uncle of w is u and is its height and is the height of w. We make the following claim.
Proposition 21. Let G be a simple path graph and w be a vertex such that is a back edge in G. Then, the uncle of w is the right child of the unique vertex v in the unique path such that
a. v has a right child that is not a back edge
b. Every vertex r from v to w in the edge is either an edge in or is a back edge.
In the induction step, w gets updated to or based on the nondeterministic choice. We now argue that for both the cases, gets updated correctly. This would prove (2) from the induction. In both the cases, provided or is not a back edge, w is updated appropriately, and is incremented by 1. By induction, had the correct height of w. Hence, incrementing gives the correct height of the new w.
We now argue (1) by induction. Suppose that the nondeterministic choice was to the right (that is, ) and the right child is verified to be not a back edge. In this case, and stay the same. Hence, the uncle of is the same as that of the uncle of , which is .
Suppose that the nondeterministic choice was to the left (that is, ) and the left child is verified to be not a back edge. Now, there are two cases. Case 1: The right child of is a back edge. In this case, the uncle and its height are not updated. With being a back edge, from Proposition 21, we conclude that the uncle of is the same as that of uncle of . By induction hypothesis, with the uncle of being , the uncle of is also and height of is the same as it is not updated. Case 2: Right child of is not a back edge. In this case, in step 8, the uncle is updated to . This is correct since the conditions of Proposition 21 are satisfied. Since u is updated to be the right child of w, the height of u is one more than the height of w.
Hence, by induction, irrespective of the nondeterministic choice, the uncle of w is always u. For the unique nondeterministic choice reaching x, u holds the uncle of x. In the case where the verification steps (back edge checks) fail, the count gets incremented and becomes equal to g prematurely. Since g is the length of the shortest path to x, w never becomes x, and the procedure aborts.
Unambiguity of PathUncle: Now, we show that the algorithm is unambiguous. Towards this, we argue that for the execution of the procedure in which all nondeterministic choices are correct, the procedure returns the correct uncle and its associated height. On the other hand, for any execution path involving an incorrect nondeterministic choice, the procedure aborts.
We first argue the case when all the nondeterministic choices taken by the algorithm are correct. We show a unique is returned. This is true since for every , there is a unique path from to in and there is a unique vertex in the path whose right child is the uncle. Hence, the returned uncle is unique.
Now consider the case in which the procedure makes an incorrect nondeterministic guess, which can occur in one of two ways: (1) the path of length g chosen by the procedure starting from vertex s does not terminate at vertex x, or (2) the path length is less than g because w reached a leaf vertex in . In both cases, the path terminates at vertex w, different from x as g is the length of the shortest path from s. Here, the procedure aborts in line 20. These aborts need not be unique as there could be multiple nondeterministic choices that could end in the same w.
We now give a proof of Proposition 21 which was used in proving Proposition 20.
Proof of Proposition 21. Observe that such a v satisfying (a) and (b) always exists. This is because the right child of s is a candidate uncle for any vertex in . The uniqueness follows since the pre-order traversal is unique.
Suppose, for contradiction, the right child of v is not the correct uncle of w but satisfies conditions (a) and (b). Observe that the uncle of w cannot appear as a right child of any vertex in the path . Hence, the uncle of w must appear as a right child of a vertex r between v and w in . However, for any , is neither an edge in nor a back edge. This violates (b).
4 Recognition vs Reachability for Special Family of Graphs
Having established that reachability in simple path graphs is in UL ∩ coUL, we now turn to a broader question about the complexity of recognition versus reachability in various special family of graphs.
Let G be a family of graphs. Recall the recognition (G-Rec) and reachability (G-Reach) problems from preliminaries. Clearly, the reachability problem requires the recognition problem to be solved as well. This means , showing that solving reachability is as “hard” as recognition. Since G-Reach where G is reach unambiguous graphs is in ReachUL [Lan97], the recognition problem is also solvable in ReachUL by the aforementioned observation. We now show that the reachability problem also reduces to the recognition problem for the family of reach unambiguous graphs.
We now prove Proposition 2, which shows -Reach -Rec for reach unambiguous graphs.
Proof of Proposition 2. The reach unambiguous machine with oracle access to for -Reach is as follows. Given , first check if -Rec by making an oracle query to . If -Rec, then reject. Otherwise, -Rec, and guess a length . Now, guess a path of length from to . If the path ends in where , abort with . On the other hand, if , then accept.
We show that -Reach. Suppose accepts , then it must be that -Rec and there is a path from to in . Hence, -Reach. Suppose -Reach, then -Rec and there is a path from to in . Hence the oracle call to succeeds. Moreover, there is exactly one guess for length and exactly one path starting from that ends in . Hence, the machine accepts .
We now argue why is reach unambiguous.
Consider the case where is reach unambiguous graphs. Suppose -Reach. Either -Rec or there is no to path. Note that the case where there is more than one path from to is covered in the -Rec. Suppose -Rec. Then the oracle will return a “no” answer and rejects unambiguously. Now, suppose -Rec and there is no path from to in . Then must be unique for all nondeterministic choices made by . Hence, is reach unambiguous.
Since ReachUL = ReachUL by Proposition 3, -Reach is in ReachUL.
5 Summary and Open Problem
The reachability problem restricted to reach unambiguous graphs is complete for the class ReachUL (under many-one logspace reductions) [Lan97]. In this work, we studied the complexity of reachability problems specifically for simple path graphs (a superclass of reach unambiguous graphs) and showed that the problem is in UL ∩ coUL. Since ReachUL ⊆ UL ∩ coUL, as an open question, we ask whether our result can be improved to ReachUL.
Open Problem. Is the complexity of the reachability problem for simple path graphs, SimplePath-Reach ∈ ReachUL?
Such an improvement would give a simultaneous poly(n) time and space algorithm for this problem, placing it in and thereby improving [KKR08].
References
[AB09] S. Arora and B. Barak. Computational Complexity: A Modern Approach. Cambridge University Press, 2009.
[AE25] Simon Apers and Roman Edenhofer. Directed st-connectivity with few paths is in quantum logspace. In Proceedings of the 40th Computational Complexity Conference, CCC '25. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, 2025.
[ÅG00] Carme Álvarez and Raymond Greenlaw. A compendium of problems complete for symmetric logarithmic space. Computational Complexity, 9:123–145, 12 2000.
[AL98] Eric Allender and K-J Lange. RUSPACE( ) DSPACE( ). Theory of Computing Systems, 31(5):539–550, 1998.
[All23] Eric Allender. Guest column: Parting thoughts and parting shots (read on for details on how to win valuable prizes!). SIGACT News, 54(1):63–81, March 2023.
[BJLR91] Gerhard Buntrock, Birgit Jenner, Klaus-Jörn Lange, and Peter Rossmanith. Unambiguity and fewness for logarithmic space. In Proceedings of the 8th International Symposium on Fundamentals of Computation Theory, FCT '91, page 168–179, Berlin, Heidelberg, 1991. Springer-Verlag.
[BTV09] Chris Bourke, Raghunath Tewari, and N. V. Vinodchandran. Directed planar reachability is in unambiguous log-space. ACM Trans. Comput. Theory, 1(1), February 2009.
[CLRS09] T.H. Cormen, C.E. Leiserson, R.L. Rivest, and C. Stein. Introduction to Algorithms, third edition. Computer science. MIT Press, 2009.
[Coo79] Stephen A. Cook. Deterministic cfl's are accepted simultaneously in polynomial time and log squared space. In Proceedings of the Eleventh Annual ACM Symposium on Theory of Computing, STOC '79, page 338–345. Association for Computing Machinery, 1979.
[GST19] Chetan Gupta, Vimal Raj Sharma, and Raghunath Tewari. Reachability in O(log n) Genus Graphs is in Unambiguous Logspace. In Rolf Niedermeier and Christophe Paul, editors, 36th International Symposium on Theoretical Aspects of Computer Science (STACS 2019), volume 126, pages 34:1–34:13, 2019.
[KKR08] Sampath Kannan, Sanjeev Khanna, and Sudeepa Roy. STCON in Directed Unique-Path Graphs. In Ramesh Hariharan, Madhavan Mukund, and V Vinay, editors, IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, volume 2, pages 256–267, Dagstuhl, Germany, 2008.
[Koz06] Dexter Kozen. Theory of Computation. Texts in Computer Science. Springer, 2006.
[Lan97] Klaus-Jörn Lange. An unambiguous class possessing a complete set. In Annual Symposium on Theoretical Aspects of Computer Science, pages 339–350. Springer, 1997.
[RA00] Klaus Reinhardt and Eric Allender. Making nondeterminism unambiguous. SIAM Journal on Computing, 29(4):1118–1131, 2000.
[Rei08] Omer Reingold. Undirected connectivity in log-space. Journal of the ACM (JACM), 55(4):1–24, 2008.
[Wig92] Avi Wigderson. The complexity of graph connectivity. In International Symposium on Mathematical Foundations of Computer Science, pages 112–132. Springer, 1992.