On the Power of Unambiguity in Logspace

Aduri Pavan, Raghunath Tewari, N. V. Vinodchandran

Introduction

This paper is centered around the \NL\NL vs \UL\UL problem. Can nondeterministic space bounded computations be made unambiguous? This fundamental question was first raised by Reinhardt and Allender in the paper entitled “Making Nondeterminism Unambiguous” [RA00]. Reinhardt and Allender showed that in the non-uniform setting it is indeed possible to simulate any nondeterministic logspace computation by an unambiguous one (that is, \NL/\poly=\UL/\poly\NL/\poly=\UL/\poly) thus giving the first strong evidence that this relation might hold in the uniform setting as well.

A nondeterministic machine is unambiguous if it has at most one accepting path on any input [Val76]. \UL is the class of decision problems that are decided by unambiguous logspace bounded nondeterministic machines. Clearly \UL\UL is the natural logspace analog of \UP\UP [Val76], the unambiguous version of \NP\NP. Historically, several researchers have investigated this class (for example, [BHS93, AJ93, BJLR91, BDHM92]) in different contexts. But Buntrock et al. [BJLR91] are the first to conduct a focused study of the complexity class \UL\UL and its variations.

Since the above-mentioned paper due to Reinhardt and Allender, there has been significant progress reported on the \NL\NL vs \UL\UL problem. In [ARZ99], Allender, Reinhard, and Zou showed that, under the (very plausible) hardness assumption that deterministic linear space has functions that can not be computed by circuits of size 2ϵn2^{\epsilon n}, the constructions given by Reinhardt and Allender can be derandomized to show that \NL=\UL\NL=\UL [ARZ99]. As the reachability problem for directed graphs is complete for \NL\NL, it is natural to investigate the space complexity of reachability for subclasses of directed graphs and indeed the recent progress has been in this direction. In [BTV09], it is shown that reachability for directed planar graphs is in \UL\UL. Subsequently, Thierauf and Wagner showed that reachability for K3,3K_{3,3}-free and K5K_{5}-free graphs can be reduced to planar reachability in logspace [TW09]. Kynčl and Vyskočil showed that reachability for bounded genus graphs also reduces to the planar case [KV09]. Thus reachability for these classes of graphs is also in \UL\UL.

These results provide significant evidence that \NL\NL equals \UL\UL and establishing this fundamental equivalence may be within the reach of current techniques.

\FewL\FewL, the logspace analog of the polynomial time class \FewP\FewP [All86, CH90], is the class of languages that are decided by nondeterministic logpsace machines with the promise that on any input there are at most polynomially many accepting paths [BJLR91, BDHM92]. Is \FewL=\UL\FewL=\UL? As \FewL⊆\NL\FewL\subseteq\NL, this is a very interesting restriction of \NL=\UL\NL=\UL question (it is known that \FewL\FewL is in \L\promiseUL\L^{\promiseUL} [All06]). While we are unable to show that \FewL⊆\UL\FewL\subseteq\UL , as our first result we show that the class \ReachFewL⊆\UL\ReachFewL\subseteq\UL.

Result 1. \ReachFewL⊆\UL∩\coUL\ReachFewL\subseteq\UL\cap\coUL.

is a restriction of \FewL\FewL [BJLR91]. We call a nondeterministic machine MM a reach-few machine, if for any input xx and any configuration cc of M(x)M(x), the number of paths from the start configuration to cc, is bounded by a polynomial. \ReachFewL\ReachFewL is the class of languages decided by a reach-few machine that is logspace bounded. Notice that for a machine accepting a \FewL\FewL language there can be (useless) configurations which does not lead to any accepting configuration but still with exponentially many paths from the start configuration to them. For a reach-few machine, the number of paths from the start configuration to any configuration is bounded by a polynomial. It is worth noting that such distinctions are not meaningful in the polynomial time setting as there is enough space to store the entire computation path during a nondeterministic computation. Our result improves on the previous known trivial upper bound of \ReachFewL⊆\FewL\ReachFewL\subseteq\FewL.

The class \ReachFewL\ReachFewL was also investigated by Buntrock, Hemachandra, and Siefkes [BHS93] under the notation \nspace-\amb(log⁡n,nO(1))(\log n,n^{O(1)}). In [BHS93], the authors define, for a space bound ss and an unambiguity parameter aa, the class \nspace-\amb(s(n),a(n))(s(n),a(n)) as the class of languages accepted by s(n)s(n) space bounded nondeterministic machines for which the number of paths from the start configuration to any configuration is at most a(n)a(n). They show that \nspace-\amb(s(n),a(n))⊆\uspace(s(n)log⁡a(n))(s(n),a(n))\subseteq\uspace(s(n)\log a(n)) (hence \nspace-\amb(log⁡n,O(1))⊆\UL(\log n,O(1))\subseteq\UL). Our method can be used to show that \nspace-\amb(s(n),a(n))⊆\uspace(s(n)+log⁡a(n))(s(n),a(n))\subseteq\uspace(s(n)+\log a(n)), thus substantially improving their upper bound.

We extend our first result to show that in fact we can count the number of accepting paths of a \ReachFewL\ReachFewL computation using an oracle in \UL∩\coUL\UL\cap\coUL and this implies that \ReachLFew⊆\UL∩\coUL\ReachLFew\subseteq\UL\cap\coUL (\ReachLFew is similar to the class \Few [CH90] in the polynomial-time setting).

Complexity of Min-uniqueness

Our second consideration is the notion of min-uniqueness which is a central notion in the study of unambiguity in the logspace setting. Min-uniqueness was first used by Wigderson to show that \NL⊆⊕\L\NL\subseteq\oplus\L non-uniformly [Wig94]. For a directed graph GG and two nodes ss and tt, GG is called stst-min-unique if the minimum length ss to tt path is unique (if it exists). GG is min-unique with respect to ss, if it is svsv-min-unique for all vertices vv. While stst-min-uniqueness was sufficient for Wigderson’s result, Reinhardt and Allender used the stronger version of min-uniqueness to show that \NL⊆\UL/\poly\NL\subseteq\UL/\poly. In particular, they essentially showed that a logspace algorithm that transforms a directed graph into a min-unique graph with respect to the start vertex can be used to design an unambiguous algorithm for reachability. This technique was subsequently used in [BTV09] to show that reachability for planar directed graphs is in \UL\UL. These results strongly indicate that understanding min-uniqueness is crucial to resolving the \NL\NL vs \UL\UL problem.

Our second set of results is aimed at understanding min-uniqueness from a complexity-theoretic point of view. First we observe that min-uniqueness is necessary to show that \NL=\UL\NL=\UL: if \NL=\UL\NL=\UL, then there is a \UL\UL algorithm that makes any directed graph min-unique with respect to the start vertex. It is an easy observation that Reinhardt and Allender’s technique will work even if the algorithm that makes a directed graph min-unique is only \UL\UL computable. Thus min-uniqueness is necessary and sufficient for showing \NL=\UL\NL=\UL.

Result 2: \NL=\UL\NL=\UL if and only if there is a polynomially-bounded \UL\UL-computable weight function ff so that for any directed acyclic graphs GG, f(G)f(G) is min-unique with respect to ss.

Graph reachability problems and logspace computations are fundamentally related. While, reachability in directed graphs characterizes \NL, Reingold’s break-through results implies that reachability in undirected graphs captures Ł [Rei08]. We ask the following question. Can we investigate the notion of min-uniqueness in the context of complexity classes? We introduce a logspace function class \UOptL[log⁡n]\UOptL[\log n] towards this goal.

is the function class defined by Àlvarez and Jenner (in [AJ93]) as the logpsace analog of Krentel’s \OptP [Kre88]. \OptL is the class of functions whose values are the maximum over all the outputs of an \NL-transducer. Àlvarez and Jenner showed that this class captures the complexity of some natural optimization problems in the logspace setting (eg. computing the lexicographically maximum path of length ≤n\leq n from ss to tt in a directed graph).

We consider \OptL[log⁡n]\OptL[\log n], the restriction of \OptL\OptL where the function values are bounded by a polynomial. Àlvarez and Jenner considered this restriction and showed that \OptL[log⁡n]=\FL\NL[log⁡n]\OptL[\log n]=\FL^{\NL}[\log n]. However, previously there were no completeness results known for this class. We show the first completeness result for \OptL[log⁡n]\OptL[\log n]. Consider the problem: Given GG and two nodes ss and tt. Compute the length of the shortest path from ss to tt (denoted by ShortestPathLength). We show that ShortestPathLength is complete for the class \OptL[log⁡n]\OptL[\log n] (under metric reductions).

Result 3. ShortestPathLength is complete for \OptL[log⁡n]=\FL\NL[log⁡n].\OptL[\log n]=\FL^{\NL}[\log n].

Motivated by this completeness result, we define a new unambiguous function class \UOptL[log⁡n]\UOptL[\log n] (unambiguous \OptL\OptL: the minimum is output on a unique computation path). We show that \NL=\UL\NL=\UL is equivalent to to the question whether \OptL[log⁡n]=\UOptL[log⁡n]\OptL[\log n]=\UOptL[\log n].

Result 4. \NL=\UL\NL=\UL if and only if \OptL[log⁡n]=\UOptL[log⁡n]\OptL[\log n]=\UOptL[\log n].

, the ‘gap’ version of \UL, is an interesting logspace class first studied in [ARZ99]. The authors showed that the ‘matching problem’ is contained in a non-uniform version of \SPL. They also show that \SPL is powerful enough to contain \FewL. We show that \UOptL[log⁡n]⊆\FL\SPL[log⁡n]\UOptL[\log n]\subseteq\FL^{\SPL}[\log n]. Thus any language that is reducible to \UOptL[log⁡n]\UOptL[\log n] is in the complexity class \SPL\SPL. This contrasts with the equivalence \OptL[log⁡n]=\FL\NL[log⁡n]\OptL[\log n]=\FL^{\NL}[\log n]. We also show that the class \LogFew\LogFew reduces to \UOptL[log⁡n]\UOptL[\log n] (refer to the next section for the definition of \LogFew).

Result 5. \LogFew≤\UOptL[log⁡n]⊆\FL\SPL[log⁡n]\LogFew\leq\UOptL[\log n]\subseteq\FL^{\SPL}[\log n].

Figures 1 and 2 depict the relations among various unambiguous and ‘few’ classes known before and new relations that we establish in this paper, respectively. Definitions of these complexity classes are given in subsequent sections.

Three pages are sufficient for \NL

Finally we consider the reachability problem for directed graphs embedded on 3 pages and show that it is complete for \NL. This is in contrast with reachability for graphs on 2 pages which is logspace equivalent to reachability in grid graphs and hence is in \UL\UL by the result of [BTV09]. Thus in order to show that \NL=\UL\NL=\UL, it is sufficient to extend the results of [BTV09] to graphs on 3 pages. It is also interesting to note that reachability for graphs on 1 page is equivalent to reachability in trees and is complete for \L\L.

Result 6. Reachability in directed graphs embedded on 3 pages is complete for \NL\NL.

We use a combination of existing techniques for proving our results.

Logspace Complexity Classes

We assume familiarity with the basics of complexity theory and in particular the log-space bounded complexity class \NL\NL. It is well known that checking for stst-connectivity for general directed graphs is \NL\NL-complete. We call a nondeterministic logspace machine an \NL machine. For an \NL\NL machine MM, let \mboxaccM(x)\mbox{\it acc}_{M}(x) and \mboxrejM(x)\mbox{\it rej}_{M}(x) denote the number of accepting computations and the number of rejecting computations respectively. Denote \mboxgapM(x)=\mboxaccM(x)−\mboxrejM(x)\mbox{\it gap}_{M}(x)=\mbox{\it acc}_{M}(x)-\mbox{\it rej}_{M}(x).

We are interested in various restrictions of \NL\NL machines with few accepting paths. In the literature (eg [BJLR91, BDHM92, AJ93, ARZ99]) various versions of unambiguity and fewness have been studied. We first define them all here.

(Unambiguous machines) A nondeterministic logspace machine MM is

reach-unambiguous if for any input and for any configuration cc, there is at most one path from the start configuration to cc. (The prefix ‘reach’ in the term indicates that the property should hold for all configurations reachable from the start configuration).

unambiguous if for any input there is at most one accepting path.

weakly unambiguous if for any accepting configuration cc there is at most one path from the start configuration to cc.

\ReachUL\ReachUL - class of languages that are decided by reach-unambiguous machines with at most one accepting path on any input.

\UL\UL - class of languages that are decided by unambiguous machines.

\FewUL\FewUL - class of languages that are decided by weakly unambiguous machines.

\LogFew\LogFew - class of languages LL for which there exists a weakly unambiguous machine MM and a logspace computable predicate RR such that x∈Lx\in L if and only if R(x,\mboxaccM(x))R(x,\mbox{\it acc}_{M}(x)) is true.

We could define a ‘reach’ version of \FewUL\FewUL. But that coincides with \ReachUL\ReachUL as shown in [BJLR91]. The following containments are easy: \ReachUL⊆\UL⊆\FewUL⊆\LogFew\ReachUL\subseteq\UL\subseteq\FewUL\subseteq\LogFew. It is also known that \FewUL\FewUL is \Ld(\UL)\L_{d}(\UL) (logspace disjunctive truth-table closure of \UL)\UL) [BJLR91].

By relaxing the unambiguity condition to a polynomial bound on the number of paths, we get analogous ‘few’ classes.

(Few machines) A nondeterministic logspace machine MM is a

reach-few machine if there is a polynomial pp so that for any input xx and for any configuration cc, there are at most p(∣x∣)p(|x|) paths from the start configuration to cc.

few machine if there is a polynomial pp so that for any input xx there are at most p(∣x∣)p(|x|) accepting path.

\ReachFewL\ReachFewL - class of languages that are decided by reach-few machines.

\ReachLFew\ReachLFew - class of languages LL for which there exists a reach-few machine MM and a logspace computable predicate RR such that x∈Lx\in L if and only if R(x,\mboxaccM(x))R(x,\mbox{\it acc}_{M}(x)) is true.

\FewL\FewL - class of languages that are decided by few-machines.

\LFew\LFew - class of languages LL for which there exists a few machine MM and a logspace computable predicate RR such that x∈Lx\in L if and only if R(x,\mboxaccM(x))R(x,\mbox{\it acc}_{M}(x)) is true.

As mentioned in the introduction, \ReachFewL\ReachFewL is the same class as \nspace−\amb(log⁡n,nO(1))\nspace-\amb(\log n,n^{O(1)}) defined in [BHS93]. In [BJLR91], the authors observe that \ReachFewL⊆\LogDCFL\ReachFewL\subseteq\LogDCFL. This is because a depth first search of a reach-few machine can be implemented in \LogDCFL.

The following containments follow from the definitions: \ReachFewL⊆\FewL⊆\LFew\ReachFewL\subseteq\FewL\subseteq\LFew. It is also clear that all the above-defined classes are contained in \LFew\LFew and it is shown in [ARZ99] that \LFew⊆\NL\LFew\subseteq\NL. Thus all these classes are contained in \NL\NL. Finally, we also consider the class \SPL - the ‘gap’ version of \UL\UL. A language LL is in \SPL\SPL if there exists an \NL-machine MM so that for all inputs xx, \mboxgapM(x)∈{0,1}\mbox{\it gap}_{M}(x)\in\{0,1\} and x∈Lx\in L if and only if \mboxgapM(x)=1\mbox{\it gap}_{M}(x)=1. \SPL is contained in ⊕\L\oplus\L (in fact all ‘mod’ classes) and it is big enough to contain \LFew[ARZ99]. A nonuniform version of \SPL contains the matching problem [ARZ99].

We will use metric reductions for functional reducibility. A function ff is logspace metric reducible to function gg, if there are logsapce computable functions h1h_{1} and h2h_{2} so that f(x)=h1(x,g(h2(x)))f(x)=h_{1}(x,g(h_{2}(x))).

\ReachFewL⊆\UL∩\coUL\ReachFewL\UL\coUL\ReachFewL\subseteq\UL\cap\coUL

We will use the technique of Reinhardt and Allender to show the upper bound. We will state their theorem in a suitable form. But first we repeat the definition of min-uniqueness.

Let G=(V,E)G=(V,E) be a directed graph. For a pair of vertices ss and tt we say GG is stst-min-unique if there is a path from ss to tt in GG, then the minimum length path from ss to tt is unique. GG is called min-unique with respect to vertex ss, if for all vertices vv, GG is svsv-min-unique. GG is called min-unique if it is min-unique with respect to all the nodes.

The following theorem from [RA00] states that the reachability problem can be solved unambiguously for classes of graphs that are min-unique with respect to the start vertex. Moreover, we can also check whether a graph is min-unique unambiguously.

There is an unambiguous nondeterministic logspace machine MM that on input a directed graph GG and two vertices ss and tt such that

If GG is not min-unique with respect to ss, then MM outputs ‘not min-unique’ on a unique path.

If GG is min-unique with respect to ss, then MM accepts on a unique path if there is a directed path from ss to tt, and rejects on a unique path if there are no paths from ss to tt.

We can also define the notion of min-uniqueness for weighted graphs. But this is equivalent to the above definition for our purposes if the weights are positive and polynomially bounded as we can replace an edge with weight kk with a path of length kk. In fact we will some times use this definition for weighted graphs without explicitly mentioning it. Thus for showing that \NL=\UL\NL=\UL it is sufficient to come up with a positive and polynomially bounded weight function that is \UL-computable and makes a directed graph min-unique with respect to the start vertex.

Let LL be in \ReachFewL\ReachFewL decided by the machine MM. Let G(M,x)G_{(M,x)} be the configuration graph of MM on input xx and ss be the start configuration. Let tt be the polynomial that bounds the number of paths from ss to any configuration. Consider the edges in the lexicographical order. For the ithi^{th} edge give a weight 2i2^{i}. This is a very good weight function that assigns every path with unique weight. The problem is that this is not polynomially bounded. From this weight function we will give a polynomial number of weight functions that are logspace computable and polynomially bounded so that for one of them G(M,x)G_{(M,x)} will be min-unique with respect to ss. Since by Theorem 1 it is possible to check whether a given weight function makes the graph min-unique using a \UL∩\coUL\UL\cap\coUL computation, we can go through each weight function sequentially.

We will use the well known hashing technique introduced in [FKS84] for making the graph min-unique. Let NN be the total number of configurations of M(x)M(x). With respect to the above mentioned weight function, the weight of any path is bounded by 2N+12^{N+1}. Let p1,p2,…,plp_{1},p_{2},\ldots,p_{l} be the first ll distinct prime numbers so that ∏i=1lpi>2N+1t2(N)\prod_{i=1}^{l}p_{i}>2^{N+1}t^{2}(N). Then l≤N5l\leq N^{5} and pl≤N6p_{l}\leq N^{6}. Hence each pip_{i} has a logarithmic bit representation.

Let P be the set of all paths from ss and wiw_{i} be the weight of the ithi^{th} path in P. Consider the product ∏i,j(wi−wj)\prod_{i,j}(w_{i}-w_{j}). This product is bounded by 2N+1t2(N)2^{N+1}t^{2}(N) and is nonzero since for any pair i,ji,j such that i≠ji\neq j, wi≠wjw_{i}\neq w_{j}. Thus ∏i,j(wi−wj)≠0(mod  ∏pi)\prod_{i,j}(w_{i}-w_{j})\neq 0(\mod\prod p_{i}). Hence there should be one (first) pkp_{k} with respect to which the product is non-zero and modulo this pkp_{k}, wi≠wjw_{i}\neq w_{j} for all i,ji,j. That is the weight function wmod  pkw\mod p_{k} is a weight function which is \UL\UL-computable for which the configuration graph is min-unique with respect to the start configuration (\UL-computable because, by Theorem 1, we can go through each prime and reject those which are not ‘good’ using a \UL computation, until we reach pk)p_{k}). ∎

Buntrock, Hemachandra, and Siefkes [BHS93] defined, for a space bound ss and an unambiguity parameter aa, the class \nspace-\amb(s(n),a(n))(s(n),a(n)) as the class of languages accepted by s(n)s(n) space bounded nondeterministic machines for which the number of paths from the start configuration to any configuration is at most a(n)a(n). As one of their main theorems, the authors showed that \nspace-\amb(s(n),a(n))\subseteq\uspace(s(n)\log a(n))\ (hence \nspace-\amb(log⁡n,O(1))⊆\UL(\log n,O(1))\subseteq\UL). Our method can be used to show that \nspace-\amb(s(n),a(n))⊆\uspace(s(n)+log⁡a(n))(s(n),a(n))\subseteq\uspace(s(n)+\log a(n)), thus substantially improving their upper bound.

For a space bound s(n)≥log⁡ns(n)\geq\log n and ambiguity parameter a(n)a(n) computable in space s(n)s(n) so that a(n)=2O(s(n))a(n)=2^{O(s(n))}, \nspace-\amb(s(n),a(n))⊆\uspace(s(n)+log⁡a(n))(s(n),a(n))\subseteq\uspace(s(n)+\log a(n)).

Let L∈\ReachFewLL\in\ReachFewL accepted by a reach-few machine MM. Then the #L\#L function \mboxaccM(x)\mbox{\it acc}_{M}(x) is computable in \FL\UL∩\coUL\FL^{\UL\cap\coUL}.

The idea is to compute the number of paths from ss to tt of a \ReachFewL-computation with queries to \UL∩\coUL\UL\cap\coUL language using a logspace machine. If we make sure that all paths from ss to tt are of different weights then we can count them by making queries of the form “is there a path of length ii from ss to tt” for all i≤Ni\leq N and by counting the number of positive answers.

We will use primes as before. But among polynomially many primes we have to reject those primes that does not give distinct weights to paths from ss to tt. Notice that Theorem 1 can only be used to rejects primes that do not make the graphs min-unique. It is possible that some prime makes the graph min-unique with respect to ss but the graph may still have two paths from ss to tt of the same weight. For checking this more strict condition, we use the above result that \ReachFewL\ReachFewL is in \UL∩\coUL\UL\cap\coUL.

Let LL be a language in \ReachLFew\ReachLFew witnessed by a machine MM and a polynomial qq so that for every xx, the number of paths from the start configuration of M(x)M(x) to any configuration cc is bounded q(∣x∣)q(|x|). Let G(M,x)G_{(M,x)} denote the standard layered configuration graph of M(x)M(x). Then this graph also satisfy the property that the number of paths from the start configuration in the first layer to any configuration cc is bounded by q(∣x∣)q(|x|). Then the following language is in \UL∩\coUL\UL\cap\coUL: L={(x,c,i)∣L=\{(x,c,i)\mid there is a path of length ii from ss to cc in G(M,x)}G_{(M,x)}\}.

In order to check whether pp is a ‘bad’ prime, we need to check whether there are two paths from ss to tt of the same weight.

“pp is bad ⇔∃w∃e=(c,c′)∃a∃\Leftrightarrow\exists w\exists e=(c,c^{\prime})\exists a\exists a path of length aa from ss to c∧∃c\wedge\exists a path of weight w−w(e)−aw-w(e)-a from c′c^{\prime} to tt ∧∃\wedge\exists a path of length ww from ss to tt in G−eG-{e}”

This can be decided with polynomially many queries to LL. Once we get a good prime pp, we can use LL as oracle to count the number of distinct paths from ss to tt using a deterministic logspace machine. This gives \ReachLFew⊆\UL∩\coUL\ReachLFew\subseteq\UL\cap\coUL.

Complexity of Min-uniqueness

Theorem 1 states that min-uniqueness is sufficient for showing \NL=\UL\NL=\UL. Next we prove that if \NL=\UL\NL=\UL then there is a \UL\UL-computable weight function that makes any directed acyclic graph min-unique with respect to the start vertex. Thus min-uniqueness is necessary and sufficient for showing \NL=\UL\NL=\UL.

\NL=\UL\NL=\UL if and only if there is a polynomially-bounded \UL\UL-computable weight function ff so that for any directed acyclic graphs GG, f(G)f(G) is min-unique with respect to ss.

The reverse direction follows from the above theorem due to Reinhardt and Allender. For the other direction the idea is to compute a spanning tree of GG rooted at ss using reachability queries. Since \NL\NL is closed under complement, under the assumption that \NL=\UL\NL=\UL, reachability is in \UL∩\coUL\UL\cap\coUL. Thus the following language A={(G,s,v,k)∣A=\{(G,s,v,k)\mid there is a path from ss to vv of length ≤k}\leq k\} is in \UL∩\coUL\UL\cap\coUL.

The tree can be described as follows. We say that a vertex vv is in level kk if the minimum length path from ss to vv is of length kk. A directed edge (u,v)(u,v) is in the tree if for some kk (1) vv is in level kk (2) uu is the lexicographically first vertex in level k−1k-1 so that (u,v)(u,v) is an edge.

It is clear that this is indeed a well defined tree and deciding whether an edge e=(u,v)e=(u,v) is in this tree is in \LA⊆\UL∩\coUL\L^{A}\subseteq{\UL\cap\coUL}.

Now for each edge in the tree give a weight 1. For the rest of the edges give a weight n2n^{2}. It is clear that shortest path from a vertex with respect to this weight function is min-unique with respect to ss and it is computable using a \UL\UL-transducer.

Àlvarez and Jenner [AJ93] defines \OptL\OptL as the logspace analog of Krental’s \OptP. They show that \OptL\OptL captures the complexity of some natural optimization problems in the logspace setting (eg. computing lexicographically maximum path of length ≤n\leq n from ss to tt in a directed graph). They also consider \OptL[log⁡n]\OptL[\log n] where the function values are bounded by a polynomial (hence has O(log⁡n)O(\log n) bits representations). Here we revisit the class \OptL [AJ93] and study them in relation to the notion of min-uniqueness. We define \OptL\OptL as a minimization class and show that computing the minimum length path from ss to tt in a directed graph is complete (under metric reductions) for \OptL[log⁡n]\OptL[\log n].

An \NL\NL-transducer is a nondeterministic logspace bounded Turing machine with a one-way output tape in addition to its read-only input tape and read/write work tapes. We will assume that an \NL\NL-transducer will not repeat any configuration during its computation. Hence its configuration graph contains no cycles and all computation paths will halt with accepting or rejecting state after polynomially many steps. Let MM be such a \NL\NL-transducer. An output on a computation path of MM is valid if it halts in an accepting state. For any input xx, optM(x){}_{M}(x) is the minimum value over all valid outputs of MM on xx. If all the paths reject, then optM(x)=∞{}_{M}(x)=\infty. Further, MM is called min-unique if for all xx either M(x)M(x) rejects on all paths or M(x)M(x) outputs the minimum value on a unique path.

A function ff is in \OptL if there exists a \NL\NL-transducer MM so that for any xx, f(x)=\mbox\emoptM(x)f(x)=\mbox{{\em opt}}_{M}(x). A function ff is in \UOptL\UOptL if there is a min-unique nondeterministic transducer MM so that for any xx, f(x)=\mboxoptM(x)f(x)=\mbox{\it opt}_{M}(x). Define \OptL[log⁡n]\OptL[\log n] and \UOptL[log⁡n]\UOptL[\log n] as the restriction of \OptL\OptL and \UOptL\UOptL where the output of the transducers are bounded by O(log⁡n)O(\log n) bits.

If the output is unrestricted, then the computation path of an \NL\NL-transducer can be encoded in the output and hence all the output can be made distinct. Hence the classes \OptL\OptL and \UOptL\UOptL are equivalent. But if we restrict the output to be of O(log⁡n)O(\log n) bits the classes \OptL\OptL and \UOptL\UOptL coincide if and only if \NL=\UL\NL=\UL as we show next.

We will need the following proposition shown in [AJ93]. \FL\NL[log⁡n]\FL^{\NL}[\log n] denotes the subclass of \FL\NL\FL^{\NL} where the output length is bounded by O(log⁡n)O(\log n).

\OptL[log⁡n]=\UOptL[log⁡n]\OptL[\log n]=\UOptL[\log n] if and only if \NL=\UL\NL=\UL.

\NL=\UL⇒\OptL[log⁡n]=\UOptL[log⁡n]\NL=\UL\Rightarrow\OptL[\log n]=\UOptL[\log n]: Since \NL\NL is closed under complement, if \NL=\UL\NL=\UL then \NL=\UL∩\coUL\NL=\UL\cap\coUL. Hence \OptL[log⁡n]=\FL\NL=\FL\UL∩\coUL\OptL[\log n]=\FL^{\NL}=\FL^{\UL\cap\coUL}. For a function f∈\OptLf\in\OptL, let MM be \FL\FL machine that makes query to a language L∈\UL∩\coULL\in\UL\cap\coUL and computes ff. Let NN be the unambiguous machine that decided LL. The min-unique transducer M′M^{\prime} will simulate MM and whenever a query yy is made to LL, it will simulate NN on yy and continue only on the unique path where it has an answer. In the end M′M^{\prime} will output the value computed by MM on a unique path.

\OptL[log⁡n]=\UOptL[log⁡n]⇒\NL=\UL\OptL[\log n]=\UOptL[\log n]\Rightarrow\NL=\UL: Let L∈\NLL\in\NL. Since \NL\NL is closed under complement, there is a nondeterministic machine MM that on input xx accepts on some path and outputs ‘?’ on all other paths if x∈Lx\in L, and rejects on some paths and outputs ‘?’ on all other paths if x∉Lx\not\in L. We will show that under the assumption L∈\coULL\in\coUL. Consider the \NL\NL-transducer which on input xx simulates M(x)M(x) and outputs 1 if MM accepts and outputs if MM rejects and outputs a large value on paths with ‘?’. Let NN be min-unique machine that computes this \OptL\OptL function. Thus if x∉Lx\not\in L then N(x)N(x) has a unique path on which it outputs 0 (and there may be paths on which it outputs 1). If x∈Lx\in L then there is no path it outputs 0. Now consider the machine N′N^{\prime} that simulates NN and if NN outputs 0 then it accepts. For all other values N′N^{\prime} rejects. Clearly this is an unambiguous machine that decides L‾\overline{L}.

Next we will exhibit a natural problem that is complete for \OptL[log⁡n]\OptL[\log n]. Consider the computational problem ShortestPathLength

ShortestPathLength: Given (G,s,t)(G,s,t) where G=(V,E)G=(V,E) is a directed graph and ss and tt are two vertices in VV. Compute the length of the shortest path from ss to tt. If no path exists then output ∞\infty.

ShortestPathLength is complete for \OptL[log⁡n]\OptL[\log n] (under metric reductions)

For the containment in \OptL[log⁡n]\OptL[\log n], consider the \NL\NL-transducer, which guesses a path of length ≤n\leq n from ss to tt. It the guess succeeds then outputs the length of the path. Else it rejects. If GG has a path from ss to tt, then the best path will be of length ≤n\leq n hence the minimum among the outputs will be the length of the best path.

For the completeness, let ff be a function in \OptL[log⁡n]\OptL[\log n] computed by an \NL\NL-transducer MM. Since the output of MM is of length clog⁡nc\log n for some constant cc, we will assume that MM stores the intermediate value of the output on a separate work-tape (called the output work-tape) until the end of the computation, and before halting, MM copies the contents of this work tape to the output tape deterministically and halts. Thus the configuration of this machine will also include the contend of this output work-tape. We will denote a typical configuration by the tuple (c,o)(c,o) where oo is the content of the output work tape. We will assume that at the start configuration the contents of this work-tape is 0.

Consider the following layered weighted graph G(M,x)G_{(M,x)}. G(M,x)G_{(M,x)} has p(∣x∣)+1p(|x|)+1 layers were pp is the polynomial bounding the running time of MM. For 1≤i≤p(∣x∣)1\leq i\leq p(|x|), the ithi^{th} layer has vertices (i,c,o)(i,c,o) where (c,o)(c,o) is a configuration. The last layer which has just one vertex tt. There is an edge from (i,c,o)(i,c,o) to (i+1,c′,o′)(i+1,c^{\prime},o^{\prime}) if there is a valid move from the configuration (c,o)(c,o) to (c′,o′)(c^{\prime},o^{\prime}). The weight of this edge is (o′−o)+nk(o^{\prime}-o)+n^{k} where kk is a large constant so that nk>p(n)×ncn^{k}>p(n)\times n^{c}. We will also add edges from (i,c,o)(i,c,o) to (i+1,c,o)(i+1,c,o) if (c,o)(c,o) is an accepting configuration. The weight of this edge is nkn^{k}. Finally we will add an edge with weight nkn^{k} from (p(n),c,o)(p(n),c,o) to tt if (c,o)(c,o) is an accepting configuration. For correctness, any computation path of MM with an output oo corresponds to a path in G(M,x)G_{(M,x)} from the start configuration to tt of weight o+p(n)nko+p(n)n^{k}. Since the weights on the edges are positive and bounded by a polynomial, it is easy to replace to each edge with weight ll with a path of length ll. ∎

It can be verified that the standard reductions from directed graph reachability to other \NL-complete problems also shows that a version of their optimization problems are \OptL[log⁡n]\OptL[\log n] complete. For example DFAShortestWordLength (Given a DFA MM. Find the length of the shortest word that MM accepts if L(M)L(M) is nonempty) and WordGenLength (Given a set XX with an associative binary operation, a subset S⊆XS\subseteq X, and a word ww over XX. Find the length of the shortest generation sequence of ww) are complete for \OptL[log⁡n]\OptL[\log n].

As \UOptL[log⁡n]⊆\OptL[log⁡n]\UOptL[\log n]\subseteq\OptL[\log n], \UOptL[log⁡n]\UOptL[\log n] is in \FL\NL[log⁡n]\FL^{\NL}[\log n]. Here we show that \UOptL[log⁡n]\UOptL[\log n] can be computed using a \SPL\SPL oracle. Thus if \NL\NL reduces to \UOptL[log⁡n]\UOptL[\log n], then \NL⊆\SPL\NL\subseteq\SPL.

\UOptL[log⁡n]⊆\FL\SPL[log⁡n]\UOptL[\log n]\subseteq\FL^{\SPL}[\log n]

Let f∈\UOptL[log⁡n]f\in\UOptL[\log n] and let MM be the min-unique \NL\NL-transducer that witnesses that f∈\UOptL[log⁡n]f\in\UOptL[\log n] and let pp be the polynomial bounding the value of ff. Consider the following language LL:

We will show that L∈\SPLL\in\SPL. Then in order to compute ff a logspace machine will ask polynomially many queries (x,i)(x,i) for 1≤i≤p(n)1\leq i\leq p(n).

Consider the following machine NN which behaves as follows: NN on input xx and i≤p(n)i\leq p(n), simulates MM on input xx and accepts if and only if MM halts with an output ≤i\leq i. Let g(x,i)g(x,i) counts the number of accepting paths of NN on input (x,i)(x,i). Notice that for i<f(x)i<f(x), g(x,i)=0g(x,i)=0, for i=f(x)i=f(x) then g(x,i)=1g(x,i)=1, and for i>f(x)i>f(x), g(x,i)≥1g(x,i)\geq 1.

Now consider the \GapL\GapL function h(x,j)=g(x,j)Πi=1j−1(1−g(x,i))h(x,j)=g(x,j)\Pi_{i=1}^{j-1}(1-g(x,i)). It follows that h(x,j)=1h(x,j)=1 exactly when f(x)=if(x)=i. For the rest of ii, h(x,j)=0h(x,j)=0. Thus L∈\SPLL\in\SPL. r ∎

If \NL⊆\L\UOptL[log⁡n]\NL\subseteq\L^{\UOptL[\log n]} then \NL⊆\SPL\NL\subseteq\SPL.

An interesting question is whether \FewL\FewL reduces to \UOptL\UOptL. We are not able to show this, but we show that the class \LogFew\LogFew reduces to \UOptL\UOptL.

\LogFew≤\UOptL[log⁡n]\LogFew\leq\UOptL[\log n] (under metric reductions)

Let LL be a language in \LogFew\LogFew. Let MM be a weakly unambiguous machine that decided LL. Consider the \NL\NL-transducer NN that on input xx, computes the number of accepting paths of M(x)M(x): N(x)N(x) guess a ll so that 1≤l≤p(n)1\leq l\leq p(n) (where pp is the polynomial bounding the number of accepting configurations) and then guess ll distinct accepting paths in lexicographically increasing accepting configurations and accepts and outputs ll if all of them accepts. Clearly NN outputs accM(x){\it acc}_{M}(x) on exactly one computation path and all other paths that accepts will have output <accM(x)<{\it acc}_{M}(x). ∎

Three pages are sufficient for \NL\NL\NL

We show that the reachability problem for directed graphs embedded on 3 pages is complete for \NL\NL. It can be shown that the reachability problem for graphs on 2 pages is equivalent to reachability in grid graphs and hence is in \UL\UL by the result of [BTV09]. Thus in order to show that \NL=\UL\NL=\UL it is sufficient to extend the techniques of [BTV09] to graphs on 3 pages. It is also interesting to note that graphs embedded on 1 page are outer-planar and hence reachability for directed graphs on 1 page is complete for \L\L [ABC+06].

is the class of all graphs GG, that can be embedded on 33 pages as follows: all vertices of GG lie along the spine and the edges lie on exactly one of the two pages without intersection. Moreover all edges are directed from top to bottom. \pageR is the language consisting of tuples (G,s,t)(G,s,t), such that G∈\pageG\in\page, ss and tt are two vertices in GG and there exists a path from ss to tt in GG.

Assume that we are given a topologically sorted DAG GG, with (u1,u2,…,un)(u_{1},u_{2},\ldots,u_{n}) being the topological ordering of the vertices of GG. We want to decide if there is a path in GG from u1u_{1} to unu_{n}. We define an ordering on the edges of GG, say E(G)\mathcal{E}(G). Given two edges e1e_{1} and e2e_{2}, (i) if head of e1e_{1} precedes head of e2e_{2}, then e1e_{1} precedes e2e_{2} in the ordering, (ii) if head of e1e_{1} is the same as the head of e2e_{2}, then e1e_{1} precedes e2e_{2} in the ordering if tail of e1e_{1} precedes tail of e2e_{2}. It is easy to see that E(G)\mathcal{E}(G) can be constructed in logspace given GG and in any path from ss to tt, if edge e1e_{1} precedes e2e_{2}, then e1e_{1} precedes e2e_{2} in E(G)\mathcal{E}(G) as well. Let mm be the number edges in GG.

We create 2m2m copies of each vertex in GG and let vijv_{i}^{j} denote the jjth copy of the vertex uiu_{i}, for i∈[n]i\in[n] and j∈[2m]j\in[2m]. We order the vertices along the spine of HH from top to bottom as follows: (v11,v21,…,vn1,vn2,vn−12,…,v12,v13,v23,…,vn3,…,vn2m,…,v12m).(v_{1}^{1},v_{2}^{1},\ldots,v_{n}^{1},v_{n}^{2},v_{n-1}^{2},\ldots,v_{1}^{2},v_{1}^{3},v_{2}^{3},\ldots,v_{n}^{3},\ldots,v_{n}^{2m},\ldots,v_{1}^{2m}).

Next we need to connect all the 2m2m vertices corresponding to each uiu_{i} from the top to bottom. We use the first 22 pages to do that. Put the edge (vij,vij+1)(v_{i}^{j},v_{i}^{j+1}) in HH, for each i∈[n]i\in[n] and each j∈[2m−1]j\in[2m-1], using page 11 when jj is odd and page 22 when jj is even. For the kkth edge in E(G)\mathcal{E}(G), say ek=(uk1,uk2)e_{k}=(u_{k_{1}},u_{k_{2}}), put the edge (vk12k−1,vk22k)(v_{k_{1}}^{2k-1},v_{k_{2}}^{2k}) in HH, using page 33. It is clear that this can be done without any two edges crossing each other. We give an example of this reduction in Figure 3. The claim is, there exists a path from u1u_{1} to unu_{n} in GG if and only if there exists a path from v11v_{1}^{1} to vn2mv_{n}^{2m} in HH.

Suppose there exists a path pp from u1u_{1} to unu_{n} in GG. Let p=(ei1,…eil)p=(e_{i_{1}},\ldots e_{i_{l}}). For each j∈[l]j\in[l], corresponding to eije_{i_{j}} there exists an edge in page 33 of HH by construction, say fjf_{j}. Also by construction and the ordering E(G)\mathcal{E}(G), the tail of fjf_{j} lies above the head of fj+1f_{j+1} along the spine of HH. Further, since the head of eij+1e_{i_{j+1}} is the same as the tail of eije_{i_{j}} for j∈[l−1]j\in[l-1], there exists a path from the tail of fjf_{j} to the head of fj+1f_{j+1} (using edges from pages 11 and 22). Thus we get a path from v11v_{1}^{1} to vn2mv_{n}^{2m} in HH.

To see the other direction, let ρ\rho be a path from v11v_{1}^{1} to vn2mv_{n}^{2m} in HH. Let ρ3=(α1,α2,…,αr)\rho_{3}=(\alpha_{1},\alpha_{2},\ldots,\alpha_{r}) be the sequence of edges of ρ\rho that lie on page 33. Note that each of the edges in ρ3\rho_{3} has a unique pre-image in GG by the property of the reduction. This defines a sequence of edges p′p^{\prime} in GG by taking the respective pre-images of the edges in ρ3\rho_{3}. Now the sub-path of ρ\rho from the v11v_{1}^{1} to the head of α1\alpha_{1} uses only edges from page 11 and 22 and thus by construction the head of α1\alpha_{1} is a vertex v1l1v_{1}^{l_{1}} (for some l1∈[2m]l_{1}\in[2m]). Similar argument establishes that the tail of αr\alpha_{r} is a vertex vnl2v_{n}^{l_{2}} (for some l2∈[2m]l_{2}\in[2m]) and also that the tail of αi\alpha_{i} and the head of αi+1\alpha_{i+1} are the copies of the same vertex in GG, for i∈[r−1]i\in[r-1]. Therefore p′p^{\prime} is a path from u1u_{1} to unu_{n} in GG. ∎

Acknowledgments

We thank Eric Allender for an interesting email discussion and providing valuable suggestions that improved the presentation of the paper. We thank V. Arvind for interesting email exchanges on the topic of this paper. The last author deeply thanks Meena Mahajan and Thanh Minh Hoang for discussions on a related topic during a recent Dagstuhl workshop. We thank Samir Datta and Raghav Kulkarni for discussions which lead to a weaker version of Theorem 13 (namely, reachability for 4-page graphs is complete for \NL).

References