Tight Lower Bounds for st-Connectivity on the NNJAG Model Je Edmonds
Chung Keung Poon y
Dimitris Achlioptas z
(
[email protected])
(
[email protected])
(
[email protected])
Abstract Directed st-connectivity is the problem of deciding whether or not there exists a path from a distinguished node s to a distinguished node t in a directed graph. We prove a time-space lower bound on the probabilistic NNJAG model of Poon [Poo93]. Let n be the number of nodes in the input graph and S , T be the space and time used by the NNJAG, respectively. We show that for any > 0 if an NNJAG uses space S 2 O(n1? ) then T 2 2 (log2 (n=S )) , otherwise T 2 2 (log2 ( n logS n )= log log n) (nS= log n)1=2. (In a preliminary version of this paper by Edmonds and Poon [EP95], a lower bound of T 2 2 (log2 ( n logS n )= log log n) (nS= log n)1=2 was proved.) Our result greatly improves the previous lower bound of ST 2 (n2 = log n) on the JAG model by Barnes and Edmonds [BE93] and that of S 1=3 T 2 (n4=3 ) on the NNJAG model by Edmonds [Edm93a]. Our lower bound is tight for S 2 O(n1? ), for any > 0, matching the upper bound of Barnes et al. [BBRS92]. As a corollary of this improved lower bound we obtain the rst tight space lower bound of (log2 n) on the NNJAG model. No tight space lower bound was previously known even for the more restricted JAG model.
1 Introduction The st-connectivity problem (stcon) is a fundamental problem in computer science as it is the natural abstraction of many search processes. Its space and time-space complexities are of special interest because there are many applications such as game searching, program veri cation and databases in which the size of the input graph is too large compared to the size of the internal memory of a machine. In these applications algorithms that run in small space, and preferably in small time simultaneously, are required. Stcon is also important in computational complexity theory Department of Computer Science, York University, Toronto, ON M3J 1P3, Canada. Major portion of this work
was done while the author was at the International Computer Science Institute, Berkeley, USA. y Department of Computer Science, City University of Hong Kong. This work is partially supported by Texas Advanced Research Projects Grant 003658386. Major portion of it was done while the author was at Dept. of Computer Science, University of Toronto, Canada. z Department of Computer Science, University of Toronto, Toronto, ON M5S 3G4, Canada.
1
as it is complete for NSPACE(log n) under logspace reductions. Both stcon and the corresponding problem for undirected graphs, ustcon, are hard for DSPACE(log n) as any problem solvable deterministically in logarithmic space can be reduced to either problem. (See Lewis and Papadimitriou [LP82] and Savitch [Sav70].) Thus, showing that there is no deterministic logarithmic space algorithm for stcon would separate the classes DSPACE(log n) and NSPACE(log n), while devising such an algorithm would prove that DSPACE(f (n)) = NSPACE(f (n)) for any space-constructible function f (n) 2 (log n) [Sav70]. Stcon is also a candidate problem for separating the classes of SC and NC [Joh90]. Below we mention the previous works that are most relevant to our paper. For more information on graph connectivity, we refer the reader to the beautiful survey paper by Wigderson [Wig92].
1.1 Previous works The most common algorithms for st-connectivity, breadth- and depth- rst search run in optimal time O(m + n) and use O(n log n) space. At the other extreme, Savitch [Sav70] provided an algorithm that uses O(log2 n) space and requires time exponential in its space bound (i.e., time nO(log n) ). Tompa [Tom82] showed that stcon cannot be solved in polynomial time and sublinear space simultaneously by the repeated squaring method. However,p Barnes et al. [BBRS92] gave a polynomial time algorithm for stcon that uses space S 2 n=2( log n) , providing the rst polynomial time, sub-linear space algorithm. This shows that the repeated squaring method is too n log n restricted. In fact, their algorithm implies a general time-space upper bound of T 2 2O(log2 ( S )) n3 for S 2 (log2 n). A natural question is whether the upper bounds of Savitch and Barnes et al. are tight. Unfortunately, proving non-trivial lower bounds for natural decision problems on any general model of computation, such as Turing machines and branching programs appears to be beyond the reach of current techniques. Thus, it is natural to consider structured computational models [Bor82] whose basic operations are based on the structure of the input, as opposed to being based on the bits in the input's encoding. A natural structured model for stcon is the \jumping automaton for graphs", or JAG, introduced by Cook and Racko [CR80]. A JAG moves a set of pebbles on the graph. There are two basic operations | moving a pebble along a directed edge in the graph, and jumping a pebble from its current location to the node occupied by another pebble. Although the JAG model is structured, it is powerful enough to simulate most known algorithms for stcon and related problems. For example, depth- rst and breadth- rst search, random walks [AKL+ 79] and the algorithms of Savitch and Barnes et al. can all be simulated on a JAG, see [CR80] and [Poo96]. To the authors' knowledge, all known deterministic or probabilistic algorithms for directed stcon are implementable on a JAG. However, it is not clear how a nondeterministic JAG can simulate Immerman's and Szelepcsenyi's O(log n)-space algorithm for directed st-nonconnectivity 2
(stcon) [Imm88, Sze88]. This motivated Poon [Poo93] to introduce the more general Node-Named JAG (NNJAG) model, an extension of the JAG where the computation is allowed to depend on the names of the nodes on which the pebbles are located. Using this added power, Poon [Poo93] showed how to simulate the Immerman / Szelepcsenyi algorithm on a nondeterministic NNJAG. Cook and Racko [CR80] proved a lower bound of (log2 n= log log n) on the space required for a JAG to compute stcon. Within the log log n factor, this is tight with Savitch's algorithm. Berman and Simon [BS83] extended this result to the probabilistic JAG model. More precisely, they showed that any probabilistic JAG that solves stcon within 2logO(1) n expected time requires
(log2 n= log log n) space. Their probabilistic JAG is allowed to ip a coin in each step and is able to solve stcon with 1-sided error using O(log n) space and O(nn ) expected time, see Gill [Gil77]. In the following, we will refer to such a probabilistic machine as a coin- ipping machine. Poon [Poo93] 2n further generalized the bound showing that S 2 ( logloglog n+log log T ) for any coin- ipping probabilistic NNJAG with space S and expected time T . Regarding the time-space tradeo, there are many lower bounds proved for ustcon on various weaker variants of the JAG model [BBR+ 90, BRT92, CR80]. Edmonds [Edm93b] was the rst to prove a time-space lower bound for ustcon on the regular JAG model (with bounded space). All these results apply to (directed) stcon, which contains ustcon as a special case. However, ustcon appears to be easier than stcon both in terms of space and time-space complexity. For example, Nisan et al. [NSW92] showed that ustcon can be solved in O(log1:5 n) space on a deterministic Turing machine. There is also a randomized O(log n) space, polynomial time algorithm (by Aleliunas et al. [AKL+ 79]) and a deterministic O(log2 n) space, polynomial time algorithm (by Nisan [Nis92]) for this problem. Although it is not known whether the algorithms in [NSW92, Nis92] can be simulated on a JAG or NNJAG, ustcon can indeed be solved in O(log n) space and polynomial time on a JAG due to the existence of polynomial length universal traversal sequences [AKL+ 79]. Thus one cannot hope to get super-polynomial time lower bounds for stcon by establishing similar bounds for ustcon. The rst nontrivial lower bound explicitly for stcon was given by Barnes and Edmonds [BE93]. They showed that ST 2 (n2= log n) on the JAG model. In fact their result was proved on a more powerful variant of JAG called many states, big step JAG which, unlike an ordinary JAG, is capable of traversing trees in O(log n) space. Using a proof technique completely dierent from [BE93], Edmonds [Edm93a] showed that S 1=3T 2 (n4=3) on the NNJAG model. These results still do not yield super-polynomial lower bounds on time no matter how small S is. In view of this large gap between the upper and lower bounds and the fact that the Barnes et al. algorithm was obtained by combining several rather simple ideas, it seemed that further improvements to the upper bound were quite possible.
3
1.2 New results Rather surprisingly, in a preliminary version of this paper by Edmonds and Poon [EP95], a lower n log n bound of T 2 2 (log2 ( S )= loglog n) (nS= log n)1=2 is obtained. This implies that super-polynomial p running time is necessary to solve the problem whenever S is smaller than (n log n)=2!( log nlog log n). n log n The bound also nearly matchespthe upper bound of T 2 2O(log2 ( S )) n3 (which is superpolynomial for S 2 (n log n)=2!( log n) ) by Barnes et al. [BBRS92]. Here, by a more careful choice of parameters and a tighter analysis, we prove that for any > 0, a probabilistic NNJAG with 2-sided error, using space S 2 O(n1? ), requires expected time T 2 2 (log2 (n=S )), matching the upper bound of [BBRS92]. In this paper, we de ne an S -space probabilistic NNJAG as a distribution of S -space deterministic NNJAGs. Hence the probabilistic NNJAG must use time T 2 2O(S ) or else it will cycle. From this fact and the time-space tradeo, we obtain the rst tight space lower bound of (log2 n) on a probabilistic NNJAG with 2-sided error. No tight space lower bound was previously known even for the more restricted JAG model. On the other hand, a coin- ipping probabilistic JAG or NNJAG (as de ned in [BS83, Poo93]) can run usefully for up to 22O(S) expected time. As mentioned before, it can solve stcon with O(log n) space and O(nn ) expected time. Thus, one can only prove a time-space lower bound on this coin- ipping model. Since a coin- ipping probabilistic NNJAG with space S and time T can be simulated on our probabilistic NNJAG using time T and space S + log T , our result is valid on the coin- ipping model for S 2 (log2 n) (since log T 2 O(S )). For space S 2 O(log2 n), our result still implies a lower bound of T 2 2 (log2 n) on the coin- ipping log2 n ), Poon [Poo93] gives a stronger lower bound of T 2 2(2 (log2 n=S) ). model. However, for S 2 O( loglog n For example, when S 2 O(log n), his result implies that T 2 2nc , for some constant c > 0. This paper borrows a lot of techniques from [Edm93a]. The bound is proved for the probabilistic NNJAG model by transforming the machine into a structured branching program, and applying a progress argument introduced by Borodin et al. [BFK+ 81] and also used in many proofs of time-space tradeo lower bounds, including [BC82, Bea91, BFMadH+ 87, Yao88]. Roughly, the argument is that for every short path of the computation, the probability that lots of progress is made, conditional on the fact that this computation path is followed, is less than 2?S (with space S there are at most 2S dierent such sub-computations). Our proof, however, is complicated by the fact that this is not true for some \lucky" computation paths and hence a number of new techniques are required to overcome this. In addition, the argument is applied recursively yielding a substantially greater lower bound than what would be possible without recursion. We note that similar recursive techniques have also been used in [CR80, BS83, Yao88, Edm93b, Poo93].
4
1.3 Organization of this paper We rst de ne the NNJAG model in Section 2. In Section 3, we give the statement of our main result and its corollaries. In Sections 4 and 5, we describe the families of graphs used to defeat the NNJAG. In Section 6, we de ne a notion of progress for an NNJAG on such families of graphs. In Section 7, we enhance and stylise the NNJAG model to simplify our proof. Sections 8 to 12 contain the technical proof of the lower bound. Section 8 contains the proof of an inductive statement, Lemma 8.3, from which our main result follows. The proof makes forward references to Lemma 8.1 and Lemma 8.2 which are proved in Sections 10 to 12, and in Section 9 respectively. Section 13 gives the conclusion and some open problems.
2 The NNJAG model A (deterministic) NNJAG [Poo93] J is a nite state automaton with p distinguishable pebbles, q states and a transition function . The transition function can depend non-uniformly on the size, n, of the input graph and the values of p; q can be functions of n. The input to J is a triple (G; s; t) where G is an n-node graph containing nodes s and t. For every node in G, its out-edges are labelled with consecutive integers starting at 0. The nodes in G are also labelled from 0 up to n ? 1. We de ne the instantaneous description (id) of J as the pair (Q; ) where Q is the current state and is a mapping of pebbles to nodes, specifying the current location of each pebble in the graph. When J is in id (Q; ), the transition function determines the next move for J based on (1) the state Q and (2) the mapping . A move is either a walk or a jump . A walk (P; i; Q0) consists of moving pebble P along the edge labelled i that comes out of the node (P ) and then assuming state Q0. (If there is no such edge, the pebble just remains on the same node.) A jump (P; P 0; Q0) consists of moving pebble P to the node (P 0 ) and then assuming state Q0 . The NNJAG J is initialized to state Q0 with all its pebbles on node s. It is said to accept an input (G; s; t) if it enters an accepting state on this input. An NNJAG solves stcon for n-node graphs if for every input (G; s; t) where G is an n-node directed graph, it accepts the input if and only if there is a directed path from s to t in G. We de ne the space used by the NNJAG as p log n + log q , i.e. as the number of bits needed to specify an id. The time used is the number of moves it has made. For simplicity, we assume that the labels of nodes s and t are always xed (say, as 0 and n ? 1 respectively). Hence s and t are not part of the input. A probabilistic NNJAG J is de ned as a distribution on deterministic NNJAGs. On a given input, it rst chooses probabilistically a deterministic NNJAG from the distribution and then runs this deterministic NNJAG on the input. The space used is taken as the maximum over all the deterministic NNJAGs in the distribution and the expected (worst case) time is the expected (worst case) running time over the distribution. We say that J solves stcon with 2-sided error if 5
for every input (G; s; t), the probability of J entering an accepting state is at least 3=4 when there is a path from node s to t, and at most 1=4 otherwise.
3 Statement of Results Our main result is the following.
Theorem 3.1 If J is a probabilistic NNJAG that solves stcon on n-node graphs while taking expected time T and using space S , then T 2 2 (log2 (n=S )) when S 2 O(n1? ), where > 0, and T 2 2 (log2 ( n logS n )= loglog n) (nS= log n)1=2 otherwise. The proof of Theorem 3.1 follows by applying \Yao's lemma" [Yao77] to the following theorem.
Theorem 3.2 For any , > 0 there is a distribution D on n-node graphs such that 1. PrG2D [ G 2 stcon ] = 1=2, and 2. for any deterministic NNJAG using space S 2 O(n1? ) and (worst case) time T 62 2 (log2 (n=S )), 2 n log n or S 2 ! (n1? ) and T 2= 2 (log ( S )= log log n)) (nS= log n)1=2 1 PrG2D [ J is correct on input G ] < + 2: 2
Proof of Theorem 3.1: Theorem 3 of [Yao77] states that for any randomized algorithm J that has probability of error at most and any input distribution D, the expected time of J
on the worst case input is at least half of the average time of the best deterministic algorithm that errs with probability at most 2 on random input chosen from D. By Theorem 3.2, the latter quantity is at least T (1 ? 2 ? 21 ? 2) where T 2 2 (log2 (n=S )) for S 2 O(n1? ) and n log n T 2 2 (log2 ( S )= log log n) (nS= log n)1=2 otherwise. Putting as some constant less than 14 ? and since S 2 O(n1? ), for some > 0, we get the required lower bound on a probabilistic NNJAG that errs with probability at most . Theorem 3.2 is strong enough to yield an optimal space lower bound for the deterministic NNJAG model, as an immediate corollary.
Corollary 1 Any probabilistic NNJAG that solves stcon requires (log2 n) space. Proof: Once the deterministic NNJAG to be used is chosen from the distribution the probabilistic
NNJAG becomes deterministic. Hence, while using space at most S , the NNJAG cannot take more than 2O(S ) steps without going into an in nite loop. If an NNJAG J uses space S 2= (log2 n) then, for suciently large n, the number of steps it can take is smaller than the lower bound implied by Theorem 3.2 and the result follows. 6
4 Layered Graphs From now on, we let be a xed positive constant. A (d; x; f )-layered graph, rst de ned in [BE93], is a graph consisting of d layers, each containing x nodes. The j th node in layer i is denoted by (and named) uhi;j i . (Hence, the Node Named JAG always knows the location of a pebble in terms of i; j .) Every node has at most f out-going edges to some (not necessarily distinct) nodes in the next layer. Here, we will set f = ((n log n=S )1=2) for S 2 O(n1? ) and f = 2 otherwise. Let D = d80 log n= log f e (so that f D n80). Note that D is constant with respect to n if S 2 O(n1? ) and D 2 (log n) otherwise. The distribution B(x) is a distribution on (D; x; f )layered graphs. Each graph G 2 B(x) will have x=2 hard paths (to be de ned shortly) of length D and is obtained as follows. In each layer i, except the top layer, we pick (without replacement) a sequence of x=2 nodes, uniformly at random. Let us denote the j th node picked as vhi;j i . (It is the node uhi;j 0 i for some j 0.) These nodes are called the hard nodes. The remaining x=2 nodes in that layer are called the easy nodes. For layer 1, we choose the sequence of nodes uh1;1i; uh1;2i; : : :; uh1;x=2i as the sequence of hard nodes. We shall put in edges so that if an NNJAG walks a pebble D ? 1 steps starting from a hard node in the top layer, it is dicult for the pebble to be on a hard node when it reaches layer D. First, the hard nodes are connected by the edges (vhi;j i; vhi+1;j i ) for each i 2 [1::D ? 1] and each j 2 [1::x=2]. The path from vh1;ji to vhD;ji is called the j th hard path. The nodes vh1;ji and vhD;ji are called the root and goal of the j th hard path respectively. Thus, there are x=2 hard paths, roots, and goals in G. The edge labels are chosen independently and uniformly from [0::f ? 1]. Thus, for each root r the vector of edge labels on the hard path rooted at r, denoted by ~`r , is chosen uniformly at random from [0::f ? 1]D?1 . For each layer i 2 [1::D ?1], each hard node vhi;j i will have another f ?1 out-going edges and each easy node will have f out-going edges. The destinations of these edges are chosen independently (with replacement) at random from the set of easy nodes in layer i + 1. In this way, the in-degree of each hard node is kept to one.
5 Recursively Layered Graphs n3 S )1=4) for S 2 O(n1? ) and = (( nS )1=2) otherwise. Set K = b log(n=(4)) c. Set = (( log n log n log 2D n log n n log n 1 ? Thus K 2 (log( S )) for S 2 O(n ) and K 2 (log( S )= log log n) otherwise. Moreover, K log n since S log n. We rst construct, recursively, K + 1 distributions H0 ; H1 ; : : :; HK on layered graphs where Hk is a distribution on (Dk ; 2k ; f )-layered graphs. Each such graph has super goals. In addition, for k > 0, each graph in Hk has Dk?1 2k?1 hard paths of length D each one with a goal. Our input distribution D of n-node graphs in Theorem 3.2 is formed by adding a few nodes and edges to each graph in HK .
7
The distribution H0 contains only one graph which is simply a layer of isolated nodes. These nodes are the super goals. For k > 0, a graph G in Hk is formed as follows. We choose a graph G0 from Hk?1 and replace each layer i of G0 with a graph Gi chosen from B(2k ). Note that each Gi has 2k =2 = 2k?1 hard paths and each layer of G0 has the same number of nodes. We identify the j th hard path of Gi (i.e., the path from vh1;j i to vhD;j i of Gi ) with the j th node in layer i (i.e., uhi;ji ) of G0. Every edge that goes into uhi;ji of G0 will now go into vh1;ji of Gi and every edge that goes out of uhi;j i of G0 will go out of vhD;j i of Gi . The easy nodes in Gi are not connected to any node outside Gi. Since G is uniquely determined by G0 and G1 ; : : :; GDk?1 (and vice-versa), we often denote G as a tuple hG1 ; G2; : : :; GDk?1 ; G0i. The graph G0 is called the collapsed graph of G, denoted by C (G). The set of hard paths (respectively, roots and goals) of G is the union of all the sets of hard paths (respectively, roots and goals) in G1 ; G2; : : :; GDk?1 . Hence G has Dk?1 2k?1 hard paths (and the same number of roots and goals) in total. The super goal nodes in G are the goal nodes of the hard paths in GDk?1 , representing the super goal nodes in G0 2 Hk?1 . Note that the super goals are on the bottom level of G and they are associated with the nodes in the graph from H0 . The edges within each of the Gi s are called the base edges of G. The other edges, i.e., those connecting the Gis, are in 1-1 correspondence with the edges in the collapsed graph C (G) of G and hence they are called the collapsed edges. Note that graphs in H1 have base edges but not collapsed edges, and the graph in H0 does not have any edge at all. Figure 1 shows a graph G 2 Hk on the right and on the left its collapsed graph C (G) 2 Hk?1 and the symbol for a base graph in B(2k ). We rearranged the nodes so that all the hard nodes in the Gi s appear on the left half. For each k 2 [0::K ], we obtain a distribution Gk by adding to each graph in Hk the following auxiliary nodes and edges (see Figure 2): (A1) a directed path (s = w1; w2; : : :; w2k ) with w1 = s and for each j 2 [1::2k ], an edge from wj to uh1;ji of G, (A2) the isolated node t, (A3) a special isolated node, referred to as the lost node. (A4) a number of isolated nodes so that the total number of nodes in the graph is exactly n. The lost node is introduced for technical reasons that will become clear in Section 7. These auxiliary nodes and edges are xed for each graph G 2 Gk . Hence for k > 0, G can still be speci ed by a tuple hG1 ; G2; : : :; GDk?1 ; G0i where G1; : : :; GDk?1 are in B(2k ) and G0 is in Hk . The collapsed graph of G, denoted by C (G), is the graph G0 augmented with the auxiliary nodes and edges needed to form a graph in Gk?1 from a graph in Hk?1 . Thus C (G) is in Gk?1 . Note that excluding the nodes added in (A4), each graph in Gk consists of a (Dk ; 2k ; f )-layered graph, 8
Hard part
D
Easy part
G1
2k
A graph in B(2k )
G2 Dk
G3
Dk?1
GDk?1 2k?1
2k
G = hG1 ; G2; : : :; GDk?1 ; G0i 2 Hk
G0 2 Hk?1
Figure 1: An example where f = 2.
2k
s = w1 w2 w3
D
A graph in Hk
extra nodes lost node
super goals
t Figure 2: A graph in Gk
9
a path with 2k nodes, the node t and the lost node. These add up to a total of (2D)k + 2k + 2 4(2D)k n nodes for k K by our choice of and K . Hence, we are not adding a negative number of nodes in (A4). Finally, the distribution D of Theorem 3.2 is de ned as follows. First choose a graph G0 2 GK and then uniformly at random choose one of the super goals in G0 as the special node. With probability 1=2 connect the special node to the isolated node t to form a graph G. Clearly, PrG2D [ G 2 stcon ] = 1=2.
6 De ning Progress Consider the computation of an NNJAG J on input G. We will analyse the progress of J during dierent phases of the computation. In the following de nition, a subcomputation A refers to a sequence of moves taken by the NNJAG starting from certain id (Q; ). Once we recast an NNJAG as a branching program in Section 7, one can think of A as a sub-branching program.
De nition 1 For any subcomputation A and any input G 2 Gk , wA(G) is the number of dierent goals in G that were pebbled (i.e., reached by a pebble) at any time during A. Similarly, wA (G) is the number of super goals in G that were pebbled during A.
Note that when A begins, some pebbles may already be sitting on a goal node. These goals will be counted as progress in wA (G). However, there can be at most S= log n such progress. The following lemma shows why reaching the other goals is dicult for an NNJAG.
Lemma 6.1 If at some step T 0, a particular hard path does not contain any pebble, and at some
later step T 00, a pebble arrives at the goal of this path then each edge in that path must be traversed by some pebble between step T 0 and T 00.
Proof: Observe that every node on a hard path has in-degree one and in the NNJAG model a
pebble can arrive at a node only if the node is already occupied by some pebble or if it walks to the node. We point out that it is not neccessary for a general computation model to nd out the hard path before it can inspect the edge connections of the associated goal node. This is the only signi cant dierence between a general model and an NNJAG that we will employ in our proof. Recall that an input G = hG1; : : :; GDk?1 ; G0i 2 Gk consists of the collapsed graph G0 2 Gk?1 and the base graphs G1; : : :; GDk?1 2 B(2k ). The NNJAG has to learn both the structure of the base graphs and that of the collapsed graph. Obviously, wA (G) measures how much A has learnt about the base graphs. The following lemma shows that wA (G) is also a good estimate of the number of dierent collapsed edges traversed during a subcomputation A.
Lemma 6.2 The number of dierent collapsed edges of an input graph G 2 Gk that can be traversed during a subcomputation A of an NNJAG is at most f wA (G). 10
Proof: An NNJAG can traverse an edge (u; v) only if there is a pebble on node u before the
traversal. If the edge is a collapsed edge, u must be a goal. Since every goal has out-degree at most f , pebbling one such node allows the NNJAG to traverse at most f dierent collapsed edges. Lemma 8.3, to follow, uses lemmata 6.1 and 6.2 recursively to prove that it is hard for an NNJAG to reach the super goal nodes. Roughly speaking, the argument goes as follows: Suppose we have proved that it is hard to visit the super goals of graphs chosen from Gk?1 within time Tk?1 . Consider a graph G = hG1; : : :; GDk?1 ; G0i in Gk and an NNJAG J with time Tk . We will prove, using Lemma 6.1, that for any input G0 2 Gk?1 , it is hard for J to visit many goals in the graphs G1; : : :; GDk?1 2 B(2k ) within time Tk . In particular, Lemma 6.2 implies that no more than Tk?1 dierent edges in G0 are traversed. To conclude the argument, we show that J is eectively an NNJAG trying to reach, within time Tk?1 , the super goals for graphs chosen from Gk?1 , which is dicult by the inductive assumption. It should be pointed out that J can traverse the same edge many times (which is natural as J cannot remember the result of too many edge traversals with limited space). Therefore, we cannot directly claim that J runs in Tk?1 time on inputs from Gk?1 . For this reason, we measure the time of an NNJAG using the s-height, hA (), of the corresponding branching program A. Precise de nitions of s-height will be given in Section 7. Here, we just state that an NNJAG running in time T will have hA (G) T for any G. Thus Lemma 8.3 will imply that if J is an NNJAG that uses space S 2 O(n1? ) and time T 2= 2 (log2 (n=S )) or space S 2 ! (n1? ) and time n log n T 2= 2 (log2 ( S )= loglog n) (nS= log n)1=2, then for any > 0, PrG2D [ wJ (G) > ] < . Below we show how Theorem 3.2 follows from this last statement.
Proof of Theorem 3.2: Choose G 2 D. Recall that this can be done by choosing Ga 2 GK and
then choosing one of its supergoals to be special, uniformly at random. Let Gb be the same as Ga except with an edge from the special node to t. Then G is uniformly chosen to be Ga or Gb . If Ga is such that wJ (Ga) > , i.e., J reaches a lot of super goals, then assume that J gives the correct answer on G. From Lemma 8.3, the probability of this event is less than . If J pebbles at most super goals, then the probability that J pebbles the special node is at most because the NNJAG cannot tell that a super goal is special unless it pebbles it. Finally, if J does not pebble the special node it cannot learn whether there is an edge from the special node to t. Therefore, in this case, the computations on Ga and Gb are the same and hence the probability of giving the correct answer for G is 1=2. Thus, the probability of giving the right answer for G is less than 1=2 + 2.
7 An NNJAG as a Branching Program We will introduce a variant of the NNJAG model which we call the pebble location redundant NNJAG model. The reason for this is that while the new model maintains all the power of an NNJAG it 11
helps us prove a collapsing lemma. In particular, we shall see that it is helpful to construct a pebble location redundant NNJAG J 0 for graphs in Gk?1 from a pebble location redundant NNJAG J for graphs in Gk . We call this the \collapsing" of J to J 0 . An NNJAG is said to be pebble location redundant if the current state always determines the current location of all the pebbles and, hence, the state alone is sucient to specify the id of the NNJAG. More formally, this means that there is a function b such that if the NNJAG is in state b Q) speci es the locations of all the pebbles. As a rst step in getting a pebble location Q, then ( redundant NNJAG we enhance a standard NNJAG as follows. First, we allow it to jump a pebble to the lost node (which is isolated), and for any j 2 [1::2k ] to the nodes wj and uh1;j i . We call such a jump a node-jump . Note that in the standard NNJAG model a pebble can only jump to (the node occupied already by) another pebble. Also, we modify a step to be taken from an id (Q; ) by the NNJAG to consist of the following substeps: Based on (Q; ), it either walks a pebble P along the edge with a speci ed label `, or it node-jumps a pebble P . It can also choose not to move any pebble. Let 1 specify the new pebble locations.
(Substep 1)
Based on (Q; ) and 1 , it performs a (possibly empty) sequence of pebble-topebble jumps and then assumes some state Q0 .
(Substep 2)
The intuition supporting these modi cations is that a sequence of moves of a standard NNJAG can be viewed as a sequence of \macro steps", each of which starts with a walk, followed by a (possibly empty) sequence of jumps. Each such jump causes the standard NNJAG to enter a unique next id. Intuitively, the NNJAG \learns" about the input only by taking walking steps. Each macro step can be performed in one step in the enhanced model. It follows that a time lower bound on this new model implies the same lower bound on the number of walking steps on the original model. For any NNJAG J (modi ed as above) with p pebbles, q states and T time, we can construct a pebble location redundant NNJAG J 0 so that for any possible id (Q; ) of J , J 0 will have a state hQ; i. In this state, J 0 will perform the same action as J does on id (Q; ).1 Thus, the pebble location redundant NNJAG J 0 will have p pebbles and q np states, hence using space log(q np ) + p log n = log q + 2p log n which is at most twice the space of J . Moreover, it uses no more time than J . To be able to discuss subcomputations of the NNJAG better it is convenient to recast the NNJAG as an r-way branching program [BC82] (de ned below). While, though, an r-way branching 1 Note that
in general, a standard NNJAG cannot be made pebble location redundant because if the move taken from an id (Q1 ; 1 ) is a walk, the new pebble location, 2 , will depend on the input graph. Hence the NNJAG b Q2 ) = 2 . In contrast, in the modi ed NNJAG, the pebble cannot know which new state Q2 to move to so that ( location, 2 , after substep 2 is uniquely determined by (Q1 ; 1 ) and 01 . Hence it is possible for the NNJAG to b Q2 ) = 2 . choose a state Q2 so that (
12
program is a general model of computation the branching program we will examine has \structure", imposed by lemmata 6.1, 6.2 regarding NNJAG computations. A branching program is a directed acyclic graph with a designated source node and a number of sink nodes. Each sink node in the graph is labelled with either accept or reject and each non-sink node is labelled with an input variable. Furthermore, for each possible value of the input variable that labels a non-sink node, there is a unique out-edge from this non-sink node, labelled with that value. Hence the out-degree of the graph is at most r, where r is the maximum number of dierent values possible for an input variable. A sub-branching program is simply a subgraph rooted at some node. The nodes in this graph represent the possible states of the machine's memory. In particular, the source node represents the initial memory state. In each step the machine queries an input variable, depending on the current state of its memory, and then changes its memory to another state based on the value returned. Which variable to query and which state to go to, on each possible outcome, are speci ed by the graph. It is easy to see that for every input, there will be a unique path in the graph from the source node to a sink node. We call such a path the computation path followed by the input. We say that a branching program accepts an input if and only if the computation path followed by the input leads to a sink node labelled with accept. Consider an arbitrary (pebble location redundant) NNJAG J that uses space S , takes time T and takes inputs from a distribution of n-node graphs with out-degree f . The corresponding branching program A has a row of con guration nodes for each of the time steps t 2 [1 : : :T ]. Each row has 2S con guration nodes (Q; ; t), one for each NNJAG id (Q; ). For every id (Q; ) of J and time step t, there will be a con guration vertex (Q; ; t) in A. The con guration vertex (Q0 ; 0; 1), where (Q0 ; 0) is the start id of J , is taken as the start vertex of A. For each accept id (Qa; a) of J , (Qa ; a; 1); (Qa; a; 1); : : :; (Qa; a; T ) are accept con guration vertices in A. Likewise for the reject ids. The input variables labelling the con guration vertices of A are the variables Xhu;`i where u 2 [0::n ? 1] is a node name and ` 2 [0::f ? 1] is an edge label. The variable Xhu;`i will have value v if there is an edge (u; v ) labelled with ` in the input graph and the value \unde ned" if there is no such edge. Thus, if in id (Q; ) the rst substep of J walks a pebble from node u along the edge with label `, the con guration vertex (Q; ; t) in A will be labelled with the variable Xhu;`i . Furthermore, the vertex will have a directed edge labelled with v to con guration vertex (Q0; 0; t + 1) if for some input graph, Xhu;`i = v (i.e., the queried edge has destination v ) and the subsequent jumps taken in the second substep by J bring the machine to the id (Q0; 0). If J does not walk any pebble in the rst substep, the con guration vertex will not get any label and will have only one unlabelled out-edge pointing to some con guration vertex (Q0; 0; t + 1) depending on the second substep of J . Note that the branching program A so constructed is levelled in the sense that each con guration 13
vertex can be assigned a level number so that edges from level i only go to level i + 1. Moreover, all the rows in A are identical as the transition function of the (deterministic) NNJAG does not depend on time. Therefore, the number of distinct sub-branching programs of a xed height is at most 2S . Finally, we introduce a variant of branching programs called sectioned branching programs. A branching program is said to be sectioned if its vertices are partitioned into sections so that the out-edges of a vertex in section i can only go to vertices in section i or i +1. Thus each computation path will go through each section at most once.
De nition 2 A branching program A is properly sectioned for an input G if it queries at most 3fS log n dierent edges of G in each section. If A is properly sectioned for G then its s-height on G, 3fS times the number of sections A contains; otherwise, h (G) is in nite. denoted by hA (G), is log A n
Note that a set of queries to the same edge of the input graph within a section is only charged as one query in the s-height measure. The branching program de ned earlier can be viewed as 3fS sections, each of which queries at most 3fS dierent a sectioned branching program with T= log n log n 3 fS 3 fS input edges. Moreover, on every input G, A will have s-height T = (T= log n ) log n .
8 Proof Outline In the rest of this paper, a directed edge from u to v with label ` will be denoted by the triple hu; `; vi. Also, by G (O) we denote the distribution obtained by selecting those graphs in G that satisfy a condition O. We will derive Lemma 8.3 by induction. Before doing so, we present two lemmata that are central to the proof of that inductive statement. The rst one mainly concerns traversing base edges of graphs in Gk . It bounds the probability of a machine making a lot of progress within a short period of time.
Lemma 8.1 (Main Lemma) Let A be any sectioned sub-branching program derived from some pebble location redundant NNJAG with at most S= log n pebbles. Then for any k 2 [1::K ], PrG2Gk [ wA (G) 3S= log n and hA (G) =8 ] < 2?2S :
The intuition behind Lemma 8.1 is as follows. Recall that wA (G) is the number of goals that get pebbled. We \give away" one such node for each of the (at most) S= log n pebbles. When hA (G) =8, A queries at most =8 dierent edges in G. Consider the probability of pebbling the goal corresponding to an arbitrary root r, assuming that the hard path rooted at r does not contain any pebble initially. There are f D?1 possibilities for the vector, ~`r , of edge labels on this hard path. To remind us of its dependency on G, let us use the symbol ~`r (G) instead of ~`r in the following. An NNJAG can move a pebble down from r following some vector ~` 2 [0::f ? 1]D?1 14
of edge labels, hoping that ~` = ~`r (G). For G drawn from Gk , this probability is f ?(D?1) . The NNJAG can dynamically choose ~` based on the names of the nodes on the path it has traced so far. However, this will not be a lot of help as the name of the nodes on the hard path are chosen randomly. Recall that f D n80 . Since 2 O(n), it follows that f D?1 =8. Clearly, by querying at most =8 dierent edges in the input graph, the NNJAG cannot try many dierent ~`s. Hence the probability of having at least one of them being successful is small. On the other hand, the NNJAG can eliminate some of the possibilities it needs to consider, by detecting \collisions of edges" and hence increase the probability it succeeds. For example, when it learns that two dierent edges have the same destination node v , it learns that this node v is not on the hard path since its in-degree is bigger than one. Hence, any path continuing from node v need not be traversed. However, within =8 steps, the probability that an edge traversed by the NNJAG collides with some other traversed edge can be shown to be at most 1=4. (Intuitively, the probability is 2k=8=2 1=8. For the simplicity of the proof, we argue in Section 11 that this probabilty is at most 1/4.) By analyzing a variant of branching processes, we can show that the probability of eliminating a large number of vectors ~` 2 [0::f ? 1]D?1 in this way, is small. In other words, with high probability, the NNJAG still has a lot of possible ~`s to try out. This discussion considers only a single root. When there are many roots, we need to take care of the dependencies among them before we can apply some Cherno-type bounds. The detailed analysis and proof of Lemma 8.1 comprises Sections 10, 11 and 12. The second lemma concerns the traversal of collapsed edges of graphs in Gk . Let E be a xed set of Dk?1 base graphs G1 ; : : :; GDk?1 2 B(2k ) (we call such a set of graphs a complete set) and Gk (E ) be the distribution of Gk conditioned on these xed graphs. The lemma relates the computation of a pebble location redundant NNJAG J on inputs in Gk (E ) to that of a faster (in terms of s-height) pebble location redundant NNJAG J 0 on inputs in Gk?1 . For any complete set E of base graphs, de ne a function CE from nodes in G 2 Gk (E ) to nodes in C (G) 2 Gk?1 as follows: 8 > w ; if v = wi for some i 2 [1::2k?1] > < i CE (v) = > uhi;ji ; if v is on the j th hard path in Gi > : lost; otherwise. Note that the function is well-de ned because for an input G 2 Gk (E ), whether a node v is a hard node, an easy node or an auxiliary node is xed. For any pebble mapping for graphs in Gk (E ), denote by CE () the pebble mapping 0 for graphs in Gk?1 such that for any pebble P , 0 (P ) = CE ((P )).
Lemma 8.2 (Collapsing Lemma) Let k be any integer in [1::K ], J be any pebble location re-
dundant NNJAG with p pebbles and q states, and E any complete set of base graphs. There exists a corresponding pebble location redundant NNJAG J 0 with the same number of pebbles and states
15
such that for any G 2 Gk (E ), J is in id (Q; ) in some step on input G if and only if J 0 is in id (Q; CE ()) in the same step on input C (G) 2 Gk?1 .
Note that J and J 0 use the same space. Moreover, J traverses a collapsed edge hu; `; v i in G if and only if J 0 traverses the corresponding edge hCE (u); `; CE(v )i in C (G), and J accepts G if and only if J 0 accepts C (G). The proof of Lemma 8.2 is given in Section 9. Having stated lemmata 8.1, 8.2 we are ready to state and prove the following inductive statement.
Lemma 8.3 For any > 0 and any k 2 [0::K ], if Tk =
log n k and A is a sectioned branching 24fS
3fS ) sections, derived from a pebble location redundant NNJAG J program with no more than Tk =( log n which uses at most space S , then PrG2Gk [ wA (G) > and hA (G) Tk ] k2?S < .
Proof of Lemma 8.3:
(Base Case) When k = 0, the branching program A can query at most T0 = dierent edges. Hence it cannot discover more than super goals. (Inductive Step) Assume that the lemma is true for k ? 1. Consider a sectioned branching program 3fS sections derived from some pebble location redundant NNJAG J with at A having at most Tk = log n most S space. Suppose, for the sake of contradiction, that PrG2Gk [ wA (G) > and hA (G) Tk ] > k2?S . We will show that in this case there exists some sectioned branching program A0 with at 3fS sections corresponding to some pebble location redundant NNJAG J 0 using at most most Tk?1 = log n S space such that PrG0 2Gk?1 [ wA 0 (G0) > and hA0 (G0 ) Tk?1 ] > (k ? 1)2?S . This contradicts the inductive hypothesis. 3fS slices so that slice i consists of section i(T =T ) to section We break A into at most Tk?1 = log k k?1 n log n (i + 1)(Tk=Tk?1 ) ? 1, inclusive. (So each slice contains Tk =Tk?1 = 24fS sections.) Let F be the set of G 2 Gk such that hA (G) Tk and at least one sub-branching program Ab, which lies completely within a slice, has wAb(G) 3S= log n. Since hA (G) being nite implies that Ab is properly sectioned 3fS ) = =8. for G, hAb(G) (Tk =Tk?1 )( log n Consider the maximal sub-branching program Ab which lies completely within slice i and is rooted at the node through which G rst enters slice i. There are at most 2S such sub-branching programs in A. Combining this fact with Lemma 8.1, we have PrG2Gk [ G 2 F ] < 2?S . Therefore, PrG2Gk [ wA (G) > and hA (G) Tk and G 2= F ] > (k ? 1)2?S . Let us choose a complete set E of base graphs so that PrG2Gk (E ) [ wA (G) > and hA (G) Tk and G 2= F ] > (k ? 1)2?S : By Lemma 8.2, we can construct from the pebble location redundant NNJAG J , another pebble location redundant NNJAG J 0 that runs on Gk?1 with the same number of pebbles and states as J . 3fS sections; one From J 0 , we can construct a sectioned branching program A0 with at most Tk?1 = log n section for each of the slices of A. This is done by putting a con guration vertex of A0 in section 16
i if and only if the corresponding2 con guration vertex of A is in slice i. In A, edges only go from vertices in slice i to vertices in slice i or i +1. Therefore, in A0 , edges only go from vertices in section i to vertices in section i or i + 1. Hence, this is a legal way of partitioning the vertices of A0 into sections. Now, consider an arbitrary graph G 2 Gk (E ) ? F . At most log3Sn progress is made in the unique maximal sub-branching program that G passes through in each slice of A. By Lemma 6.2, 3fS dierent collapsed edges in G. Hence each such sub-branching program can query at most log n 3fS dierent edges in C (G). 0 each corresponding sub-branching program in A queries at most log n 3fS slices, Therefore, A0 is properly sectioned for C (G), for all G 2 Gk (E ) ? F . Since A has Tk?1 = log n 0 A has the same number of sections. It follows that hA0 (C (G)) Tk?1 , for all G 2 Gk (E ) ?F . Since C (G) is chosen independent of the Gis, the distribution Gk (E ) is isomorphic to the distribution
Gk?1. Therefore,
PrC (G)2Gk?1 [ wA 0 (C (G)) > and hA0 (C (G)) Tk?1 ] PrG2Gk (E) [ wA 0 (C (G)) > and G 2= F ] = PrG2Gk (E ) [ wA (G) > and G 2= F ] PrG2Gk (E) [ wA (G) > and hA (G) Tk and G 2= F ] > (k ? 1)2?S : For k = K the above inductive statement implies that any deterministic pebble location redundant NNJAG which uses at most S space and takes O(TK ) time, will pebble more than super goals K log with probability less than K 2?S . Recall that TK = 24fSn . For S 2 O(n1? ), we set f = n n
(log2 ( n log S )) ((n log n=S )1=2), = ((n3 S= log n)1=4) and K = (log( n log S )). Hence TK = 2 (n3 S= log n)1=4 = 2 (log2 (n=S )). For S 2 ! (n1? ), we set f = 2, = ((nS= log n)1=2) and K = n n
(log2 ( n log S )= log log n) (nS= log n)1=2 . For big enough (log( n log S )= log log n). Thus, we get TK = 2 n, K 2?S < , since K log n and S log n. Thus, if J is an NNJAG that uses space S and time T 2= (TK ) then for any > 0, PrG2D [ wJ (G) > ] < . Note that for S 2 O(n1? ), the input graph has out-degree f = ((n log n=S )1=2) which is non-constant. We can convert the graphs of out-degree f into graphs of out-degree 2 by replacing each node with a binary tree of size O(f ). This blows up the number of nodes by a factor of f . Hence our lower bound becomes T 2 2 (log2 (n=fS )) = 2 (log2 (n=S )) where n is the number of nodes in the out-degree 2 graph. between states of J and J 0 . It is not hard to see that there is also a 1-1 correspondence between con guration vertices of A and A0 . 2 There is a 1-1 correspondence
17
9 Collapsing an NNJAG Lemma 8.2 Let k be any integer in [1::K ], J be any pebble location redundant NNJAG with p pebbles
and q states, and E any complete set of base graphs. There exists a corresponding pebble location redundant NNJAG J 0 with the same number of pebbles and states such that for any G 2 Gk (E ), J is in id (Q; ) in some step on input G if and only if J 0 is in id (Q; CE ()) in the same step on input C (G) 2 Gk?1 . Proof: J 0 will have the same set of states as J . Let b be the function that maps the states of J to its pebble locations. We shall prove, by induction on the number of steps taken, that if J is in state Q in step t on input G 2 Gk (E ) then J 0 is in the same state in step t on input C (G) 2 Gk?1 b Q)) speci es the locations of its pebbles in that step. This proves the claim. Initially, J and CE (( b Q ) and C (( and J 0 are at state Q0. Both ( 0 E b Q0)) specify that all pebbles are on node s. Assume that at step t, J is in state Q on input G, and at the same step, J 0 is in state Q on b Q)). The move of J 0 will be determined by C (G) and its pebble locations are speci ed by CE (( the move of J . For the rst substep there are three cases.
(Case 1) If J does nothing then J 0 also does nothing. (Case 2) If J walks pebble P along the edge with label ` then there are 3 subcases depending on the node u that P was on. (2a) If u is the lost node or the node wj for some j 2 [1::2k ] then the destination, v , of P is xed and CE (v ) is either the lost node, the node uh1;j i or wj +1 . Hence J 0 node-jumps pebble P to CE (v ). (2b) If u is a hard node in layer D of some Gi (i.e., u is a goal node) then the out-edges of u are collapsed edges. In this case, J 0 walks pebble P along edge `. (2c) If u is not a goal node and not an auxiliary node then the destination, v , is xed for all G 2 Gk (E ). If CE (u) 6= CE (v) then u must be a hard node and v must be an easy node. Hence J 0 node-jumps pebble P to CE (v ) which is the lost node. If CE (u) = CE (v ), then J 0 does nothing. (Case 3) If J node-jumps pebble P to node v then v must be either the lost node or wj or uh1;j i for some j 2 [1::2k ]. Hence CE (v ) is either the lost node, wj or uh1;j i for some j 2 [1::2k?1]. J 0 just node-jumps pebble P to CE (v). Let 1 be the pebble locations of J after the rst substep and let J assume state Q0 in the second substep. In its second substep, J 0 performs the same sequence of pebble-to-pebble jumps as in the second substep of J and then assumes state Q0 if and only if its pebble locations after the rst substep is CE (1 ). 18
Let us check that in all the above cases, the pebble locations of J 0 after the rst substep is indeed CE (1 ). By the inductive hypothesis pebble P of J 0 was on node CE (u) before the rst substep while pebble P of J was on node u. Since J only moves pebble P from node u to v in the rst substep, we just need to show that J 0 moves P from node CE (u) to CE (v ) in the rst substep. This is obviously true in all the above cases, except (2b). In Case (2b), hu; `; v i is a collapsed edge in G. By the de nitions of Gk and Gk?1 , hCE (u); `; CE(v )i is an edge in C (G). Hence pebble P of J 0 will be on node CE (v) after the rst substep. It follows that J 0 will also assume state Q0 in the b Q0 ) second substep. Moreover, in the second substep, J changes the pebble locations from 1 to ( by pebble-to-pebble jumps. By construction, J 0 will also change the pebble locations from CE (1) b Q0)). to CE ((
10 Proof of the Main Lemma Lemma 8.1 Let A be any sectioned sub-branching program derived from some pebble location redundant NNJAG with at most S= log n pebbles. Then for any k 2 [1::K ], PrG2Gk [ wA (G) 3S= log n and hA (G) =8 ] < 2?2S : Proof: Recall that every G 2 Gk consists of Dk?1 graphs, G1, G2,..., GDk?1 chosen independently from B(2k ), a graph G0 chosen from Hk?1 and some xed auxiliary nodes and edges. Each Gi has
2k?1 roots. Therefore there are (2D)k?1 roots. Recall as well that wA (G) denotes how many of the (2D)k?1 goals have been discovered and that hA (G) is a measure of the number of edges queried. Our proof will concentrate on the traversing of the base edges in G. We assume that G0 is xed and known to A. Hence the probability is only over the graphs G1 ; : : :; GDk?1 2 B(2k ). Let Bk be the distribution f hG1; : : :; GDk?1 i j G1; : : :; GDk?1 2 B(2k ) g. We allow the machine to query any variable Xhu;`i if u is a node in the top layer of a Gi. Moreover, each time a variable Xhu;`i is queried, the followings are returned: (1) the value, v , of Xhu;`i , (2) whether v is a goal node, and if so, (3) its corresponding root node. With these changes, we can assume that the machine does not query any collapsed edge as there is no need. Also, we modify A so that it has the following properties. (1) A is a decision tree (i.e. it will not forget the answer to any previous query), (2) A will not repeat any previous query, (3) each computation path in A queries at most =8 dierent (base) edges and discovers at most 3S= log n dierent goal nodes. (If queries more than =8 dierent edges, we will cut it right after it queries the (=8)th one. Similarly, if discovers more than 3S= log n dierent goal nodes, we will cut it right after it discovers the (3S= log n)th one.) It is clear that the modi cations will not decrease the probability stated in the lemma. With all the above assumptions and modi cations , we just need to show that PrG2Bk [ wA (G) 3S= log n ] 2?2S . 19
Just before A starts, each of the S= log n pebbles may already be part way down a hard path or even on a goal node. To simplify the analysis, we assume that the goals of those hard paths that contain pebbles initially, will be discovered by A. There are at most S= log n such goals. To pebble the remaining goals, we know, by Lemma 6.1, that the entire hard path must be traversed by the NNJAG. In other words, every edge in the hard path has to be queried by A. Let wA0 (G) be the number of roots such that every edge on its hard path in G has been queried by A. To prove the lemma, it suces to show that PrG2Bk [ wA0 (G) 2S= log n ] < 2?2S . Consider an arbitrary computation path in A. It can be speci ed by the sequence of base edges, E , it has queried and the sequence of node names, R , specifying whether a goal node is discovered in each step (and if applicable, its corresponding root). For example, suppose queries the variable Xhu;`i which has the value v and then the variable Xhu0 ;`0 i which has the value v0. Suppose v is not a goal but v 0 is the goal node of root r then E = (hu; `; vi ; hu0; `0; v 0i) and R = (0; r) (assuming no root has name 0). When is the computation path followed on input G we will say that \G follows ". (It might be useful to think of G as being \processed" by A along .) First, let us understand what we can deduce about ~`r (G), the sequence of edge labels on the hard path in G rooted at r, given that G 2 Bk (E ). (Note that G may not actually follow as it might not agree with R .) We say that a node v is a collision node with respect to E if E contains two distinct edges hu; `; v i and hu0 ; `0; v i with the same destination v . Since v has in-degree at least two, it is known to be an easy node. In general, we can classify ~` 2 [0::f ? 1]D?1 according to and r as follows. Suppose we trace out a path through the edges in E , starting at the root r and following the sequence of edge labels ~` until the next edge to be taken is not contained in E . Then one of the following three possibilities will occur. 1. The path passes through some collision node with respect to E . 2. The path reaches layer D without passing through any collision node with respect to E . 3. The path stops before reaching layer D and does not pass through any collision node with respect to E . We de ne Yh ;ri and Zh ;ri to contain the vectors ~` 2 [0::f ? 1]D?1 such that when the above procedure is applied, the second and third outcomes occur, respectively.
Claim 1 For any computation path in A, any input graph G 2 Bk (E ), and any root r, ~`r (G) 2 Yh ;ri [ Zh ;ri . Proof: For any ~` 2= Yh ;ri [ Zh ;ri and any input G 2 Bk (E ), the path from the root r labelled
with ~` in G contains a collision node. Since collision nodes have in-degree at least two in E , they do not lie on the hard path. Therefore, ~`r (G) 6= ~`. 20
De nition 3 For any computation path and any G 2 Bk (E ), Prog h ;ri(G) is de ned as the
random variable indicating that all the edges in the hard path in G rooted at r are mentioned in E .
Obviously, Prog h ;ri(G) is true if ~`r (G) 2 Yh ;ri , and false if ~`r (G) 2 Zh ;ri . If G actually follows
and Prog h ;ri (G) is true then the goal of root r is discovered. Let yh ;ri = jYh ;ri j and zh ;ri = jZh ;rij. Brie y, the probability that Prog h ;ri(G) is true, given that G 2 Bk (E ) is approximately yh ;ri ~ ~ yh ;ri +zh ;ri , because all ` 2 Yh ;ri [ Zh ;ri have about the same probability to be chosen as `r (G). Let D0 = D=8. We say that root r is a high collision root with respect to the computation path
if yh ;ri + zh ;ri f D0 . Otherwise, we say that it is a low collision root with respect to . We say that is a high collision computation if there are at least S= log n high collision roots with respect to . Otherwise, we say that it is a low collision computation. Let C be the set of all high collision computation paths. Then 2 S 0 PrG2Bk wA (G) log n X X 2 S 0 PrG2Bk [ G follows ] + PrG2Bk wA (G) and G follows log n
2C
2= C SUM 1 + SUM 2 : By Claim 2 in Section 11, SUM 1 is at most 2?3S . Consider SUM 2 . If both events \wA0 (G) 2S= log n" and \G follows " occur, there exist at least 2S= log n roots r such that Prog h ;ri(G) is true, i.e., all the edges on the hard path rooted at r in G are in E . For 2= C , at least S= log n of these are low collision roots with respect to E .
De nition 4 For any computation path and any G 2 Bk (E ), w 00(G) is de ned as the number of roots r such that r is a low collision root with respect to and Prog h ;ri(G) is true.
Then, SUM 2
X
62C
PrG2Bk
w 00(G) S and G follows : log n
Since \G follows " implies \G 2 Bk (E )", SUM 2
X
62C
PrG2Bk w 00(G) logS n and G 2 Bk (E )
max Pr
62C G2Bk
w00(G) S
log n j G 2 Bk (E )
X
62C
PrG2Bk [ G 2 Bk (E ) ] :
We claim that for each graph G 2 Bk , there are at most 26S dierent computation paths for which G satis es E . To see this, observe that every computation path in A queries at most =8 dierent base edges and discovers at most 3S= log n dierent goal nodes, each having at most ? =8 n3S= log n 26S n name choices for its corresponding root. Hence there are at most 3S=log n 21
dierent sequences R . If there were more than 26S dierent computation paths s such that G satis es E , then there exists two dierent computation paths and 0 such that R = R 0 and G satis es both E and E 0 . For and 0 to be dierent, there must be an edge hu; `; v i in E and an edge in hu; `; v 0i in E 0 such that v 6= v 0. Then G cannot satisfy both E and E 0 , a contradiction. P Hence our claim follows. From this claim, we have 62C PrG2Bk [ G 2 Bk (E ) ] 26S and thus, SUM 2 max PrG2Bk
2=C
w00(G) S
6S log n j G 2 Bk (E ) 2
h
i
Claim 4 of Section 12 shows that PrG2Bk w 00(G) S= log n j G 2 Bk (E ) is at most 2?9S for any
in A. In conclusion, SUM 1 + SUM 2 2?3S + 2?9S +6S 2?3S+1 2?2S ;
where all inequalities hold for big enough n. Hence Lemma 8.1 (Main Lemma) follows.
11 Bounding SUM 1 This section bounds the rst sum, SUM 1 , at the end of the proof for Lemma 8.1 (Main Lemma).
Claim 2
P
2C PrG2Bk [ G follows
] 2?3S .
Proof: We rst de ne two games called the edge-collision game and the branching-process game. Let Sed and Sbr be the random variables indicating the success of each game, respectively. We shall P show that 2C PrG2Bk [ G follows ] Pr [ Sed ] Pr [ Sbr ] 2?3S .
11.1 The Edge-Collision Game The edge-collision game is de ned as follows. Dk?1 graphs G1; G2; : : :; GDk?1 are chosen randomly and independently from B(2k ). The player is informed of the hard path of each root in each Gi. He then queries edges of the Gi s one at a time. When the player queries an edge, he speci es hu; `i, where u is a node and ` 2 [0::f ? 1] is an edge label. The destination node v of the edge hu; `; v i is then revealed to the player. Based on the result of the previous queries, he chooses the next edge to query. He is allowed to query at most =8 edges in total. The aim of the player is to minimize the number of leaves of certain trees associated with the queried edges. To be precise, let E be the sequence of base edges of the input graph G that the player has queried during the game. Recall that in Section 10 a node v is called a collision node 22
with respect to E if it is the destination of more than one edge in E . Here in this game, each edge in E will be in one of two conditions: alive or dead. An edge is said to be dead if its destination node is (1) a collision node or (2) the source of a previously queried edge. Otherwise, it is alive. We shall construct from E a collection of f -ary trees by taking the following steps.
(Step 1) If E does not contain a path from any root r to a node v then delete v from G (along with all its in/out-edges),
(Step 2) Delete all the nodes (along with their in/out-edges) that are proper descendents in E
of the destinations of the dead edges. The dead edges and their destinations are kept. The remaining edges in E that are alive are called the y -edges and their destination nodes are called the y -nodes . Each such node has a unique path from some root to it and that path contains no dead edges. Hence, the y -edges form a collection of disjoint f -ary trees.
(Step 3) \Fill up" the above trees so that each node has exactly f outgoing edges. More precisely,
for each y -node that does not have exactly f outgoing edges (counting the dead edges), add the missing edges and attach to each such edge a complete f -ary tree, of appropriate depth, such that its leaves are at layer D. The nodes and edges that are added in this way are referred to as the z -nodes and the z -edges . They do not correspond to actual nodes and edges in the input graph G. Note that each z -node also has a unique path from some root to it and that path contains no dead edges.
We shall measure the performance of the game player by two sets of parameters. They are somewhat similar to yh ;ri, zh ;ri de ned in Section 10. De ne y~r and z~r (the performance parameters) as the number of y and z -nodes at layer D, that are descendents of the root node r. Again, a root r is said to be a high collision root if y~r + z~r f D0 , where D0 = D=8 as de ned in Section 10. The goal of the player is to create as many high collision roots as possible. More precisely, the player wins if there are more than S= log n high collision roots. Let Sed be the indicator variable of this event. Note that the edge-collision game player can query whatever edges queried by A, and hence ensure that E E where E and E are the set of edges queried by A and the game player respectively. Consider the conditions for a root to be a high collision one. In A, a root r is a high collision root with respect to E if yh ;ri + zh ;ri f D0 , i.e., the number of vectors ~` 2 Yh ;ri [ Zh ;ri is small. If a vector ~` 2 [0::f ? 1]D?1 is not in Yh ;ri [ Zh ;ri, then the path obtained by following ~` from r must contain a collision node in E . The same node will also be a collision node in the edge-collision game provided E E . It follows that a high collision root in the A will also be a P high collision root in the game. Therefore, 2C PrG2Bk [ G follows ] Pr [ Sed ].
23
11.2 The Branching-Process Game Before we introduce the branching process game we introduce some machinery that will be useful in bounding its probability of success. Consider a rooted, complete, f -ary tree of depth d. We allow every edge of such a tree to die independently of all other edges with a xed probability . A node u is said to be alive if and only if no edge along the unique path from the root to u is dead. If Zi denotes the number of alive vertices at level i then the sequence Z0 = 1; Z1; : : :; Zi; : : : forms a branching process [AN72]. We will be interested in the distribution of the number of alive vertices with depth d, i.e. the random variable Zd . The expected number of alive children for an alive node is (1 ? )f and the expected value of Zd is ((1 ? )f )d . More precisely, the generating function for the ospring distribution in this branching process is g (x) = ( + (1 ? )x)f (i.e., the probability that a node has i out-edges that do not die is the coecient of xi in g (x)). A well-known fact is that if (1 ? )f > 1 then Pr [ Zd = 0 ] = , where is the unique x 2 (0; 1) such that g (x) = x. Moreover = g 0( ) < 1. The following lemma states that the probability that Zd is much smaller than its expected value is not much greater than the probability it is zero.
Lemma 11.1 [Pip92] If (1 ? )f > 1 then for d~ 2 [1; : : :; d] such that d ? d~ ! 1 and d ! 1, i
h
Pr Zd ((1 ? )f )d~ + O( d?d~):
In the branching process game we will consider a variant of the above trees, as de ned in Section 11.1, with depth D and out-degree f . For these trees, the variation lies in the existence of a xed path from the root to some leaf whose edges are guaranteed to survive; all other edges die independently with probability 1=4. Such a tree is said to wither if it has at most f D0 alive leaves. We want to bound the probability, , that this happens. To allow for a uniform treatment we rst convert the f -ary trees to binary ones when f > 2. In particular, if f > 2 then f = O(n ), for some > 0, and hence we can assume that f is a power of 2. Thus, we replace each node v and its f edges/children with a complete binary tree Tv of depth log f , i.e. with f leaves. If v is not on the path that is guaranteed to survive then all the edges in Tv die independently, with probability 1=4. Otherwise, the edges along a unique path of Tv (the one corresponding to the edge guaranteed to live) are guaranteed to survive while the rest die independently with probability 1=4. It is easy to see, inductively, that for any set of nodes at depth i log f , i = 0 : : :D, in the resulting binary tree, the probability of being alive is no more than that of the corresponding nodes at depth i in the f -ary tree. Moreover, D = d80 log ne= log f , for all f , and hence it will suce to prove the bound for f = 2 (D = d80 log ne.) 24
Let vi be the node at depth i which is on the path whose edges are guaranteed to survive and let vi0 be the sibling of vi . Let 0 be the probability that for all vi , i 2 [1::2D=3], either vi0 is dead or vi0 is alive but the subtree rooted at vi0 , Tvi0 , has at most f D0 alive nodes, at depth D. Clearly, 0 . Each Tvi0 , is a complete binary tree of depth D ? i where every edge dies with probability 1=4. For = 1=4 and f = 2, we have = 1=9 and = 1=2. As D tends to in nity with n and Tvi0 has depth at least D=3, we can apply Lemma 11.1 to bound the probability that Tvi0 has fewer than f D0 alive nodes at depth D (given that vi0 is alive) by 1=9 + O((1=2)D?i?D0 ). Thus, the probability that Tvi0 has at most f D0 alive leaves at depth D is no more than 1=4 + 1=9 + O((1=2)D?i?D0 ) 1=4 + 1=9 + O((1=2)D=3?D0 ) = < 1=2, since D0 = D=8, D = d80 log ne and n can be arbitrarily large. Since the 2D=3 subtrees grow independently, we get 0 2D=3 2 O(n?5 ). In the branching process game in our graph we say that the root r of a tree as above is a high collision root if the tree rooted at r withers. Since there are at most n roots the expected number of high collision roots is n 2 O(n?4 ). Let Sbr be the random variable indicating the event that there are more than S= log n high collision roots. As each tree grows independently of the others, we can apply the Cherno bound and prove that Pr [ Sbr ] S = Pr number of high collision roots log n S S 2?( log n )(log( log n )?log e): Since 2 O(n?4 ), Pr [ Sbr ] 2?3S .
11.3 Branching-Process Game vs Edge-Collision Game This subsection proves the second inequality mentioned in the proof of Claim 2.
Lemma 11.2 The success of the edge-collision game is probabilistically dominated by the success of the branching processes game, i.e. Pr [ Sed ] Pr [ Sbr ]. Proof: The edge-collision game starts by randomly choosing the graphs G1; G2; : : :; GDk?1 in B(2k ). For each i 2 [1::Dk?1], the rst step in choosing Gi according to the distribution B(2k )
is to randomly partition the 2k nodes at each layer into 2k =2 easy nodes and 2k =2 hard nodes and to choose the hard path rooted at each root r. This information is revealed to the player. The edges in these paths correspond to the edges in the branching process game that are guaranteed to live. The next step in choosing Gi according to the distribution B(2k ) is to choose for every remaining edge its destination among the 2k =2 easy nodes at the next layer. This only needs to be done for those edges queried by the player. For each i 2 [1::Dk?1], for each layer d 2 [1::D], and for each 2 [1:: 8 ], de ne the variable vhi;d; i to uniformly and independently take on a value from 25
[1:: 2k2 ]. Suppose that the player is querying hu; `i where u is a node at layer d in the graph Gi and this is the th query to easy edges at this layer in this graph. Then the variable vhi;d; i 2 [1:: 2k2 ] speci es the other endpoint of edge hu; `i among the 2k =2 easy nodes at the next layer. Consider the edge hu; `i queried at time t for some t 2 [1::=8]. Before this query, we do not know in advance which edges will be queried after time t because the player is able to choose them dynamically based on the result of the current one. However, the random variables vhi;d; i do tell us the resulting destinations of all the edges queried or to be queried. Together with the knowledge of the source of edges queried before time t, we can tell whether the current edge will die. Speci cally, suppose hu; `i is the th edge queried at layer d in Gi . Then it will die if either (1) there is another query at this layer 0 2 [1:: 8 ] with the same destination, i.e. vhi;d; i = vhi;d; 0i for some 0 6= or (2) the destination is the source of some edge queried before time t. In order to compare the success probability of the edge-collision game and the branching-process game, let us rst de ne random variables that will indicate which edges die in the branching-process game. For each root r in each of the graphs Gi , there is a corresponding root in the branchingprocess game. Consider the complete f -ary tree of height D rooted at such a root r. A speci c edge in this tree can be speci ed by a string ~` 2 [0::f ? 1]. For each such edge, let xhr;~`i 2 f0; 1g be the random variable indicating whether this edge dies. If the edge is one of the edges that are guaranteed game, i.e., the xed hard path in the input graph, then to live in the branching-process Pr xhr;~`i = 0. Otherwise, Pr xhr;~`i = 1=4 independent of the other x variables. Now consider a xed algorithm for the edge-collision game. For each intermediate time step t 2 [0::=8], we de ne the tth game as follows. The game starts with t time steps of the xed algorithm for the edge-collision game. Let Et be the resulting base edges queried. We want these edges to die in the tth game if and only if they die in the edge-collision game. As previously mentioned, the edge associated with vhi;d; i is dead if and only if (1) there is another query at this layer 0 2 [1:: 8 ] with the same destination, i.e. vhi;d; i = vhi;d; 0 i, or (2) the destination, i.e. vhi;d; i, is the source of an edge queried before time t. In (1), the query associated with vhi;d; 0i can occur either before or after time step t. Either way, we consider the edge associated with vhi;d; i dead. Given which edges in Et have died, the set Et can be transformed, as described in Steps (1) to (3) in Section 11.1, into a collection of f -ary trees made up of y -nodes and y -edges (the living ones), z-nodes and z-edges as well as some collision nodes and dead edges. The tth game is completed by completing the branching process on the z -edges. Namely, each such edge will live or die according to the corresponding random variable xhr;~`i 2 f0; 1g. A node u in the resulting collection of trees is said to be alive if all the edges on the path from the root of the tree to u are alive. A root is said to be a high collision root if it has at most f D0 living nodes in layer D. The tth game succeeds if there are more than S= log n high collision roots. Let St be the random variable indicating the success of the game. 26
Observe that the 0th game is simply the branching-process game and hence Sbr = S0. The (=8)th game diers from the edge-collision game only in that in the edge-collision game all the z-nodes/edges added in Step 3 are treated as alive while in the (=8)th game some of the z-edges may die according to the xhr;~`i variables. The additional children at layer D only hurt the edgeh i collision game player. Therefore, Pr S(=8) Pr [ Sed ]. What remains to prove is that for every t 2 [1::=8], Pr [ St?1 ] Pr [ St ]. Let V~( 1, h
i
Pr X^ 2jRj = Pr [ X 2jRj ] Pr [ Y 2jRj ] 2?0:38jRj :
28
In Claim 3, we rst show that the probability of Prog h ;ri (G) being true is small for low collision roots r. Then we will apply the above lemma in Claim 4 to get the desired bound for the second sum.
Claim 3 For any computation path in A, any root r and any subset O of roots indicating for
which roots r0 other than r, Prog h ;r0 i (G) is true, h
PrG2Bk Prog h ;ri (G) j G 2 Bk (E ) and O
34 y yh+ ;rzi h ;ri h ;ri
i
Proof: Let us consider a xed and r. Recall that ~`r (G) is the random variable indicating the vector of edge labels on the hard path rooted at r in graph G drawn from Bk and that ~`r (G) 2 Yh ;ri [ Zh ;ri. Recall as well that Prog h ;ri (G) is true if and only if ~`r (G) 2 Yh ;ri . We shall drop the subscripts in Yh ;ri , Zh ;ri , yh ;ri , zh ;ri , ~`r (G), Prog h ;ri(G) and E when there is no confusion. We shall also write PrG2Bk [ j G 2 Bk (E ) ] as Pr [ j E ]. Note that Pr [ Prog (G) j E and O ] Pr [ Prog (G) j E and O ] = Pr [ Prog (G) j E and O ] + Pr [ :Prog (G) j E and O ] i
h
Pr ~`(G) = ~` j E and O i h i P h = P ~ ~ ~ ~ ` ( G ) = ` j E and O Pr ` ( G ) = ` j E and O + Pr ~`2Z ~`2Y P
~`2Y
i
h
Let ~`y be the vector in Y that maximizes Pr ~`(G) = ~` j E and O over ~` 2 Y and let ~`z be the i h vector in Z that minimizes Pr ~`(G) = ~` j E and O over ~` 2 Z . The above probability is at most i
h
y Pr ~`(G) = ~`y j E and O i i h h y Pr ~`(G) = ~`y j E and O + z Pr ~`(G) = ~`z j E and O y = ~ ~ [ `(G)=`z jE and O ] y + Pr Pr[ ~`(G)=~`y jE and O ] z What remains to be proven is that
i
h
Pr ~`(G) = ~`z j E and O i 3 h 4 ~ ~ Pr `(G) = `y j E and O Let Ny (G) and Nz (G) be respectively the set of edges on the path with label ~`y and ~`z from root r in G. Let H (G) be the random variable specifying the hard path rooted at r in G, i.e. both the nodes and the labels ~`(G). The fact that ~`y 2 Y means that the path following the edge labels in ~`y is totally contained in E . Therefore, Ny (G) is equal to some xed value Ny determined by E . Then the statements ~`(G) = ~`y and ~`(G) = ~`z are equivalent to H (G) = Ny and H (G) = Nz (G) 29
respectively. The possible values Nz for the random variable Nz (G) (i.e. the path in G rooted at r with edge labels ~`z ) can be divided into two sets. Let Nz 2 Az if and only if some edge hu; `; v i in Nz has the same destination with a dierent edge hu0 ; `0; v 0i in E , i.e., v = v 0 but hu; `i 6= hu0 ; `0i. In this case, Nz cannot be the hard path. That is, for Nz 2 Az , Pr [ H (G) = Nz j E and O ] = 0. Now consider an Nz 2= Az . Given that G contains E [ Nz and satis es O, we argue that it is equally likely for H (G) to be Ny or Nz . To see this, rst observe that O does not aect how H (G) can be chosen because O is a condition on the hard paths of roots other than r. Secondly, both xed paths Ny and Nz are contained in E [ Nz , started from root r. Furthermore, neither Ny nor Nz contains any collision node with respect to E [ Nz . By symmetry, it is equally likely for Ny and Nz to be chosen as H (G). Hence, Pr [ H (G) = Ny j Nz (G) = Nz and E and O ] = Pr [ H (G) = Nz j Nz (G) = Nz and E and O ] Note as well that \H (G) = Nz " implies \Nz (G) = Nz ". Therefore, Pr [ H (G) = Ny and Nz (G) = Nz j E and O ] = Pr [ H (G) = Nz and Nz (G) = Nz j E and O ] = Pr [ H (G) = Nz j E and O ] The above ratio then becomes h i Pr ~`(G) = ~`z j E and O i h Pr ~`(G) = ~`y j E and O P Pr [ H (G) = Nz j E and O ] = Nz 2= Az Pr [ H (G) = Ny j E and O ] P Pr [ H (G) = Ny and Nz (G) = Nz j E and O ] = Nz 2= Az Pr [ H (G) = Ny j E and O ] = Pr [ Nz (G) 2= Az j H (G) = Ny and E and O ] The input distribution Bk rst chooses the hard paths. Then every other edges is added independently at random. If Nz (G) is not a hard path, at each level i 2 [2::D], its node is chosen from the 2k =2 easy nodes at this level. A sucient condition for Nz (G) not to be in Az is that for all its edges not xed by E , their destinations do not collide with any node mentioned in E . Let hi be the number of nodes mentioned in E at level i that Nz (G) must avoid. It follows that Pr [ Nz (G) 2= Az j H (G) = Ny and E and O ] i2[2::D](1 ? 2khi=2 ) P
] 1 ? i22k[2::D =2
hi
30
1 ? 22k ==28 43
because nodes.
P
i2[2::D] hi
=8 as E contains at most =8 dierent edges and each edge involves 2
Claim 4 For any computation path in A, h
i
PrG2Bk w 00(G) S= log n j G 2 Bk (E ) 2?9S :
Proof: Recall that w 00(G) is the number of roots r in G such that r is a low collision root with respect to and Prog h ;ri (G) is true. Hence, the expected value of w 00(G) is h
X
low collision roots r
and by Claim 3,
PrG2Bk Prog h ;ri (G) j G 2 Bk (E )
i
4 yh ;ri lowPcollision root r 3 yh ;ri + zh ;ri root r yh ;ri 43 low collision 0 D f X
6 f D0 ;
as r yh ;ri =8 (at most =8 dierent edges are queried by .) Since 2 O(n) and f D0 n10, we have 2 O(n?9 ). By Lemma 12.1, P
PrG2Bk
w00(G) S
log n j G 2 Bk (E )
2?( log n )(log( log n )?log e) 2?9S : S
S
13 Conclusion We have proven that any 2-sided probabilistic NNJAG solving the st-connectivity problem for nnode graphs in (expected) time T using space S must have T 2 2 (log2 (n=S )) when S 2 O(n1? ), n log n for some > 0, and T 2 2 (log2 ( S )= log log n) (nS= log n)1=2 for general S 2 O(n log n). This greatly improves the previous bounds of ST 2 (n2 = log n) by Barnes and Edmonds [BE93] and S 1=3T 2 (n4=3) by Edmonds [Edm93a]. Moreover, the bound is tight for S 2 n1? (1) . As a corollary, we also obtained a space lower bound of (log2 n) on a probabilistic NNJAG. No such tight lower bound was known before even in the more restricted JAG model. 31
An obvious open problem is to close the gap between the upper and lower bounds when S 2=
n1? (1) . However, the major open problem is to prove similar lower bounds on a general model of
computation. To acheive that, one possible approach is to start with a JAG/NNJAG-like model and add more and more power, pushing our way towards the ultimate model of the branching program. A major complaint to a JAG or NNJAG is its restricted access to the inputs. As pointed out in Etessami and Immerman [EI94], the space lower bounds of [CR80, BS83, Poo93] are proven on a tree. However, it is easy for a RAM to solve stcon on trees in O(log n) space. All it needs to do is to walk a \pebble" from node t backward and see if it hits node s. In response to this, we de ne a model called the Stack NNJAG that can solve stcon for trees in O(log n) space and yet on this model we can still prove the same time-space lower bound. In this model, there is a constant number of stack pebbles in addition to those regular pebbles. Each stack pebble has a stack which can remember the path that it has traversed since its last jump. More precisely, all the pebbles, whether the regular or the stack ones, are initially on node s. The stack of each stack pebble is empty initially. Whenever a stack pebble walks along an edge (u; v ), the node u is pushed onto the stack. Whenever a stack pebble jumps to another pebble P 0 , it empties its stack. If P 0 is also a stack pebble, then P copies the stack of P 0 to its own stack. A stack pebble can also backtrack along the path, i.e., to move to the node v if v is the top of the stack and then pop the stack. Note that the pebble is not allowed to visit any arbitrary node. Any node reachable by a stack pebble must be reachable from s by a directed path. The space for storing the stacks is given for free. To prove the time-space lower bound, observe that the height of the graph used in our paper is p p O( (n log n)=S). If (n log n)=S S= log n, each stack can only store at most O(S= log n) nodes. Since a Stack NNJAG has a constant number of Stack pebbles, it can be simulated by a normal NNJAG with at most (S= log n) extra pebbles. The extra pebbles simply jump to and remain on each node that a stack pebble reaches. This increases the space used by the algorithm by at p most (S ). If (n log n)=S S= log n, then S n1=3 log n. In this case, the bound we have for a normal NNJAG is T = 2 (log2 n) . Now observe that the height of each stack is at most the height of p the graph, i.e., at most O( n log n). Hence any Stack NNJAG with space S can be simulated by a p p normal NNJAG with space O(S + n log n) 2 O( n log n). Hence the same lower bound applies. Note that the Stack NNJAG model seems to be incomparable with a branching program because of the way we charge the space. Also, de ning an intermediate model between the NNJAG model and branching program seems hard. For example, allowing the model to move a pebble to an arbitrary node or to the next node in some xed ordering would give the power of branching programs. Within a polynomial factor of time and constant factor of space, so does allowing it to move pebble backwards along any directed edge [BBR+ 90]. The idea is that one can treat the graph as undirected and using a universal traversal sequence [AKL+ 79], visit any vertex in polynomial 32
time. Hence whenever the branching program queries the out-edges of a node v , the enchanced NNJAG can place a pebble on node v (by the universal traversal sequence) and perform the same query on v .
Acknowledgments We are especially grateful to Greg Barnes for his invaluable insights. We thank Allan Borodin, Faith Fich, Charles Racko and Hisao Tamaki for their helpful discussions and support. We also thank the annonymous referees for their careful reading and helpful comments. Last but not the least, we thank Johan Hastad for pointing out a bug in the original proof of Lemma 12.1.
References [AKL+ 79]
R. Aleliunas, R. M. Karp, R. J. Lipton, L. Lovasz, and C. Racko. Random walks, universal traversal sequences, and the complexity of maze problems. In 20th Annual Symposium on Foundations of Computer Science, pages 218{223, San Juan, Puerto Rico, October 1979. IEEE.
[AN72]
K. B. Athreya and P. E. Ney, editors. Branching Processes. Springer-verlag, Berlin, 1972.
[BBR+ 90]
P. Beame, A. Borodin, P. Raghavan, W. L. Ruzzo, and M. Tompa. Time-space tradeos for undirected graph connectivity. In 31st Annual Symposium on Foundations of Computer Science, pages 429{438, St. Louis, MO, October 1990. IEEE. Full version submitted for journal publication.
[BBRS92]
Greg Barnes, Jonathan F. Buss, Walter L. Ruzzo, and Baruch Schieber. A sublinear space, polynomial time algorithm for directed s-t connectivity. In Proceedings, Structure in Complexity Theory, Seventh Annual Conference, pages 27{33, Boston, MA, June 1992. IEEE.
[BC82]
A. Borodin and S. A. Cook. A time-space tradeo for sorting on a general sequential model of computation. SIAM Journal on Computing, 11(2):287{297, May 1982.
[BE93]
Greg Barnes and Je Edmonds. Time-space lower bounds for directed s-t connectivity on JAG models. In 34th Annual Symposium on Foundations of Computer Science, pages 228{237, Palo Alto, CA, November 1993.
[Bea91]
P. Beame. A general time-space tradeo for nding unique elements. SIAM Journal on Computing, 20(2):270{277, 1991. 33
[BFK+ 81]
A. Borodin, M. J. Fischer, D. G. Kirkpatrick, N. A. Lynch, and M. Tompa. A time-space tradeo for sorting on non-oblivious machines. Journal of Computer and System Sciences, 22(3):351{364, June 1981.
[BFMadH+ 87] A. Borodin, F. Fich, F. Meyer auf der Heide, E. Upfal, and A. Wigderson. A timespace tradeo for element distinctness. SIAM Journal on Computing, 16(1):97{99, February 1987. [Bor82]
Allan Borodin. Structured vs. general models in computational complexity. L'Enseignement Mathematique, XXVIII(3-4):171{190, July-December 1982. Also in [L'E82, pages 47{65].
[BRT92]
A. Borodin, W. L. Ruzzo, and M. Tompa. Lower bounds on the length of universal traversal sequences. Journal of Computer and System Sciences, 45(2):180{203, October 1992.
[BS83]
Piotr Berman and Janos Simon. Lower bounds on graph threading by probabilistic machines. In 24th Annual Symposium on Foundations of Computer Science, pages 304{311, Tucson, AZ, November 1983. IEEE.
[CR80]
S. A. Cook and C. W. Racko. Space lower bounds for maze threadability on restricted machines. SIAM Journal on Computing, 9(3):636{652, August 1980.
[Edm93a]
Je Edmonds. Time-Space Lower Bounds for Undirected and Directed STConnectivity on JAG Models. PhD thesis, University of Toronto, 1993.
[Edm93b]
Je Edmonds. Time-space trade-os for undirected st-connectivity on a JAG. In Proceedings of the Twenty Fifth Annual ACM Symposium on Theory of Computing, pages 718{727, San Diego, CA, May 1993.
[EI94]
Kousha Etessami and Neil Immerman. Reachability and the power of local ordering. In 11th Annual Symposium on Theoretical Aspects of Computer Science, pages 123{ 135, February 1994. Springer-Verlag LNCS 775.
[EP95]
Je Edmonds and Chung Keung Poon. A nearly optimal time-space lower bound for directed st-connectivity on the NNJAG model. In Proceedings of the Twenty Seventh Annual ACM Symposium on Theory of Computing, pages 147{156, Las Vegas, NV, May 1995.
[Gil77]
J. Gill. Computational complexity of probabilistic Turing machines. SIAM Journal on Computing, 6(4):675{695, December 1977. 34
[Imm88]
Neil Immerman. Nondeterministic space is closed under complementation. SIAM Journal on Computing, 17(5):935{938, October 1988.
[Joh90]
David S. Johnson. A catalog of complexity classes. In Jan van Leeuwan, editor, Handbook of Theoretical Computer Science, volume A: Algorithms and Complexity, chapter 2, pages 67{161. M.I.T. Press/Elsevier, 1990.
[L'E82]
Logic and Algorithmic, An International Symposium Held in Honor of Ernst Specker, Zurich, February 5{11, 1980. Monographie No. 30 de L'Enseignement Mathematique, Universite de Geneve, 1982.
[LP82]
H. R. Lewis and C. H. Papadimitriou. Symmetric space-bounded computation. Theoretical Computer Science, 19(2):161{187, August 1982.
[Nis92]
Noam Nisan. RL SC . In Proceedings of the Twenty Fourth Annual ACM Symposium on Theory of Computing, pages 619{623, Victoria, B.C., Canada, May 1992.
[NSW92]
Noam Nisan, Endre Szemeredi, and Avi Wigderson. Undirected connectivity in O(log1:5 n) space. In 33rd Annual Symposium on Foundations of Computer Science, Pittsburgh, PA, October 1992. IEEE.
[Pip92]
Nicholas Pippenger. The asymptotic optimality of spider-web networks. Discrete Applied Mathematics, 37/38:437{450, 1992.
[Poo93]
Chung Keung Poon. Space bounds for graph connectivity problems on node-named JAGs and node-ordered JAGs. In 34th Annual Symposium on Foundations of Computer Science, pages 218{227, Palo Alto, CA, November 1993.
[Poo96]
Chung Keung Poon. On the Complexity of the ST-Connectivity Problem. PhD thesis, University of Toronto, 1996.
[Sav70]
W. J. Savitch. Relationships between nondeterministic and deterministic tape complexities. Journal of Computer and System Sciences, 4(2):177{192, 1970.
[Sze88]
Robert Szelepcsenyi. The method of forcing for nondeterministic automata. Acta Informatica, 26:279{284, 1988.
[Tom82]
Martin Tompa. Two familiar transitive closure algorithms which admit no polynomial time, sublinear space implementations. SIAM Journal on Computing, 11(1):130{137, February 1982.
35
[Wig92]
Avi Wigderson. The complexity of graph connectivity. In I. M. Havel and V. Koubek, editors, 17th Symp. Mathematical Foundations of Computer Science, pages 112{132. Springer-Verlag LNCS 629, August 1992.
[Yao77]
A. C. Yao. Probabilistic computations: Toward a uni ed measure of complexity. In 18th Annual Symposium on Foundations of Computer Science, pages 222{227, Providence, RI, October 1977. IEEE.
[Yao88]
A. C. Yao. Near-optimal time-space tradeo for element distinctness. In 29th Annual Symposium on Foundations of Computer Science, pages 91{97, White Plains, NY, October 1988. IEEE.
36