기본 정보
- 저자
- DOI
- 10.4230/lipics.stacs.2020.34
- 저널
- DROPS (Schloss Dagstuhl – Leibniz Center for Informatics)
- 발행년도
- 2020
- 발행기관
- Schloss Dagstuhl – Leibniz Center for Informatics
- 피인용수
- 7
- 라이선스
- cc-by
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.STACS.2020.34
- 토픽
- Graphene research and applications
- OpenAlex ID
- W3013947378
평가 내용
- 관련도
- 사업분야
- 수소연료전지 · (6) PEM(고분자전해질막)
- 부 분야
- –
- R&D 측면
- –
- 확신도
- –
- 근거 용어
- –
- 판단 근거
- 임베딩 유사도 기반 평가로 '수소연료전지 > PEM(고분자전해질막)' 분야에 선정된 논문입니다.
- R&D 활용 포인트
- –
- 평가 입력
- –
초록
본문 77,310자
본문 펼치기
섹션 본문 148문단 · 64,288자
(제목 없음)
1The semi-streaming model is a variant of the streaming model frequently used for the computation of graph problems. It allows the edges of an n-node input graph to be read sequentially in p passes usingÕ(n) space. If the list of edges includes deletions, then the model is called the turnstile model; otherwise it is called the insertion-only model. In both models, some graph problems, such as spanning trees, k-connectivity, densest subgraph, degeneracy, cut-sparsifier, and (∆ + 1)-coloring, can be exactly solved or (1 + ε)-approximated in a single pass; while other graph problems, such as triangle detection and unweighted all-pairs shortest paths, are known to requireΩ(n) passes to compute. For many fundamental graph problems, the tractability in these models is open. In this paper, we study the tractability of computing some standard spanning trees, including BFS, DFS, and maximum-leaf spanning trees.Our results, in both the insertion-only and the turnstile models, are as follows.Maximum-Leaf Spanning Trees:This problem is known to be APX-complete with inapproximability constant ρ ∈ [245/244, 2). By constructing an ε-MLST sparsifier, we show that for every constant ε > 0, MLST can be approximated in a single pass to within a factor of 1 + ε w.h.p. (albeit in super-polynomial time for ε ≤ ρ − 1 assuming P = NP) and can be approximated in polynomial time in a single pass to within a factor of ρn + ε w.h.p., where ρn is the supremum constant that MLST cannot be approximated to within using polynomial time andÕ(n) space. In the insertion-only model, these algorithms can be deterministic. BFS Trees: It is known that BFS trees require ω(1) passes to compute, but the naïve approach needs O(n) passes. We devise a new randomized algorithm that reduces the pass complexity to O( √ n), and it offers a smooth tradeoff between pass complexity and space usage. This gives a polynomial separation between single-source and all-pairs shortest paths for unweighted graphs. DFS Trees: It is unknown whether DFS trees require more than one pass. The current best algorithm by Khan and Mehta [STACS 2019] takesÕ(h) passes, where h is the height of computed DFS trees. Note that h can be as large as Ω(m/n) for n-node m-edge graphs. Our contribution is twofold. First, we provide a simple alternative proof of this result, via a new connection to sparse certificates for k-node-connectivity. Second, we present a randomized algorithm that reduces the pass complexity to O( √ n), and it also offers a smooth tradeoff between pass complexity and space usage.ACM Subject Classification Theory of computation → Streaming, sublinear and near linear time algorithmsAcknowledgements We thank the anonymous reviewers for their helpful comments, and Eric Allender and Meng Li for their insightful discussions.In this paper, we study the tractability of computing standard spanning trees for connected simple undirected graphs, including BFS trees, DFS trees, and MLST. Unless otherwise stated, our upper bounds work in the turnstile model (and hence also in the insertion-only model), and our lower bounds hold for the insertion-only model (and hence also in the turnstile model). The space upper and lower bounds are in bits. Our results are as follows.Maximum-Leaf Spanning Trees:We show, by constructing an ε-MLST sparsifier (Theorem 6), that for every constant ε > 0, MLST can be approximated in a single pass to within a factor of 1 + ε w.h.p. 2 (albeit in super-polynomial time for ε ≤ ρ − 1 since it is20]with inapproximability constant ρ ∈ [245/244, 2) [9]) and can be approximated in polynomial time in a single pass to within a factor of ρ n + ε w.h.p., where ρ n is the supremum constant that MLST cannot be approximated to within using polynomial time andÕ(n) space. In the insertion-only model, these algorithms are deterministic. We also show a complementary hardness result (Theorem 17) that for every k ∈ [1, (n − 5)/4], to approximate MLST to within an additive error k, any single-pass randomized streaming algorithm that succeeds with probability at least 2/3 requires Ω(n 2 /k 2 ) bits. This hardness result excludes the possibility to have a single-pass semi-streaming algorithm to approximate MLST to within an additive error n 1/2−Ω(1) . Our results for MLST shows that intractability in the sequential computation model (i.e., Turing machine) does not imply intractability in the semi-streaming model.Our algorithms rely on a new sparse certificate, the ε-MLST sparsifier, defined as follows. Let G be an n-node m-edge connected simple undirected graph. Then for any given constant ε > 0, H is an ε-MLST sparsifier if it is a connected spanning subgraph of G with |E(H)| ≤ f (ε)|V (G)| and leaf(H) ≥ (1 − ε) leaf(G), where leaf(G) denotes the maximum number of leaves (i.e. nodes of degree one) that any spanning tree of G can have and f is some function independent of n. We show that an ε-MLST sparsifier can be constructed efficiently in the semi-streaming model. Theorem 1. In the turnstile model, for every constant ε > 0, there exists a randomized algorithm that can find an ε-MLST sparsifier with probability 1 − 1/n Ω(1) using a single pass,Õ(f (ε)n) space, andÕ(n + m) time, and in the insertion-only model a deterministic algorithm that uses a single pass,Õ(f (ε)n) space, and O(n + m) time.Combining Theorem 1 with any polynomial-time RAM algorithms for MLST that uses O(n + m) space, e.g,[35,36,43], we obtain the following result.Corollary 2. In the turnstile model, for every constant ε > 0, there exists a randomized algorithm that can approximate M LST for any n-node connected simple undirected graph with probability 1 − 1/n Ω(1) to within a factor of ρ n + ε using a single pass,Õ(f (ε)n) space, and polynomial time, where ρ n is the supremum constant that MLST cannot be approximated to within using polynomial time andÕ(n) space, and in the insertion-only model a deterministic algorithm that uses a single pass,Õ(f (ε)n) space, and polynomial time.Using Corollary 2, we show that approximate connected maximum cut can be computed in a single pass usingÕ(n) space for unweighted regular graphs (Corollary 7).BFS Trees:It is known that BFS trees require ω(1) passes to compute[17], but the naive approach needs O(n) passes. We devise a randomized algorithm that reduces the pass complexity to O( √ n) w.h.p., and give a smooth tradeoff between pass complexity and space usage.
Introduction
2Spanning trees are critical components of graph algorithms, from depth-first search trees (DFS) for finding articulation points and bridges [45], computing st-numbering [13], chain decomposition [42], and coloring signed graphs [18], to breadth-first search trees (BFS) for finding separators [34], computing sparse certificates of k-node-connectivity [8,12], approximating diameters [10,41], and characterizing AT-free graphs [5], and to maximumleaf spanning trees (MLST) for connected dominating sets [36,43] and connected maximum cuts [26,21].
3In the semi-streaming model, the tractability of spanning tree computation, except arbitrary spanning trees [3,44,40], is less studied. The semi-streaming model [38,3] is a variation of streaming model frequently used for the computation of graph problems. It allows the edges of an n-node input graph to be read sequentially in p passes usingÕ(n) 1 space. If the list of edges includes deletions, then the model is called the turnstile model; otherwise it is called the insertion-only model. In both models, some graph problems, such as spanning trees [3], k-connectivity [25], densest subgraph [37], degeneracy [15], cut-sparsifier [30], and (∆ + 1)-coloring [4], can be exactly solved or (1 + ε)-approximated in a single pass, while other graph problems, such as triangle detection and unweighted all-pairs shortest paths [7], are known to requireΩ(n) passes to compute. For many fundamental graph problems, e.g., standard spanning trees, the tractability in these models is open. BFS computation is known to require ω(1) passes [17], but only the naive O(n)-pass algorithm is known. It is unknown whether DFS computation requires more than one passes [14,31], but the current best algorithm needsÕ(h) passes [31] where h is the height of the computed DFS trees, so h = O(n) for dense graphs. The tractability of maximum-leaf spanning trees (MLST) is unknown even allowing O(n 2 ) space, since it is APX-complete [35,20].
4Due to the lack of efficient streaming algorithms for spanning tree computation, for some graph problems that are traditionally solved using spanning trees, such as finding articulation points and bridges, people had to look for alternative methods when designing streaming algorithms for these problems [16,14]. The alternative methods, even if they are based on known results in graph theory, may still involve the design of new streaming algorithms. For the problems mentioned above, the alternative methods use newly-designed sparse connectivity certificates [12,25] that are easily computable in the semi-streaming model, rather than the classical one due to Nagamochi and Ibaraki [39]. Hence establishing the hardness of spanning tree computation helps to explain the need of the alternative methods.
Theorem 3. In the turnstile model, for each p ∈ [1,
5√ n], there exists a randomized algorithm that can compute a BFS tree for any n-node connected simple undirected graph with probability 1 − 1/n Ω (1) in p passes usingÕ((n/p) 2 ) space, and in the insertion-only model a deterministic algorithm that usesÕ(n 2 /p) space.
6This gives a polynomial separation between single-source and all-pairs shortest paths for unweighted graphs because any randomized semi-streaming algorithm that computes unweighted all-pairs shortest paths with probability at least 2/3 requiresΩ(n) passes.
7We extend Theorem 3 and obtain that multiple BFS trees, each starting from a unique source node, can be computed more efficiently in pass complexity in a batch than individually (see Theorem 13). We show that this batched BFS has applications to computing a 1.5approximation of diameters for unweighted graphs (Theorem 15) and a 2-approximation of Steiner trees for unweighted graphs (Corollary 14).
DFS Trees:
8It is unknown whether DFS trees require more than one passes [14,31], but the current best algorithm needsÕ(h) passes due to Khan and Mehta [31], where h is the height of computed DFS trees. We devise a randomized algorithm that has pass complexity O( √ n) w.h.p., and give a smooth tradeoff between pass complexity and space usage.
Theorem 4.
9In the turnstile model, for each p ∈ [1, √ n], there exists a randomized algorithm that can compute a DFS tree for any n-node connected simple undirected graph with probability 1 − 1/n Ω (1) in p passes that usesÕ(n 3 /p 4 ) space, and in the insertion-only model a deterministic algorithm that usesÕ(n 2 /p 2 ) space.
10For dense graphs, our algorithms improves upon the current best algorithms for DFS due to Khan and Mehta [31] which needs Ω(m/n) passes for n-node m-edge graphs in the worst case because of the existence of (m/n)-cores, where a k-core is a maximal connected subgraph in which every node has at least k neighboring nodes in the subgraph.
Technical Overview
11Maximum-Leaf Spanning Trees: We construct an ε-MLST sparsifier by a new result that complements Kleitman and West's lower bounds on the maximum number of leaves for graphs with minimum degree δ ≥ 3 [32]. The lower bounds are: if a connected simple undirected graph G has minimum degree δ for some sufficiently large δ, then leaf(G) ≥ (1 − (2.5 ln δ)/δ)|V (G)| and the leading constant can be larger for δ ∈ {3, 4}. Our complementary result (Lemma 5), without the restriction on the minimum degree, is: any connected simple undirected graph G, except the singleton graph, has
12where inode(G) denotes the number of nodes whose degree is two and whose neighbors both have degree two. Equation (1) implies that, if one can find a connected spanning subgraph
13, then one gets an (10ε)-MLST sparsifier.
14Our sparsification technique is general enough to obtain a (t + ε)-approximation for MLST in a single pass usingÕ(n) space by combining any t-approximationÕ(n)-space RAM algorithm for MLST with our ε-MLST sparsifier. On the other hand, since in linear time one can find an ε-MLST sparsifier of O(n) edges, any t-approximation RAM algorithm for MLST with time complexity O(f (n, m)) can be reduced to O(f (n, n) + n + m) if a small sacrifice on approximation ratio is allowed. This reduces the time complexity of RAM algorithms for MLST that need superlinear time on the number of edges, such as the local search approach from O(m k n k+2 ) for k ≥ 1 to O(n 2k+2 ) and the leafy forest approach from O((m + n)α(n)) to O(m + nα(n)), both due to Lu and Ravi [35,36].
BFS Trees:
15We present a simple deterministic algorithm attaining a smooth tradeoff between pass complexity and space usage. In particular, in the insertion-only semi-streaming model, the algorithm finishes in O(n/poly log n) passes. The algorithm is based on an observation that the sum of degrees of nodes in any root-to-leaf path of a BFS tree is bounded by O(n) (Lemma 8).
16Our more efficient randomized algorithm (Theorem 3) constructs a BFS tree by combining the results of multiple instances of bounded-radius BFS. To reduce the space usage, the simulation of these bounded-radius BFS are assigned random starting times, and the algorithm only maintains the last three layers of each BFS tree. These ideas are borrowed from results on shortest paths computation in the parallel and the distributed settings [11,22,27,46].
DFS Trees:
17We present a simple alternative proof of the result of Khan and Mehta [31] that a DFS tree can be constructed in h/k passes usingÕ(nk) space, for any given parameter k, where h is the height of the computed DFS tree. The new proof is based on the following connection between the DFS computation and the sparse certificates for k-node-connectivity. We show in Lemma 16 that the first k layers of any DFS tree of a such a certificate H can be extended to a DFS tree of the original graph G.
18The proof of Theorem 4 is based on the parallel DFS algorithm of Aggarwal and Anderson [2]. In this paper we provide an efficient implementation of their algorithm in the streaming model, also via the sparse certificates for k-node-connectivity, which allows us to reduce the number of passes by batch processing.
19We note that in a related work, Ghaffari and Parter [23] showed that the parallel DFS algorithm of Aggarwal and Anderson can be adapted to distributed setting. Specifically, they showed that DFS can be computed in the CONGEST model inÕ( √ Dn + n 3/4 ) rounds, where D is the diameter of the graph.
Paper Organization
20In Section 2, we present how to construct an ε-MLST sparsifier and apply it to devise single-pass semi-streaming algorithms to approximate MLST to within a factor of (1 + ε) for every constant ε > 0. Then, in Section 3, we show how to compute a BFS tree rooted at a given node by an O( √ n)-passÕ(n)-space algorithm w.h.p. and its applications to computing approximate diameters and approximate Steiner trees. In Section 4, we have a similar result for computing DFS trees; that is, O( √ n)-passÕ(n)-space algorithm that succeeds w.h.p. Lastly, we prove the claimed single-pass lower bound in Section 5.
Maximum-Leaf Spanning Trees
21In this section, we will show how to construct an ε-MLST sparsifier in the semi-streaming model; that is, proving Theorem 1. We recall the notions defined in Section 1 before proceeding to the results. By ignorable node, we denote a node x whose degree is two and whose neighbors u and v have degree two as well. Note that u = v for simple graphs. Let leaf(G) be the maximum number of leaves (i.e. nodes of degree one) that a spanning tree of G can have. Let inode(G) denote the number of ignorable nodes in G. Let deg G (x) denote the degree of node x in graph G. Let S k (G) denote any subgraph of G so that S k (G) contains all nodes in G and every node x in S k (G) has degree deg S k (x) ≥ min{deg G (x), k}. Let T (G) be any spanning tree of a connected graph G.
22We begin with a result that complements Kleitman and West's lower bounds on the number of leaves for graphs with minimum degree δ for any δ ≥ 3. Our lower bound does not rely on the degree constraint. The constant 1/10 in Lemma 5 may be improved, but the subsequent lemmata and theorems only require it to be Ω(1).
Lemma 5.
23Every connected simple undirected graph G, except the singleton graph, has
24Proof. Our proof is a generalization of the dead leaf argument due to Kleitman and West [32]. Let T be a tree rooted at s with N (s) as leaves for some arbitrary node s ∈ G initially, where N (s) denotes the neighbors of s, and then grow T iteratively by a node expansion order, defined below. By expanding T at node x, we mean to select a leaf node x of T and add all of x's neighbors in G\T , say y 1 , y 2 , . . . , y d , and their connecting edges, (x, y 1 ), (x, y 2 ), . . . , (x, y d ), to T . In this way, every node outside T cannot be a neighbor of any non-leaf node in T . We say a leaf node in T is dead if it has no neighbor in G \ T . Let (∆n) i denote the number of non-ignorable nodes in G that joins T while the i-th operation is applied. Let (∆ ) i denote the change of the number of leaf nodes in T while the i-th operation is applied. Let (∆m) i denote the change of the number of dead leaf nodes in T while the i-th operation is applied. The subscript i may be removed when the context is clear. We need to secure that ∆ + ∆m ≥ ∆n/5 holds for each of the following operations and the initial operation.
Operation 1:
25If T has a leaf node x that has d ≥ 2 neighbors outside T , then expand T at x. In this case, ∆n ≤ d, ∆ ≥ d − 1, and ∆m ≥ 0. Operation 2: If every leaf node in T has at most one neighbor outside T and some node
26x / ∈ T has d ≥ 2 neighbors in T , then expand T at one of x's neighbors in T . In this case, ∆n ≤ 1, ∆ = 0, and ∆m = d − 1. Operation 3: This operation is used only when the previous two operations do not apply.
27Let x 0 be some leaf in T that has exactly one neighbor x 1 not in T . For each i ≥ 1, if x i is defined and all neighbors of x i other than x i−1 are outside T and x i has degree two in G, then define x i+1 to be the neighbor of x i other than x i−1 . Suppose that x i for i ≤ k are defined and x k+1 is not defined, then we expand T at x i for each i ≤ k in order. Though k can be arbitrarily large, ∆n ≤ 2 + deg G (x k ). If x k+1 is not defined and x k has d > 0 neighbors other than x k−1 in T (thus k ≥ 2 in this case otherwise Operation 2 applies), then we discuss in subcases: It is clear that one can expand T to get a spanning tree of G by a sequence of the above operations. Because all leaves are eventually dead, ∆m = ∆ . Consequently, 2 leaf(G) ≥ 2 ∆ = ∆ + ∆m ≥ ( ∆n)/5 = (V (G) − inode G)/5, as desired.
28Given Lemma 5, our goal is, for every constant ε > 0, find a sparse subgraph H of the input graph G so that:
291. The nodes incident to the edges in T * \ H can be dominated by a small set S of at most ε(|V (G)| − inode(G)) nodes, i.e. either in S or has at least one neighbor node in S using the edges in H, where T * is any optimal MLST of G.
H is connected.
30Because of the existence of the small dominating set S, one can obtain a forest F from T * ∩ H by adding some edges in H so that the number of leaves in F is no less than that in T * by |S| and the number of connected components in F is no more than that in T * by |S|.
31Since H is connected, one can further obtain a spanning tree T from F by adding at most |S| edges in H, so the number of leaves in T is no less than that in F by 2|S|. Pick an H associated with a sufficiently small ε, by Equation (1) H is an ε-MLST sparsifier. A formal proof is given below.
Theorem 6.
32For every integer k ≥ 186, every connected simple undirected graph G has
33Proof. Let T * be a spanning tree of G that has leaf(G) leaves. Let k be some fixed integer at least 3 and let
34x is incident to some e ∈ T * \ H}. Note that every node x ∈ L has deg G (x) > k, so x and all neighbors of x are not ignorable nodes in G. First, we show that L can be dominated by a small set S of size at most ε(|V (G)| − inode(G)) using some edges in H. We obtain S from two parts, S 1 and S 2 . S 1 is a random node subset sampled from the non-ignorable nodes in G, in which each node is included in S 1 with probability p independently, for some p ∈ (0, 1) to be determined later. Thus, E[|S 1 |] = p(|V (G)| − inode(G)). Since every node x ∈ L is adjacent only to the non-ignorable nodes in G, the probability that x ∈ L is not dominated by any node in S 1 is
35Let S 2 be the set of nodes in L that are not dominated by any node in S 1 using the edges in H. Thus,
36Then, we obtain a forest F from T * ∩ H by adding some edges in H as follows. Initially, F = T * ∩ H.
Operation 1:
37For each x ∈ L, if x is an isolated node in T * ∩ H and x / ∈ S, then add an edge e from x to some node in S to F . Such an edge e must exist because S dominates L. Operation 2: For each x ∈ L, if x is not an isolated node in T * ∩ H and the connected component that contains x has an empty intersection with S, then add an edge e from x to some node in S to F . Again, such an edge e must exist because S dominates L.
38is not a leaf in T * ∩ H, then must be an isolated node in T * ∩ H, and by Operation 1 is connected to some node in S unless ∈ S. Hence, except those in S, every is a leaf node in F , so the number of leaves in F is no less than that in T * by |S|. By Operation 2, the number of connected component is at most |S|.
39Lastly, since H is connected, one can obtain a spanning tree T from F by connecting the components in F by some edges in H. Thus, the number of leaves in T is no less than that in T * by 3|S|. To obtain an ε-MLST sparsifier, by Lemma 5 we need:
40Setting p = (ln(k + 1))/(k + 1) gives the desired bound, and the leading constant is positive for k ≥ 186.
41To find such a subgraph H, fetching a spanning tree of the input graph G and grabbing k edges for each node in G suffices. Thus, we get a single-passÕ(n)-space algorithm for the insertion-only model. As for the turnstile model, we useÕ(k) 0 -samplers [29] for each node in G to fetch at least k neighbors of x w.h.p., and fetch a spanning tree by appealing to the single-passÕ(n)-space algorithm for spanning trees in dynamic streams [3]. This gives a proof of Theorem 1.
Applications.
42In [21], Gandhi et al. show a connection between the maximum-leaf spanning trees and connected maximum cut. Their results imply that, for any unweighted regular graph G, the connected maximum cut can be found by the following two steps:
43Step 1: Find a spanning tree T whose leaf(
44Step 2: Randomly partition the leaves in T into two parts L and R so that each leaf is included in L with probability 1/2 independently.
45Then, outputting L and V (G) \ L yields an 8 + ε-approximation for connected maximum cut.
46Step 1 is the bottleneck and can be implemented by combining our ε-MLST sparsifier (Theorem 1) with the 2-approximation algorithm for MLST due to Solis-Oba, Bonsma, and Lowski [43]. This gives Corollary 7.
Corollary 7.
47In the turnstile model, for every constant ε > 0, there exists a randomized algorithm that can approximate the connected maximum cut for n-node unweighted regular graphs to within a factor of 8 + ε with probability 1 − 1/n Ω(1) in a single pass usingÕ(f (ε)n) space.
Breadth-First Search Trees
48A BFS tree of an n-node connected simple undirected graph can be constructed in O(n) passes usingÕ(n) space by simulating the standard BFS algorithm layer by layer. By storing the entire graph, a BFS tree can be computed in a single pass using O(n 2 ) space. In Section 3.1, we show that it is possible to have a smooth tradeoff between pass complexity and space usage. In Section 3.2, we prove Theorem 3, which shows that the above tradeoff can be improved when randomness is allowed, even in the turnstile model. Then, in Section 3.3, we show that multiple BFS trees, each starting from a distinct source node, can be computed more efficiently in a batch than individually. Lastly, we demonstrate an application to diameter approximation in Section 3.4.
49In the BFS problem, we are given an n-node connected simple undirected graph G = (V, E) and a distinguished node s, and it suffices to compute the distance dist(s, v) for each node v ∈ V \ {s}. To infer a BFS tree from the distance information {dist(s, v) : v ∈ V }, it suffices to assign a parent to each node v ∈ V \ {s} the smallest-identifier node from the
50This can be done with one additional pass usingÕ(n) space in the insertion-only model. In the turnstile model, for p-pass streaming algorithms with p > log n, this can be done with O(log n/ log log n) additional passes w.h.p. using O(log n) 0 -samplers [29] for each node v ∈ V \ {s}, and this costsÕ(n) space. For p ≤ log n, the space bound isÕ(n 2 ) and one can useÕ(n) 0 -samplers for each node, so this step can be done in one additional pass. Hence in the subsequent discussion we focus on computing the distance from s to each node v ∈ V \ {s}.
A Simple Deterministic Algorithm
51We present a simple deterministic p-passÕ(n 2 /p)-space algorithm in the insertion-only model by an observation that every root-to-leaf path in a BFS tree cannot visit too many high-degree nodes (Lemma 8). Then, one can simulate the standard BFS algorithm efficiently layer-by-layer over high-degree nodes (Theorem 9).
Lemma 8.
52Let P be a root-to-leaf path in some BFS tree of an n-node connected simple undirected graph G. Then
53, then x i and x j cannot share any neighbor node; otherwise P can be shorten, a contradiction. Thus, for each c ∈ {0, 1, 2} the total contribution of all
54Summing over all possible c gives the bound.
55We note that Lemma 8 is near-optimal. To see why, let
56By setting k = (n − 1)/t for some parameter t, |V 0 | = 1, |V i | = t for every i ∈ [1, k − 1], and 1 ≤ |V k | ≤ t, any BFS tree rooted at the node in V 0 has a root-to-leaf path Q of length k, and each node in
57Theorem 9. Given an n-node connected simple undirected graph G with a distinguished node s, a BFS tree rooted at s can be found deterministically in p passes usingÕ(n 2 /p) space for every p ∈ [1, n] in the insertion-only model.
58Proof. Given a parameter k, our algorithm goes as follows. In the first pass, keep arbitrary n/k neighbors for each node v ∈ G in memory and then use the in-memory edges to update the distance dist(s, v) for each v ∈ G by any single-source shortest path algorithm. The set of the in-memory edges is an invariant after the first pass. Hence, the memory usage is O(n 2 /k). Then, in each of the subsequent passes, processing the edges (u, v) in the stream one by one, without keeping them in memory after the processing, if dist(s, u) (s, u)). After the edges in the stream are all processed, use the in-memory edges to update the distance dist(s, v) for each v ∈ G again by any single-source shortest path algorithm but with initial distances. Our algorithm repeats until no distance has been updated in a single pass.
59Observe a root-to-leaf path P = sz 1 z 2 · · · z t in some BFS tree rooted at s. Suppose P contains exactly edges that appears only on tape, let them be (z x1 , z y1 ), . . . ,
60. Let pred P (z i ) be the predecessor of z i on P that is closest to z i among nodes in {s} ∪ {z yj : y j < i}. By the definition of the above construction, it is assured that deg(z xi ) ≥ n/k for each i ∈ [1, ].
61Thus by Lemma 8, = O(k). Then we appeal to the argument used for the analysis of Bellman-Ford algorithm [19,6]. For every i ∈ [1, t], if i / ∈ {y 1 , y 2 , . . . , y }, dist(s, z i ) attains the minimum possible value at the same pass when dist(s, pred P (z i )) attains; otherwise i = y j for some j ∈ [1, ], dist(s, y j ) attains the minimum possible value at most one pass after dist(s, x j ) attains. Hence, O(k) passes suffices to compute dist(s, z i ) for all i ∈ [1, t] and this argument applies to all root-to-leaf paths. Setting k = p yields the desired bound.
A More Efficient Randomized Algorithm
62In this section, we prove Theorem 3. Our BFS algorithm is based on the following generic framework, which has been applied to finding shortest paths in the parallel and the distributed settings [11,22,27,46]. Sample a set U of approximately k distinguished nodes such that each node v = s joins U independently with probability k/n, and s ∈ U with probability 1. By a Chernoff bound, |U | =Θ(k) with high probability. We will grow a local BFS tree of radiusÕ(n/k) from each node in U , and then we will construct the final BFS tree by combining them. We will rely on the following lemma, which first appeared in [46].
Lemma 10 ([46]
63). Let s be a specified source node. Let U be a subset of nodes such that each node v = s joins U with probability k/n, and s joins U with probability 1. For any given parameter C ≥ 1, the following holds with probability 1 − n −Ω(C) . For each node t = s, there is an s-t shortest path P s,t such that each of its C(n log n)/k-node subpath P satisfies
64For notational simplicity, in subsequent discussion we write h = C(n log n)/k−1 =Õ(n/k). Lemma 10 shows that for each node t ∈ V \ {s},
65To see this, consider the s-t shortest path P s,t specified in Lemma 10. If the number of nodes in P s,t is less than h, then the above claim holds because s ∈ U ∩ N h (t). Otherwise, Lemma 10 guarantees that there is a node u ∈ P s,t ∩ U ∩ N h (t) with probability 1 − n −Ω(C) . Using Equation (2), a BFS tree can be computed using the following steps.
66In what follows, we show how to implement the above two steps in the streaming model, usingÕ(n + k 2 ) space andÕ(n/k) passes. By a change of parameter p =Õ(n/k), we obtain Theorem 3.
67Step 1. To compute dist(u, v) for each u ∈ U and v ∈ U ∩ N h (u), we let each u ∈ U initiate a radius-h local BFS rooted at u. A straightforward implementation of this approach in the streaming model costs h =Õ(n/k) passes and O(n · |U |) =Õ(nk) space, since we need to maintain |U | search trees simultaneously.
68We show that the space requirement can be improved toÕ(n + k 2 ). Since we only need to learn the distances between nodes in U , we are allowed to forget distance information associated with nodes v / ∈ U when it is no longer needed. Specifically, suppose we start the BFS computation rooted at u ∈ U at the τ u th pass, where τ u is some number to be determined. For each 0 ≤ i ≤ h − 1, the induction hypothesis specifies that at the beginning of the (τ u + i)th pass, all nodes in L i (u) = {v ∈ V : dist(u, v) = i} have learned that dist(u, v) = i. During the (τ u + i)th pass, for each node v ∈ V with dist(u, v) > i, we check if v has a neighbor in L i (u). If so, then we learn that dist(u, v) = i + 1.
69In the above BFS algorithm, if dist(u, v) = i for some 0 ≤ i ≤ h − 1, then we learn the fact that dist(u, v) = i during the (τ u + i − 1)th pass. Observe that such information is only needed during the next two passes. After the end of the (τ u + i + 1)th pass, for each v ∈ V with dist(u, v) = i, we are allowed to forget that dist(u, v) = i. That is, v only needs to participate in the BFS computation rooted at u during these three passes
70For each u ∈ U , we assign the starting time τ u independently and uniformly at random from {1, 2, . . . , h}. Lemma 11 shows that for each node v ∈ V and for each pass 1 ≤ t ≤ 2h−1, the number of BFS computations that involve v isÕ(1). The idea of using random starting time to schedule multiple algorithms to minimize congestion can be traced back from [33]. Note that τ u + dist(u, v) − 1 ≤ t ≤ τ u + dist(u, v) + 1 is the criterion for v to participate in the BFS rooted at u during the tth pass.
Lemma 11. For each node v, and for each integer
71Proof. Given two nodes u ∈ U and v ∈ V , and a fixed number t, the probability that
72The expected value of X can be upper bounded by µ = |U | · (3/h). By a Chernoff bound, with high probability, X = O(max{log n, |U |/h}).
73Recall that |U | =Õ(k) with high probability, and h =Õ(n/k). By Lemma 11, we only need k 2 /n ·Õ(1) space per each v ∈ V to do the radius-h BFS computation from all nodes u ∈ U . That is, the space complexity isÕ(n + k 2 ). To store the distance information dist(u, v) for each u ∈ U and v ∈ U ∩ N h (u), we needÕ(k 2 ) space. Thus, the algorithm for
74Step 1 costsÕ(n + k 2 ) space. The number of passes is 2h − 1 =Õ(k).
75In the insertion-only model, the implementation is straightforward. In the turnstile model, care has to be taken when implementing the above algorithm. We write x = O(max{log n, |U |/h}) to be the high probability upper bound on the number of BFS computation that a node participates in a single pass. We write y = O(x log n). Let U 1 , U 2 , . . . , U y be random subsets of U such that each u ∈ U joins each U j with probability 1/x, independently. Consider a node v ∈ V and consider the rth pass. Let S be the subset of U such that u ∈ S if r = τ u + dist(u, v) − 1, i.e., the BFS computation rooted at u hits v during the rth pass. We know that with high probability |S| ≤ x. By our choice of U 1 , U 2 , . . . , U y , we can infer that with high probability for each u ∈ S there is at least one index j such that S ∩ U j = {u}.
76To implement the rth pass in the turnstile model, each node v ∈ V virtually maintains y edge set Z 1 , Z 2 , . . . , Z y . For each insertion (resp., deletion) of an edge e = {w, v} satisfying r = τ u + dist(u, w) − 2 for some u ∈ U j , we add (resp., remove) the edge from the set Z j . After processing the entire data stream, we take one edge out of each edge set Z 1 , Z 2 , . . . , Z y . In view of the above discussion, it suffices to only consider these edges when we grow the BFS trees. This can be implemented using y 0 -samplers per each node v ∈ V , and the space complexity is stillÕ(ny) =Õ(n + k 2 ).
77Step 2. At this moment we have computed dist(s, u) for each u ∈ U . Now we need to compute dist(s, t) for each t ∈ V \ {s} by the formula dist(s, t) = min u∈U ∩N h (t) dist(s, u) + dist(u, t).
78In the insertion-only model, this task can be solved using h iterations of Bellman-Ford steps. (2), we can infer that d h (t) = dist(s, t) for each t ∈ V . A straightforward implementation of this procedure costsÕ(n) space and h =Õ(n/k) passes.
79In the turnstile model, we can solve this task by growing a radius-h BFS tree rooted at u, for each u ∈ U , as in Step 1. During the process, each node v ∈ V maintains a variable d(v) which serves as the estimate of dist(s, v). Initially, d(v) ← ∞. When the partial BFS tree rooted at u ∈ U hits v, we update d(v) to be the minimum of the current value of d(v) and dist(s, u) + dist (u, v). At the end of the process, we have
80This costsÕ(n + k 2 ) space andÕ(n/k) passes in view of the analysis of Step 1.
Extensions
81In this section we consider the problem of solving c instances of BFS simultaneously for some c ≤ n and a simpler problem of computing the pairwise distance between the c given nodes. Both of these problems can be solved via a black box application of Theorem 3. In this section we show that it is possible to obtain better upper bounds.
Theorem 12.
82Given an n-node undirected graph G, for any given parameters 1 ≤ c ≤ k ≤ n, the pairwise distances between all pairs of nodes in a given set of c nodes in G can be computed with probability 1 − 1/n Ω(1) usingÕ(n/k) passes andÕ(n + k 2 ) space in the turnstile model.
83Proof. Let S be the input node set of size c. Consider the modified Step 1 of our algorithm where each s ∈ S is included in U with probability 1. Since |S| = c ≤ k, we still have |U | =Õ(k) with high probability. Recall that Step 1 of our algorithm calculates dist(u, v) for each u ∈ U and v ∈ U ∩ N h (u) inÕ(n + k 2 ) space andÕ(n/k) passes. Applying Equation (2) for each s ∈ U , we obtain the pairwise distances between all pairs of nodes in U , which includes S as a subset. There is no need to do Step 2.
84For example, if c = n 1/2 , then Theorem 12 implies that we can compute the pairwise distances between all pairs of nodes in a given set of c nodes inÕ(n) space andÕ(n 1/2 ) passes.
Theorem 13.
85Given an n-node undirected graph G, for any given parameters 1 ≤ c ≤ k ≤ n, one can solve c instances of BFS with probability 1 − 1/n Ω(1) usingÕ(n/k) passes and O(cn + k 2 ) space in the turnstile model.
86Proof. Let S be the node set of size c corresponding to the roots of the c BFS instances. Consider the following modifications to our BFS algorithm.
87Same as the proof of Theorem 12, in Step 1, include each s ∈ S in U with probability 1. The modified Step 1 still takesÕ(n + k 2 ) space andÕ(n/k) passes, and it outputs the pairwise distances between all pairs of nodes in U . Now consider Step 2. In the insertion-only model, remember that a BFS tree rooted at a node s ∈ S can be constructed in O(n) space and h =Õ(n/k) passes using h iterations of Bellman-Ford steps. The cost of constructing all c BFS trees is then O(cn) space and O(n/k) passes.
88In the turnstile model, we can also use the strategy of growing a radius-h BFS tree rooted at u, for each u ∈ U . During the process, each node v ∈ V maintains c variables serving as the estimates of dist(s, v), for all s ∈ S. The complexity of growing radius-h BFS trees is stillÕ(n + k 2 ) space andÕ(n/k) passes. The extra space cost for maintaining these cn variables is O(cn).
89For example, if c = n 1/3 , then Theorem 13 implies that we can solve c instances of BFS inÕ(n 4/3 ) space andÕ(n 1/3 ) passes. Note that the space complexity ofÕ(n 4/3 ) is necessary to output c = n 1/3 BFS trees.
90Theorem 13 immediately gives the following corollary.
Corollary 14.
91Given an n-node connected undirected graph G with unweighted edges and a c-node subset S of G, for any given parameters 1 ≤ c ≤ k ≤ n, finding a Steiner tree in G that spans S can be approximated to within a factor of 2 with probability 1 − 1/n Ω(1) using O(n/k) passes andÕ(cn + k 2 ) space in the turnstile model.
92Note that if we do not need to construct a Steiner tree, and only need to approximate the size of an optimal Steiner tree, then Theorem 12 can be used in place of Theorem 13.
Diameter Approximation
93It is well-known that the maximum distance label in a BFS tree gives a 2-approximation of diameter. We show that it is possible to improve the approximation ratio to nearly 1.5 without sacrificing the space and pass complexities.
94Roditty and Williams [41] showed that a nearly 1.5-approximation of diameter can be computed with high probability as follows. 1. Let S 1 be a node set chosen by including each node v ∈ V to S 1 with probability p = (log n)/ √ n independently. Perform a BFS from each node v ∈ S 1 .
2.
95Let v be a node chosen to maximize dist(v , S 1 ). Break the tie arbitrarily. Perform a BFS from v . 3. Let S 2 be the node set consisting of the √ n nodes closest to v , where ties are broken arbitrarily. Perform a BFS from each node v ∈ S 2 . Let D * be the maximum distance label ever computed during the BFS computations in the above procedure. Roditty and Williams [41] proved that D * satisfies that 2D/3 ≤ D * ≤ D, where D is the diameter of G.
96The algorithm of Roditty and Williams [41] can be implemented in the streaming model by applying Theorem 13 with c =Õ( √ n), but we can do better. Note that when we perform BFS from the nodes in S 1 and S 2 , it is not necessary to store the entire BFS trees. For example, in order to select v * , we only need to let each node v know dist(v, S 1 ), which is the maximum distance label of v in all BFS trees computed in Step 1. Therefore, the O(cn) term in the space complexity of Theorem 13 can be improved to O(n). That is, the space and pass complexities are the same as the cost for computing a single BFS tree using Theorem 3. We conclude the following theorem.
Depth-First Search
97A straightforward implementation of the naive DFS algorithm in the streaming model costs either n − 1 passes withÕ(n) space or a single pass with O(n 2 ) space. Khan and Mehta [31] recently showed that it is possible to obtain a smooth tradeoff between the two extremes. Specifically, they designed an algorithm that requires at most n/k passes usingÕ(nk) space, where k is any positive integer. Furthermore, for the case the height h of the computed DFS tree is small, they further decrease the number of passes to h/k . In Section 4.1, we will provide a very simple alternative proof of this result, via sparse certificates for k-node-connectivity.
98In the worst case, the "space × number of passes" of the algorithms of Khan and Mehta [31] is stillÕ(n 2 ). In Sections 4.2 and 4.3, we will show that it is possible to improve this upper bound asymptotically when the number of passes p is super-constant. Specifically, for any parameters 1 ≤ s ≤ k ≤ n, we obtain the following DFS algorithms. A deterministic algorithm usingÕ((n/k) + (k/s)) passes andÕ(ns) space in the insertiononly model. After balancing the parameters, the space complexity isÕ(n 2 /p 2 ) for p-pass algorithms, for each 1 ≤ p ≤Õ( √ n). A randomized algorithm usingÕ((n/k) + (k/s)) passes andÕ(ns 2 ) space in the turnstile model. After balancing the parameters, the space complexity isÕ(n 3 /p 4 ) for p-pass algorithms, for each 1 ≤ p ≤Õ( √ n).
A Simple DFS Algorithm
99In this section, we present a simple alternative proof of the result of Khan and Mehta [31] that a DFS tree can be constructed in h/k passes usingÕ(nk) space, for any given parameter k, where h is the height of the computed DFS tree.
Sparse Certificate for s-Node-Connectivity.
100A strong s-VC certificate of a graph H is its subgraph K such that for any supergraph G of H, for every pair of nodes s * , t * ∈ G, if they are c-node-connected in G, then they are c -node-connected for some c ≥ min{s, c} in the graph obtained from G by replacing its subgraph H with K. A sparse strong s-VC certificate of the graph G is exactly what we need here. Eppstein, Galil, Italiano, and Nissenzweig [12] showed that such a sparse subgraph of O(ns) edges can be computed in a single pass withÕ(ns) space deterministically in the insertion-only model. In the turnstile model, Guha, McGregor, and Tench [25] showed that such a sparse subgraph ofÕ(ns 2 ) edges can be computed with high probability in a single pass usingÕ(ns 2 ) space. This result can be inferred from Theorem 8 of [25] with = Θ(1/s). In [25] the analysis only considers the case G = H, but it is straightforward to extend the analysis to incorporate any supergraph G of H.
101If the subgraph K of the graph H satisfies the above requirement for the special case of G = H, then K is said to be a s-VC certificate of H. Our simple DFS algorithm relies on this tool. Proof. Suppose u, v, and w violate the statement of the lemma. That is, u and v are adjacent in H. Since T is a DFS tree, u and v are not adjacent in K, and each path connecting u and v must pass through a node that is a common ancestor of u and v. Let c H (resp., c K ) be the u-v node-connectivity in H (resp., K). The above discussion implies that c K ≤ k and c H ≥ c K + 1, contradicting the assumption that K is a (k + 1)-VC certificate of H.
102Algorithm. Using Lemma 16, we can construct a DFS tree of G recursively as follows. Pick K as a (k + 1)-VC certificate of G. Compute a DFS tree T of K. Let T be the tree induced by the top k + 1 layers of of T . Let v 1 , v 2 , . . . , v z be the leaves of T . Denote S i as the set of descendants of v i in T , including v i . By Lemma 16, there exists no edge in G that crosses two distinct sets S i and S j . For each 1 ≤ i ≤ z, we recursively find a DFS tree T i of the subgraph of G induced by S i rooted at v i . By the above observation, we can obtain a valid DFS tree of G by appending T 1 , T 2 , . . . , T z to T .
103Analysis. If the height of the final DFS tree is h, then the depth of the recursion is at most h/k . The cost for computing a (k + 1)-VC certificate is 1 pass andÕ(nk) space, and the resulting subgraph K has O(nk) edges. Therefore, the total number of passes is at most h/k , and the overall space complexity isÕ(nk).
Streaming Implementation of the Algorithm of Aggarwal and Anderson
104The bounds of Theorem 4 are attained via an implementation of the parallel DFS algorithm of Aggarwal and Anderson [2] in the streaming model, with the help of various tools, including the strong sparse certificates for s-node-connectivity described above.
Overview.
105At a high level, the DFS algorithm of Aggarwal and Anderson [2] works as follows. Start with a maximal matching, and then merge these length-1 paths iteratively into a constant number of node-disjoint paths such that the number of nodes not in any path is at most |V |/2. The algorithm then constructs the initial segment of the DFS tree from these paths. Each remaining connected component is solved recursively. The final DFS tree is formed by appending the DFS trees of recursive calls to the initial segment. The bottleneck of this DFS algorithm is a task called MaximalPaths which is a variant of the maximal node-disjoint paths problem between a set of source nodes S and a set of sink nodes T . In this variant, each member of S is a path instead of a node. Goldberg, Plotkin, and Vaidya [24] gave a parallel algorithm for this problem. Their algorithm has two phases. For any given parameter k, they showed that after k iterations of the algorithm of the first phase, the number of sources in S that are still active is at most n/k. These remaining active sources are processed one-by-one in the second phase. Using this approach with k = √ n, MaximalPaths can be solved in the streaming model withÕ( √ n) passes andÕ(n) space. To further reduce the pass complexity, we apply the sparse certificates for s-node-connectivity of Eppstein, Galil, Italiano, and Nissenzweig [12] and Guha, McGregor, and Tench [25], which allow us to process the remaining active sources in batches. In the insertion-only model, we obtain a deterministic p-pass algorithm with space complexityÕ(n 2 /p 2 ), for each 1 ≤ p ≤Õ( √ n). For the more challenging turnstile model, we obtain a randomized algorithm with a somewhat worse space complexity ofÕ(n 3 /p 4 ). [2] is based on the following divide-and-conquer approach. The goal is to find a DFS tree of G rooted at a given node r. To do so, Aggarwal and Anderson [2] devised an algorithm that finds a subtree T , called initial segment, rooted at r, satisfying the following properties:
The DFS Algorithm of Aggarwal and Anderson. Specifically, the DFS algorithm of Aggarwal and Anderson
106Each of the connected components C 1 , C 2 , . . . , C z of G \ T has at most n/2 nodes. The subtree T can be extended to a DFS tree of G as follows. For each connected component C i , there is a unique node v i ∈ T of the largest depth in T that is adjacent to nodes in C i . Choose r i to be any node in C i adjacent to v i . For each 1 ≤ i ≤ z, append to v i any DFS tree of C i rooted at r i .
107It is clear that this gives a recursive algorithm with a logarithmic depth of recursion. In the insertion-only model, finding the portals v i and r i is straightforward and can be done in a single pass with z =Õ(n) space, simultaneously for all i = 1, . . . , z. In the turnstile model, we employ a binary search on the depth of v i in T , and this costs O(log n) passes with z =Õ(n) space.
108Constructing the Initial Segment. The initial segment T is constructed in two steps. The first step is to find a set of node-disjoint paths Q of size at most 11, called separator, such that each connected component of the subgraph induced by all nodes not in a path of Q has at most n/2 nodes.
109The second step is to construct T from Q as follows. Initially, the subtree T ← r consists of only the root node. While Q is not empty, we extend the current subtree T as follows. Find a path p connecting a node u in a path of Q to a node v in T such that all intermediate nodes of p are not in a path of Q and are not in T . The path p is chosen such that the depth of v is the largest possible. Let p = (s, . . . , u, . . . , t) ∈ Q be the path that contains u. Extend the subtree T by appending to v the path p = (v, . . . , u) and the longer one the two subpaths (s, . . . , u) and (u, . . . , t) of p . Then update Q by removing from p the part that has been added to T . It is clear that Q becomes empty after O(log n) iterations.
110Implementation of the above procedure to the streaming model is also straightforward. We do a binary search on the depth d * of v to find the path p. Specifically, for a parameter d, consider the subgraph G d induced by all nodes in G except the ones in T of depth greater than d. Compute any spanning forest T d of G d . If all nodes in the paths of Q are not reachable to all nodes in T in the spanning forest T d , then we know that d < d * ; otherwise d ≥ d * . After we have determined d = d * , it suffices to pick p as any minimal-length path connecting T and Q in the spanning forest T d * . The construction of a spanning forest can be done in a single pass withÕ(n) space in the insertion-only model. For the turnstile model, we use the algorithm of Ahn, Guha, and McGregor [3], which also costsÕ(n) space and finishes in a single pass.
111Constructing the Separator. The algorithm for constructing Q is as follows. At the beginning, Q is initialized as any maximal matching. Obviously, each connected component induced by nodes not involved in Q is a single node, but |Q| can be as large as linear in n. The size of the set Q can be decreased to at most 11 by repeatedly applying the procedure Reduce(Q) for O(log n) times.
112If we are given a set of node-disjoint paths Q such that |Q| ≥ 12 and each connected component induced by nodes not involved in Q has at most n/2 nodes, the procedure Reduce(Q) of [2] is guaranteed to output a new set of node-disjoint paths Q such that |Q | ≥ (11/12)|Q| and each connected component induced by nodes not involved in Q also has at most n/2 nodes.
113Note that a maximal matching can be found via a greedy algorithm in a single pass with O(n) space in the insertion-only model. In the turnstile model, a maximal matching can be found with high probability in O(log n) passes withÕ(n) space by implementing the parallel maximal matching algorithm of Israeli and Itai [28] using 0 -samplers.
114Finding Node-Disjoint Paths. The detailed description of Reduce(Q) is omitted. All of Reduce(Q) can be implemented in the streaming model inÕ(1) passes andÕ(n) space, except the following task, called MaximalPaths [24]. The input of MaximalPaths consists of a set of source nodes S ⊆ V , a set of sink nodes T ⊆ V , and a set of node-disjoint directed paths P in in G, where each source node v ∈ S is the starting node of a path P ∈ P in . The output of MaximalPaths is a set of node-disjoint paths in G such that each P ∈ P out is of the form P = s • P 1 • P 2 • t such that (i) s ∈ S, (ii) t ∈ T , (iii) s • P 1 is the prefix of some path in P in , and (iv) P 2 is a path that does not involve any nodes used in P in and T . Note that P 1 and P 2 might be empty. The set P out has to satisfy the following maximality constraint.
115For each node v in a path of P in but not in a path of P out , any path connecting v to a sink node-intersects a path in P out .
116Note that in [2] the sinks T are node-disjoint paths, not individual nodes. Here each node in T corresponds to the result of contracting each of these paths into a node. Goldberg, Plotkin, and Vaidya [24] showed that MaximalPaths can be solved in two stages as follows.
117First Stage. In the first stage, each node has three possible states: {Idle, Active, Dead}. Intuitively, the Dead nodes are the ones that will not be considered in subsequent steps of the algorithm. The set of active paths P a is initialized as P in . All nodes in a path of P a are Active. All remaining nodes are initially Idle.
118In each iteration, the set of active paths P a are updated as follows. Let H be the set of the last nodes in a path in P a . Let H be the set of Idle nodes. Find a maximal matching M on the bipartite graph induced by the two parts H and H . If a path P ∈ P a is incident to a matched edge e = {u, v} ∈ M , then P is extended by appending e = {u, v} to the last node u of P , and the state of v is updated to Active. Otherwise, the last node u of P ∈ P a is removed from P , and the state of u is updated to Dead.
119A source is successfully connected to a sink when there is a path P ∈ P a that reaches a sink node. When this occurs, the entire path P is removed from P a and is added to P out . All nodes of P are then Dead, as they should not be considered in subsequent steps.
120The first stage terminates once |P a | < k, where k is a given parameter. Observe that the number of iterations can be upper bounded by 2n/k, as the number of nodes that change their states in an iteration is at least the number of active paths at the beginning of this iteration, and each node v ∈ V can change its state at most twice. Now consider the implementation in the streaming model. Recall that a maximal matching can be found deterministically in a single pass withÕ(n) space in the insertion-only model, or in the turnstile model with high probability in O(log n) passes withÕ(n) space using the algorithm of Israeli and Itai [28] via 0 -samplers. Hence the algorithm for the first stage can be implemented usingÕ(n/k) passes withÕ(n) space.
121Second Stage. At the beginning of the second stage, consider the instance of MaximalPaths that replaces P in by P a and only consider the nodes that are not Dead yet. Goldberg, Plotkin, and Vaidya [24] showed that a legal solution P out of this instance of MaximalPaths combined with the partial solution P out found during the first stage form a legal solution to the original MaximalPaths instance.
122To find P out , the approach taken by Goldberg, Plotkin, and Vaidya [24] is to simply process each active path P ∈ P a sequentially. Specifically, when P = (u 1 , u 2 , . . . , u x ) is processed, find the largest index i * such that u i * is reachable to a sink via Idle nodes. If such an index i * exists, then select P * as any path that is an extension of this subpath (u 1 , u 2 , . . . , u i * ) to a sink. Then P * is added to P out , and all its nodes become Dead. By the choice of i * , it is straightforward to see that the output P out satisfies the maximality constraint.
123Next, consider the implementation of the algorithm that processes the path P = (u 1 , u 2 , . . . , u x ) in the streaming model. We show that the task of finding the index i * and the path P * can be solved in a single pass withÕ(n) space. Hence the algorithm for the second stage can be implemented usingÕ(k) passes withÕ(n) space, as there are less than k paths needed to be processed.
124For each Idle node v adjacent to the path P , let L(v) be the maximum index i such that v is adjacent to the ith node u i of the path P . Note that i * is the maximum value of L(v) such that v is reachable to a sink via Idle nodes that maximizes L(v), and i * is undefined if and only if the no node in P is reachable to a sink via Idle nodes.
125We find a spanning forest T of the graph G Idle induced by the set of Idle nodes. Select v as a node that is reachable to a sink via Idle nodes that maximizes L(v). If such a node v exists, let P be any path connecting v to a sink in T . Then we select P * as the concatenation of (u 1 , u 2 , . . . , u i * ) and P , where i * = L(v), and then the status of every node in P * is updated to Dead.
126Computing the labels L(v) can be done in a single pass withÕ(n) space in a straightforward way in the insertion-only model; for the turnstile model, this can be done by a binary search in O(log n) passes withÕ(n) space. The computation of the spanning forest T is trivial for the insertion-only model; for the turnstile model, this can also be done in a single pass withÕ(n) space [3].
Batch Process
127At this point, we know that the first stage costsÕ(n/k) passes withÕ(n) space, and the second stage costsÕ(k) passes withÕ(n) space. We set k =Θ( √ n) to balance the two parts to obtain anÕ( √ n)-pass semi-streaming algorithm. Next, we show that the number of passes of the second stage can be further reduced toÕ(k/s) if we process the paths in P a in batches of size s, where 1 ≤ s ≤ k is any given parameter. This enables a smooth tradeoff between the number of passes and the space usage.
128Consider an iteration where these s paths {P 1 , P 2 , . . . , P s } are processed. As above, for each Idle node v, we define L j (v) as the maximum index i such that v is adjacent to the ith node of the path P j . If v is not adjacent to the path P j , then L j (v) is undefined.
129Sparse Certificate. To implement one batch update in a space-efficient manner, our strategy is to find a sparse subgraph G * such that we are able to do all path extensions entirely in G * .
130We construct a strong s-VC certificate G * of the subgraph G Idle induced by Idle nodes. This certificate G * has the property that for any subset I of Idle nodes of size at most s, all nodes of I are reachable to distinct sinks via node-disjoint paths in G * if and only if all nodes of I are reachable to distinct sinks via node-disjoint paths using Idle nodes in the original graph G. To see this, we simply attach a super source s * to all nodes in I and attach a super sink t * to all sinks. The fact that G * is a strong s-VC certificate of G Idle guarantees that the node-connectivity of the pair (s * , t * ) is the same in both G Idle and G * .
131Feasible Vector. Given the sparse certificate G * and a set of paths {P 1 , P 2 , . . . , P s }, we say that a vector (i 1 , . . . , i y ) with 1 ≤ y ≤ s is feasible if there exists a set of node-disjoint paths P 1 , . . . , P y of G * such that the following is met.
132If i j = ⊥, then P j = ∅ is an empty path. If i j = ⊥, then P j is a path starting at a node v whose label L j (v) equals i j , and ending at a sink.
133Due to the fact that G * is a strong s-VC certificate of G Idle , the definition of feasibility remains unchanged if G * is replaced by G Idle . For any given vector (i 1 , . . . , i y ), its feasibility can be checked in polynomial time as follows. Start from the graph G * . For each j such that i j = ⊥, add a special node s j that is adjacent to all nodes v with L j (v) = i j . Add a super-source s * adjacent to all s j . Add a super-sink t * adjacent to all sinks. Then (i 1 , . . . , i y ) is feasible if and only if the pair (s * , t * ) is z-node connected, where z is the number of elements in the vector (i 1 , . . . , i y ) that are not ⊥.
Algorithm.
134We are in a position to describe the algorithm for batch processing the paths {P 1 , P 2 , . . . , P s }.
135We find a feasible vector (i * 1 , . . . , i * s ) as follows. For the base case, i * 1 is chosen as the maximum number such that (i * 1 ) is feasible. If such a number does not exist, then we set i * 1 = ⊥. Suppose that (i * 1 , . . . , i * j−1 ) have been found. Select i * j as the maximum number such that (i * 1 , . . . , i * j−1 , i * j ) is feasible. If such a number does not exist, then we set i * j = ⊥. Let (P * 1 , . . . , P * s ) be the set of node-disjoint paths that showcases the feasibility of (i * 1 , . . . , i * s ). For j = 1, . . . , s, if P * j = ∅, we extend the length-i * j prefix of the path P j by concatenating it with P * j , and add the resulting path to the set of output paths P out . After processing a batch, the status of all nodes in the output paths are updated to Dead.
136Correctness. Now we argue that the output P out is a legal solution to the MaximalPaths problem of the second stage. Intuitively, the correctness is due to the fact that G * is a strong s-VC certificate of G Idle and the fact that we construct the feasible vector (i * 1 , . . . , i * s ) in such a way that mimics the sequential algorithm of Goldberg, Plotkin, and Vaidya [24] that processes the paths one-by-one.
137Formally, suppose that the output P out is not a legal solution, i.e., the maximality constraint is violated. Then there is some node u in some input path P such that u is reachable to a sink via a path that is node-disjoint to all paths in P out .
138Let P be the jth path in its batch {P 1 , P 2 , . . . , P s }, and let u be the zth node of P . Since u is not in any output path, there are two possibilities: either i * j = ⊥ or i * j < z. Both possibilities are not possible, because (i * 1 , . . . , i * j−1 , z) must be a feasible vector, as u is reachable to a sink via a path using only Idle nodes not in any path of P out . Therefore, we must have i * j = ⊥ and i * j ≥ z according to our algorithm for constructing (i * 1 , . . . , i * s ). Space and Pass Complexity. The cost for constructing the labels L j (v) for all Idle nodes v and for all 1 ≤ j ≤ s isÕ(1) passes andÕ(ns) space.
139For the construction of the strong s-VC certificate G * , remember that such a sparse subgraph of O(ns) edges can be computed in a single pass withÕ(ns) space deterministically in the insertion-only model [12]. In the turnstile model, such a sparse subgraph ofÕ(ns 2 ) edges can be computed with high probability in a single pass withÕ(ns 2 ) space [25].
140Summary. The first stage of the algorithm for MaximalPaths costsÕ(n/k) passes withÕ(n) space. With batch processing, the second stage of the algorithm for MaximalPaths costs O(k/s) passes. Remember that the number of active paths at the beginning of the second phase is less than k, and they are processed in batches of size s. Since each iteration costs O(1) passes, the number of passes isÕ(k/s). The space usage for the second stage isÕ(ns) for the insertion-only model, and isÕ(ns 2 ) for the turnstile model.
141The cost for solving MaximalPaths is the bottleneck of the DFS algorithm in the sense that the rest of the DFS algorithm can be implemented with justÕ(1) passes andÕ(n) space. Hence we have the following results for the complexity of streaming DFS. For any parameters 1 ≤ s ≤ k ≤ n, there is a deterministic algorithm usingÕ((n/k) + (k/s)) passes andÕ(ns) space in the insertion-only model, and there is a randomized algorithm using O((n/k) + (k/s)) passes andÕ(ns 2 ) space in the turnstile model. We conclude the proof of Theorem 4.
Single-Pass Lower Bounds
142In this section, we use the lower bound of the 1-way randomized communication complexity for the Index problem [1] to show the single-pass space lower bound for computing approximate MLST to within an additive error k. This gives a complementary result for Theorem 1.
Theorem 17.
143In the insertion-only model, given a connected n-node simple undirected graph G, computing a spanning tree of G that has at least leaf(G)−k leaves for any k ∈ [1, (n−5) /4] requires Ω(n 2 /k 2 ) bits for any single-pass randomized streaming algorithm that can succeed with probability at least 2/3.
Proof.
144We begin with a reduction from an n 2 -bit instance of the Index problem to computing a spanning tree of (2n+3)-node graph G with leaf(G) leaves for any n ≥ 1. Given Alice's input in the Index problem, i.e. a bit-array of length n 2 , we construct an n by n bipartite graph H, as part of G, in which edge (x i , y j ) for every i, j ∈ [1, n] corresponds to the ((i − 1)n + j)-th bit in Alice's array. Then, given Bob's input, a tuple (i, j) for some i, j ∈ [1, n], we construct the remaining part of G by adding three additional nodes s, t, and , and connecting an edge from s to z for every node z = y j in H, and adding edge ( , x i ), (s, t), and (t, y j ).
145It clear that G is connected and has leaf(G) = 2n + 1 if (x i , y j ) ∈ H 2n otherwise Thus, having a single-pass streaming algorithm to compute leaf(G) suffices to decide the n 2 -bit instance of the Index problem, i.e. for Bob to tell what the ((i − 1)n + j)-th bit in Alice's array is. This requires Ω(n 2 ) bits. To obtain the hardness result for MLST with additive error k for any k ≥ 1, one can duplicate H ∪ { , t} into (k + 1) copies and let the copies share the same s, so G is connected, has (k + 1)(2n + 2) + 1 nodes, and has leaf(G) = (2n + 1)(k + 1) if (x i , y j ) ∈ H 2n(k + 1) otherwise
146Hence, having a single-pass streaming algorithm to compute leaf(G) for G of (k + 1)(2n + 2) + 1 nodes to within an additive error k suffices to decide the n 2 -bit Index problem. Replace (k + 1)(2n + 2) + 1 = n and n 2 = Ω((n /k) 2 ) yields the desired bound.
Conclusion
147In this paper, we devised semi-streaming algorithms for spanning tree computations, including max-leaf spanning trees, BFS trees, and DFS trees. For max-leaf spanning trees, despite that any streaming algorithm requires Ω(n 2 ) space to compute the exact solution, we show how to compute a (1 + ε)-approximation using a single pass andÕ(n) space, albeit in super-polynomial time. For BFS trees and DFS trees, we show how to compute them using O( √ n) passes andÕ(n) space, and offer a smooth tradeoff between pass complexity and space usage.
148The pass complexities of our algorithms for BFS trees and DFS trees are still far from the known lower bounds, ω(1) passes for BFS trees [17] and the trivial 1 pass for DFS trees. It is unclear whether our upper bounds can be further reduced or the known lower bounds can be improved. We leave closing the gap to future work.
참고문헌
참고문헌 정보가 없습니다.