원시데이터 수집 시스템
선정목록으로

Streaming Complexity of Spanning Tree Computation

관련 수소연료전지 · (6) PEM(고분자전해질막)

기본 정보

저자
  1. Yi Jun Chang — Swiss Federal Institute of Technology Zurich
  2. Martı́n Farach-Colton — Rutgers University *
  3. Tsan Sheng Hsu — Academia Sinica,Taiwan,
  4. Meng-Tsung Tsai — National Chiao Tung Univ.#TAB#
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 활용 포인트
–
평가 입력
–

초록

The 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. 
\nOur results, in both the insertion-only and the turnstile models, are as follows.
\n- 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. 
\n- 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. 
\n- 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.

본문 77,310자

본문 펼치기
# Streaming Complexity of Spanning Tree Computation Yi-Jun Chang ETH Zürich, Switzerland [yi-jun.chang@eth-its.ethz.ch](mailto:yi-jun.chang@eth-its.ethz.ch) Martín Farach-Colton Rutgers University, USA [farach@cs.rutgers.edu](mailto:farach@cs.rutgers.edu) Tsan-Sheng Hsu Academia Sinica, Taipei City, Taiwan [tshsu@iis.sinica.edu.tw](mailto:tshsu@iis.sinica.edu.tw) Meng-Tsung Tsai National Chiao Tung University, Hsinchu, Taiwan [mtsai@cs.nctu.edu.tw](mailto:mtsai@cs.nctu.edu.tw) ~~Abstract~~ The 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 _O_ <sup>˜</sup> ( _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 Ω <sup>˜</sup> ( _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 _O_ <sup>˜</sup> ( _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_ ( <sup>_~~√~~_</sup> _<u>n</u>_ <u>),</u> 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 _O_ <sup>˜</sup> ( _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_ ( <sup>_~~√~~_</sup> _<u>n</u>_ <u>),</u> and it also offers a smooth tradeoff between pass complexity and space usage. 2012 ACM Subject Classification Theory of computation _→_ Streaming, sublinear and near linear time algorithms Keywords and phrases Max-Leaf Spanning Trees, BFS Trees, DFS Trees © Yi-Jun Chang, Martín Farach-Colton, Tsan-Sheng Hsu, and Meng-Tsung Tsai; licensed under Creative Commons License CC-BY 37th International Symposium on Theoretical Aspects of Computer Science (STACS 2020). Editors: Christophe Paul and Markus Bläser; Article No. 34; pp. 34:1–34:19 Leibniz International [Proceedings](https://www.dagstuhl.de/lipics/) in Informatics Schloss Dagstuhl - Leibniz-Zentrum für [Informatik,](https://www.dagstuhl.de) Dagstuhl Publishing, Germany 34:2 Streaming Complexity of Spanning Tree Computation Digital Object Identifier [10.4230/LIPIcs.STACS.2020.34](https://doi.org/10.4230/LIPIcs.STACS.2020.34) Related Version A full version of the paper is available at `[https://arxiv.org/abs/2001.07672](https://arxiv.org/abs/2001.07672)` . Funding _Martín_ _Farach-Colton_ : This research was supported in part by NFS grants CSR-1938180, CCF-1715777, and CCF-1724745. _Tsan-Sheng_ _Hsu_ : This research was supported in part by the Ministry of Science and Technology of Taiwan under contract MOST Grant 108-2221-E-001-011-MY3. _Meng-Tsung_ _Tsai_ : This research was supported in part by the Ministry of Science and Technology of Taiwan under contract MOST grant 107-2218-E-009-026-MY3. Acknowledgements We thank the anonymous reviewers for their helpful comments, and Eric Allender and Meng Li for their insightful discussions. <mark>1</mark> Introduction Spanning trees are critical components of graph algorithms, from depth-first search trees (DFS) for finding articulation points and bridges [44], computing _st_ -numbering [13], chain decomposition [41], and coloring signed graphs [18], to breadth-first search trees (BFS) for finding separators [33], computing sparse certificates of _k_ -node-connectivity [8, 12], approximating diameters [10, 40], and characterizing AT-free graphs [5], and to maximumleaf spanning trees (MLST) for connected dominating sets [35, 42] and connected maximum cuts [26, 21]. In the semi-streaming model, the tractability of spanning tree computation, except arbitrary spanning trees [3, 43, 39], is less studied. The _semi-streaming_ model [37, 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 _O_ <sup>˜</sup> ( _n_ ) <sup>1</sup> 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 [36], degeneracy [15], cut-sparsifier [29], 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 Ω <sup>˜</sup> ( _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, 30], but the current best algorithm needs _O_ <sup>˜</sup> ( _h_ ) passes [30] 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_ <sup>2</sup> ) space, since it is APX-complete [34, 20]. Due 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 1 We write _O_ ˜( _k_ ) to denote _O_ ( _k_ poly log _n_ ) or _O_ ( _k/_ poly log _n_ ) where _n_ is the number of nodes in the input graph. Similarly, Ω( <sup>˜</sup> _k_ ) denotes Ω( _k_ poly log _n_ ) or Ω( _k/_ poly log _n_ ). Y.-J. Chang, M. Farach-Colton, T.-S. Hsu, and M.-T. Tsai 34:3 model, rather than the classical one due to Nagamochi and Ibaraki [38]. Hence establishing the hardness of spanning tree computation helps to explain the need of the alternative methods. 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. <sup>2</sup> (albeit in super-polynomial time for _ε_ _≤_ _ρ −_ 1 since it is APX-complete [34, 20] 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 _O_ <sup>˜</sup> ( _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_ <sup>2</sup> _/k_ <sup>2</sup> ) bits. This hardness result excludes the possibility to have a single-pass semi-streaming algorithm to approximate MLST to within an additive error _n_ <sup>1</sup> <sup>_/_</sup> <sup>2</sup> <sup>_−_</sup> <sup>Ω(1)</sup> . 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_ <sup>Ω(1)</sup> _using_ _a_ _single_ _pass,_ _O_ <sup>˜</sup> ( _f_ ( _ε_ ) _n_ ) _space,_ _and_ _O_ <sup>˜</sup> ( _n_ + _m_ ) _time,_ _and_ _in_ _the_ _insertion-only_ _model_ _a_ _deterministic_ _algorithm_ _that_ _uses_ _a_ _single_ _pass,_ _O_ <sup>˜</sup> ( _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, [34, 35, 42], we obtain the following result. - Corollary 2. _In_ _the_ _turnstile_ _model,_ _for_ _every_ _constant_ _ε >_ 0 _,_ _there_ _exists_ _a_ _randomized_ _algorithm that_ _can approximate MLST_ _for any n-node connected simple_ _undirected graph_ _with_ _probability_ 1 _−_ 1 _/n_ <sup>Ω(1)</sup> _to_ _within_ _a_ _factor_ _of_ _ρn_ + _ε_ _using_ _a_ _single_ _pass,_ _O_ <sup>˜</sup> ( _f_ ( _ε_ ) _n_ ) _space,_ _and_ _polynomial_ _time,_ _where_ _ρn_ _is_ _the_ _supremum_ _constant_ _that_ _MLST_ _cannot_ _be_ _approximated_ _to_ _within_ _using_ _polynomial_ _time_ _and_ _O_ <sup>˜</sup> ( _n_ ) _space,_ _and_ _in_ _the_ _insertion-only_ _model_ _a_ _deterministic_ _algorithm_ _that_ _uses_ _a_ _single_ _pass,_ _O_ <sup>˜</sup> ( _f_ ( _ε_ ) _n_ ) _space,_ _and_ _polynomial_ _time._ Using Corollary 2, we show that approximate connected maximum cut can be computed in a single pass using _O_ <sup>˜</sup> ( _n_ ) space for unweighted regular graphs (Corollary 7). 2 W.h.p. means with probability 1 _−_ 1 _/n_ Ω(1). STACS 2020 34:4 Streaming Complexity of Spanning Tree Computation 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_ ( <sup>_√_</sup> _<u>n</u>_ <u>)</u> w.h.p., and give a smooth tradeoff between pass complexity and space usage. - Theorem 3. _In_ _the_ _turnstile_ _model,_ _for_ _each_ _p_ _∈_ [1 _,_ <sup>_√_</sup> _<u>n</u>_ <u>]</u> _,_ _there_ _exists_ _a_ _randomized_ _algorithm_ _that_ _can_ _compute_ _a_ _BFS_ _tree_ _for_ _any_ _n-node_ _connected_ _simple_ _undirected_ _graph_ _with_ _probability_ 1 _−_ 1 _/n_ <sup>Ω(1)</sup> _in_ _p_ _passes_ _using_ _O_ <sup>˜</sup> (( _n/p_ ) <sup>2</sup> ) _space,_ _and_ _in_ _the_ _insertion-only_ _model_ _a_ _deterministic_ _algorithm_ _that_ _uses_ _O_ <sup>˜</sup> ( _n_ <sup>2</sup> _/p_ ) _space._ This 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 Ω( <sup>˜</sup> _n_ ) passes. We 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 _._ 5 approximation of diameters for unweighted graphs (Theorem 15) and a 2-approximation of Steiner trees for unweighted graphs (Corollary 14). DFS Trees: It is unknown whether DFS trees require more than one passes [14, 30], but the current best algorithm needs _O_ <sup>˜</sup> ( _h_ ) passes due to Khan and Mehta [30], where _h_ is the height of computed DFS trees. We devise a randomized algorithm that has pass complexity _O_ ( <sup>_√_</sup> _<u>n</u>_ <u>)</u> w.h.p., and give a smooth tradeoff between pass complexity and space usage. - Theorem 4. _In_ _the_ _turnstile_ _model,_ _for_ _each_ _p_ _∈_ [1 _,_ <sup>_√_</sup> _<u>n</u>_ <u>]</u> _,_ _there_ _exists_ _a_ _randomized_ _algorithm_ _that_ _can_ _compute_ _a_ _DFS_ _tree_ _for_ _any_ _n-node_ _connected_ _simple_ _undirected_ _graph_ _with_ _probability_ 1 _−_ 1 _/n_ <sup>Ω(1)</sup> _in_ _p_ _passes_ _that_ _uses_ _O_ <sup>˜</sup> ( _n_ <sup>3</sup> _/p_ <sup>4</sup> ) _space,_ _and_ _in_ _the_ _insertion-only_ _model_ _a_ _deterministic_ _algorithm_ _that_ _uses_ _O_ <sup>˜</sup> ( _n_ <sup>2</sup> _/p_ <sup>2</sup> ) _space._ For dense graphs, our algorithms improves upon the current best algorithms for DFS due to Khan and Mehta [30] 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. 1.1 Technical Overview Maximum-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 [31]. 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 leaf( _G_ ) _≥_ 10 <sup><u>1</u></sup> <sup>(</sup> <sup>_|V_</sup> <sup>(</sup> <sup>_G_</sup> <sup>)</sup> <sup>_| −_</sup> <sup>inode(</sup> <sup>_G_</sup> <sup>))</sup> <sup>_,_</sup> (1) where 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 _H_ of _G_ so that _|_ leaf( _G_ ) _−_ leaf( _H_ ) _|_ _≤_ _ε_ ( _V_ ( _G_ ) _−_ inode( _G_ )), then one gets an (10 _ε_ )-MLST sparsifier. Y.-J. Chang, M. Farach-Colton, T.-S. Hsu, and M.-T. Tsai 34:5 Our sparsification technique is general enough to obtain a ( _t_ + _ε_ )-approximation for MLST in a single pass using _O_ <sup>˜</sup> ( _n_ ) space by combining any _t_ -approximation _O_ <sup>˜</sup> ( _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_ <sup>_k_</sup> _n_ <sup>_k_</sup> <sup>+2</sup> ) for _k_ _≥_ 1 to _O_ ( _n_ <sup>2</sup> <sup>_k_</sup> <sup>+2</sup> ) and the leafy forest approach from _O_ (( _m_ + _n_ ) _α_ ( _n_ )) to _O_ ( _m_ + _nα_ ( _n_ )), both due to Lu and Ravi [34, 35]. BFS Trees: We 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). Our 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, 45]. DFS Trees: We present a simple alternative proof of the result of Khan and Mehta [30] that a DFS tree can be constructed in _⌈h/k⌉_ passes using _O_ <sup>˜</sup> ( _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_ . The 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. We 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 _O_ <sup>˜</sup> ( _Dn_ + _n_ <sup>3</sup> <sup>_/_</sup> <sup>4</sup> ) rounds, s _√_ they showed that DFS can be computed in the CONGEST model in _O_ <sup>˜</sup> ( _Dn_ + _n_ <sup>3</sup> <sup>_/_</sup> <sup>4</sup> ) rounds, where _D_ is the diameter of the graph. 1.2 Paper Organization In 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_ ( <sup>_√_</sup> _<u>n</u>_ <u>)-pass</u> _O_ <sup>˜</sup> ( _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_ ( <sup>_√_</sup> _<u>n</u>_ <u>)-pass</u> _O_ <sup>˜</sup> ( _n_ )-space algorithm that succeeds w.h.p. Lastly, we prove the claimed single-pass lower bound in Section 5. STACS 2020 34:6 Streaming Complexity of Spanning Tree Computation <mark>2</mark> Maximum-Leaf Spanning Trees In 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 _Sk_ ( _G_ ) denote any subgraph of _G_ so that _Sk_ ( _G_ ) contains all nodes in _G_ and every node _x_ in _Sk_ ( _G_ ) has degree deg _Sk_ ( _x_ ) _≥_ min _{_ deg _G_ ( _x_ ) _, k}_ . Let _T_ ( _G_ ) be any spanning tree of a connected graph _G_ . We 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. _Every_ _connected_ _simple_ _undirected_ _graph_ _G,_ _except_ _the_ _singleton_ _graph,_ _has_ leaf( _G_ ) _≥_ <sup><u>1</u></sup> 10 <sup>(</sup> <sup>_|V_</sup> <sup>(</sup> <sup>_G_</sup> <sup>)</sup> <sup>_| −_</sup> <sup>inode(</sup> <sup>_G_</sup> <sup>))</sup> <sup>_._</sup> Proof. Our proof is a generalization of the dead leaf argument due to Kleitman and West [31]. 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 _, . . ., yd_, and their connecting edges, ( _x, y_ 1) _,_ ( _x, y_ 2) _, . . .,_ ( _x, yd_ ), 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: If _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 _x_ _∈/_ _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. Let _x_ 0 be some leaf in _T_ that has exactly one neighbor _x_ 1 not in _T_ . For each _i ≥_ 1, if _xi_ is defined and all neighbors of _xi_ other than _xi−_ 1 are outside _T_ and _xi_ has degree two in _G_, then define _xi_ +1 to be the neighbor of _xi_ other than _xi−_ 1. Suppose that _xi_ for _i ≤_ _k_ are defined and _xk_ +1 is not defined, then we expand _T_ at _xi_ for each _i ≤_ _k_ in order. Though _k_ can be arbitrarily large, ∆ _n ≤_ 2 + deg _G_ ( _xk_ ). If _xk_ +1 is not defined and _xk_ has _d_ _>_ 0 neighbors other than _xk−_ 1 in _T_ (thus _k_ _≥_ 2 in this case otherwise Operation 2 applies), then we discuss in subcases: Subcase 1 (deg _G_ ( _xk_ ) = 1): It is impossible to have deg _G_ ( _xk_ ) = 1 for this case. Subcase 2 (deg _G_ ( _xk_ ) = 2): Then ∆ _ℓ_ = 0 and ∆ _m_ = 2. Subcase 3 (deg _G_ ( _xk_ ) _≥_ 3): Then ∆ _ℓ_ = deg _G_ ( _xk_ ) _−_ _d −_ 2 and ∆ _m ≥_ _d_ . Y.-J. Chang, M. Farach-Colton, T.-S. Hsu, and M.-T. Tsai 34:7 If _xk_ +1 is not defined and _xk_ has 0 neighbor other than _xk−_ 1 in _T_, then deg _G_ ( _xk_ ) is either 1 or _≥_ 3. For deg _G_ ( _xk_ ) = 1, ∆ _ℓ_ = 0 and ∆ _m_ = 1. For deg _G_ ( _xk_ ) _≥_ 3, ∆ _ℓ_ = deg _G_ ( _xk_ ) _−_ 2 and ∆ _m ≥_ 0. 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, <sup>�</sup> ∆ _m_ = <sup>�</sup> ∆ _ℓ_ . Consequently, 2 leaf( _G_ ) _≥_ 2 <sup>�</sup> ∆ _ℓ_ = <sup>�</sup> ∆ _ℓ_ + ∆ _m ≥_ ( <sup>�</sup> ∆ _n_ ) _/_ 5 = ( _V_ ( _G_ ) _−_ inode _G_ ) _/_ 5, as desired. Given Lemma 5, our goal is, for every constant _ε >_ 0, find a sparse subgraph _H_ of the input graph _G_ so that: 1. The nodes incident to the edges in _T_ <sup>_∗_</sup> _\ 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_ <sup>_∗_</sup> is any optimal MLST of _G_ . 2. _H_ is connected. Because of the existence of the small dominating set _S_, one can obtain a forest _F_ from _T_ <sup>_∗_</sup> _∩_ _H_ by adding some edges in _H_ so that the number of leaves in _F_ is no less than that in _T_ <sup>_∗_</sup> by _|S|_ and the number of connected components in _F_ is no more than that in _T_ <sup>_∗_</sup> by _|S|_ . Since _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. _For_ _every_ _integer_ _k_ _≥_ 186 _,_ _every_ _connected_ _simple_ _undirected_ _graph_ _G_ _has_ �� leaf( _G_ ) _._ leaf( _Sk_ ( _G_ ) _∪_ _T_ ( _G_ )) _≥_ - - <u>1 + ln(</u> _<u>k</u>_ <u>+ 1)</u> 1 _−_ 30 _k_ + 1 Proof. Let _T_ <sup>_∗_</sup> be a spanning tree of _G_ that has leaf( _G_ ) leaves. Let _k_ be some fixed integer at least 3 and let _H_ = _Sk_ ( _G_ ) _∪_ _T_ ( _G_ ). Let _L_ = _{x ∈_ _V_ ( _G_ ) : _x_ is incident to some _e ∈_ _T_ <sup>_∗_</sup> _\ 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 Pr[ _x_ is not dominated] = (1 _−_ _p_ ) <sup>1+deg</sup> <sup>_H_</sup> <sup>(</sup> <sup>_x_</sup> <sup>)</sup> _≤_ (1 _−_ _p_ ) <sup>_k_</sup> <sup>+1</sup> _._ Let _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, ( _|V_ ( _G_ ) _| −_ inode( _G_ )) _._ _E_ [ _|S|_ ] = _E_ [ _|S_ 1 _|_ + _|S_ 2 _|_ ] _≤_ - _p_ + (1 _−_ _p_ ) <sup>_k_</sup> <sup>+1�</sup> Then, we obtain a forest _F_ from _T_ <sup>_∗_</sup> _∩_ _H_ by adding some edges in _H_ as follows. Initially, _F_ = _T_ <sup>_∗_</sup> _∩_ _H_ . Operation 1: For each _x_ _∈_ _L_, if _x_ is an isolated node in _T_ <sup>_∗_</sup> _∩_ _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_ . STACS 2020 34:8 Streaming Complexity of Spanning Tree Computation Operation 2: For each _x_ _∈_ _L_, if _x_ is not an isolated node in _T_ <sup>_∗_</sup> _∩_ _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_ . For each leaf _ℓ_ _∈_ _T_ <sup>_∗_</sup>, if deg _G_ ( _ℓ_ ) _≤_ _k_, then _ℓ_ is a leaf in _T_ <sup>_∗_</sup> _∩_ _H_ (also in _F_ unless _ℓ_ _∈_ _S_ ); otherwise deg _G_ ( _ℓ_ ) _> k_, if _ℓ_ is not a leaf in _T_ <sup>_∗_</sup> _∩_ _H_, then _ℓ_ must be an isolated node in _T_ <sup>_∗_</sup> _∩_ _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_ <sup>_∗_</sup> by _|S|_ . By Operation 2, the number of connected component is at most _|S|_ . Lastly, 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_ <sup>_∗_</sup> by 3 _|S|_ . To obtain an _ε_ -MLST sparsifier, by Lemma 5 we need: <u>1</u> <u>3</u> _<u>|S|</u>_ - _p_ + (1 _−_ _p_ ) <sup>_k_</sup> <sup>+1�</sup> 10 <sup>(</sup> <sup>_|V_</sup> <sup>(</sup> <sup>_G_</sup> <sup>)</sup> <sup>_| −_</sup> <sup>inode(</sup> <sup>_G_</sup> <sup>))</sup> <sup>_≤_</sup> <sup>30</sup> _≤_ _ε_ _≤_ 30 - _p_ + _e_ <sup>_−p_</sup> <sup>(</sup> <sup>_k_</sup> <sup>+1)�</sup> Setting _p_ = (ln( _k_ + 1)) _/_ ( _k_ + 1) gives the desired bound, and the leading constant is positive for _k_ _≥_ 186. To 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 _O_ <sup>˜</sup> ( _n_ )-space algorithm for the insertion-only model. As for the turnstile model, we use _O_ <sup>˜</sup> ( _k_ ) _ℓ_ 0-samplers [28] 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 _O_ <sup>˜</sup> ( _n_ )-space algorithm for spanning trees in dynamic streams [3]. This gives a proof of Theorem 1. Applications. In [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: Step 1: Find a spanning tree _T_ whose leaf( _T_ ) _≥_ (1 _/_ 2 _−_ _ε_ ) leaf( _G_ ) for some constant _ε >_ 0. Step 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. Then, outputting _L_ and _V_ ( _G_ ) _\ L_ yields an 8 + _ε_ -approximation for connected maximum cut. Step 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 [42]. This gives Corollary 7. - Corollary 7. _In_ _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_ <sup>Ω(1)</sup> _in_ _a_ _single_ _pass_ _using_ _O_ <sup>˜</sup> ( _f_ ( _ε_ ) _n_ ) _space._ <mark>3</mark> Breadth-First Search Trees A BFS tree of an _n_ -node connected simple undirected graph can be constructed in _O_ ( _n_ ) passes using _O_ <sup>˜</sup> ( _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_ <sup>2</sup> ) 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 Y.-J. Chang, M. Farach-Colton, T.-S. Hsu, and M.-T. Tsai 34:9 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. In 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 set _{u_ _∈_ _N_ ( _v_ ) : dist( _s, u_ ) = dist( _s, v_ ) _−_ 1 _}_ where _N_ ( _v_ ) is the set of _v_ ’s neighbors. This can be done with one additional pass using _O_ <sup>˜</sup> ( _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 [28] for each node _v_ _∈_ _V_ _\ {s}_, and this costs _O_ <sup>˜</sup> ( _n_ ) space. For _p_ _≤_ log _n_, the space bound is _O_ <sup>˜</sup> ( _n_ <sup>2</sup> ) and one can use _O_ <sup>˜</sup> ( _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}_ . 3.1 A Simple Deterministic Algorithm We present a simple deterministic _p_ -pass _O_ <sup>˜</sup> ( _n_ <sup>2</sup> _/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. _Let_ _P_ _be_ _a_ _root-to-leaf_ _path_ _in_ _some_ _BFS_ _tree_ _of_ _an_ _n-node_ _connected_ _simple_ _undirected_ _graph_ _G._ _Then_ _x∈P_ deg _G_ ( _x_ ) _≤_ 3 _n_ = _O_ ( _n_ ) _where_ deg _G_ ( _x_ ) _denotes_ _the_ _degree_ _of_ _x_ _in_ _G._ Proof. Suppose _P_ = _x_ 1 _x_ 2 _· · · xk_ comprises _k_ nodes. Observe that if _xi_ and _xj_ have _i_ _≡_ _j_ (mod 3), then _xi_ and _xj_ cannot share any neighbor node; otherwise _P_ can be shorten, a contradiction. Thus, for each _c_ _∈{_ 0 _,_ 1 _,_ 2 _}_ the total contribution of all _xi_ ’s whose _i_ _≡_ _c_ (mod 3) to <sup>�</sup> _xi∈P_ <sup>deg</sup> _G_ <sup>(</sup> <sup>_xi_</sup> <sup>)</sup> <sup>is</sup> <sup>_O_</sup> <sup>(</sup> <sup>_n_</sup> <sup>).</sup> <sup>Summing</sup> <sup>over</sup> <sup>all</sup> <sup>possible</sup> <sup>_c_</sup> <sup>gives</sup> <sup>the</sup> <sup>bound.</sup> We note that Lemma 8 is near-optimal. To see why, let _H_ = ( _V, E_ ) where _V_ is the union of disjoint sets _V_ 0 _, V_ 1 _, . . ., Vk_ and _E_ = _{_ ( _x, y_ ) : _x ∈_ _Vi_ and _y_ _∈_ _Vj_ for any _i, j_ that _|i −_ _j| ≤_ 1 _}_ . By setting _k_ = _⌈_ ( _n −_ 1) _/t⌉_ for some parameter _t_, _|V_ 0 _|_ = 1, _|Vi|_ = _t_ for every _i ∈_ [1 _, k −_ 1], and 1 _≤|Vk| ≤_ _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 _Q ∩_ ( _V_ 2 _∪_ _V_ 3 _∪_ _. . . ∪_ _Vk−_ 2) has degree 3 _t −_ 1. Pick any _t_ such that _k_ = _ω_ (1) and _t_ = _ω_ (1). We have <sup>�</sup> _x∈Q_ <sup>deg</sup> _H_ <sup>(</sup> <sup>_x_</sup> <sup>) = (3</sup> <sup>_−_</sup> <sup>_o_</sup> <sup>(1))</sup> <sup>_n_</sup> <sup>.</sup> - Theorem 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_ _O_ <sup>˜</sup> ( _n_ <sup>2</sup> _/p_ ) _space_ _for_ _every_ _p ∈_ [1 _, n_ ] _in_ _the_ _insertion-only_ _model._ Proof. 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 STACS 2020 34:10 Streaming Complexity of Spanning Tree Computation _O_ ˜( _n_ <sup>2</sup> _/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_ )+1 _<_ dist( _s, v_ ) (resp. if dist( _s, v_ ) + 1 _<_ dist( _s, u_ )), then update dist( _s, v_ ) (resp. dist( _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. Observe a root-to-leaf path _P_ = _sz_ 1 _z_ 2 _· · · zt_ in some BFS tree rooted at _s_ . Suppose _P_ contains exactly _ℓ_ edges that appears only on tape, let them be ( _zx_ 1 _, zy_ 1) _, . . .,_ ( _zxℓ_ _, zyℓ_ ) where 1 _≤_ _xi_ _<_ _yi_ _≤_ _xi_ +1 _<_ _yi_ +1 _≤_ _t_ for every _i_ _∈_ [1 _, ℓ_ _−_ 1]. Let pred _P_ ( _zi_ ) be the predecessor of _zi_ on _P_ that is closest to _zi_ among nodes in _{s} ∪{zyj_ : _yj_ _<_ _i}_ . By the definition of the above construction, it is assured that deg( _zxi_ ) _≥_ _n/k_ for each _i_ _∈_ [1 _, ℓ_ ]. Thus 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, zi_ ) attains the minimum possible value at the same pass when dist( _s,_ pred _P_ ( _zi_ )) attains; otherwise _i_ = _yj_ for some _j_ _∈_ [1 _, ℓ_ ], dist( _s, yj_ ) attains the minimum possible value at most one pass after dist( _s, xj_ ) attains. Hence, _O_ ( _k_ ) passes suffices to compute dist( _s, zi_ ) for all _i ∈_ [1 _, t_ ] and this argument applies to all root-to-leaf paths. Setting _k_ = _p_ yields the desired bound. 3.2 A More Efficient Randomized Algorithm In 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, 45]. 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_ _|_ = Θ <sup>˜</sup> ( _k_ ) with high probability. We will grow a local BFS tree of radius _O_ <sup>˜</sup> ( _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 [45]. - Lemma 10 ([45]) . _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_ <sup>_−_</sup> <sup>Ω(</sup> <sup>_C_</sup> <sup>)</sup> _._ _For_ _each_ _node_ _t̸_ = _s,_ _there_ _is_ _an_ _s-t_ _shortest_ _path_ _Ps,t_ _such_ _that_ _each_ _of_ _its_ _C_ ( _n_ log _n_ ) _/k-node_ _subpath_ _P_ <sup>_′_</sup> _satisfies_ _P_ <sup>_′_</sup> _∩_ _U̸_ = _∅._ For notational simplicity, in subsequent discussion we write _h_ = _C_ ( _n_ log _n_ ) _/k−_ 1 = _O_ <sup>˜</sup> ( _n/k_ ). Lemma 10 shows that for each node _t ∈_ _V_ _\ {s}_, dist( _s, t_ ) = _u∈U_ min _∩N_ <sup>_h_</sup> ( _t_ ) <sup>dist(</sup> <sup>_s, u_</sup> <sup>) + dist(</sup> <sup>_u, t_</sup> <sup>)</sup> (2) with probability 1 _−_ _n_ <sup>_−_</sup> <sup>Ω(</sup> <sup>_C_</sup> <sup>)</sup> where _N_ <sup>_h_</sup> ( _v_ ) = _{u_ : dist( _u, v_ ) _≤_ _h}_ . To see this, consider the _s_ - _t_ shortest path _Ps,t_ specified in Lemma 10. If the number of nodes in _Ps,t_ is less than _h_, then the above claim holds because _s ∈_ _U_ _∩_ _N_ <sup>_h_</sup> ( _t_ ). Otherwise, Lemma 10 guarantees that there is a node _u ∈_ _Ps,t ∩_ _U_ _∩_ _N_ <sup>_h_</sup> ( _t_ ) with probability 1 _−_ _n_ <sup>_−_</sup> <sup>Ω(</sup> <sup>_C_</sup> <sup>)</sup> . Using Equation (2), a BFS tree can be computed using the following steps. 1. Compute dist( _u, v_ ) for each _u ∈_ _U_ and _v_ _∈_ _U_ _∩_ _N_ <sup>_h_</sup> ( _u_ ). Using this information, we can infer dist( _s, u_ ) for each _u ∈_ _U_ . 2. 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_ ). In what follows, we show how to implement the above two steps in the streaming model, using _O_ <sup>˜</sup> ( _n_ + _k_ <sup>2</sup> ) space and _O_ <sup>˜</sup> ( _n/k_ ) passes. By a change of parameter _p_ = _O_ <sup>˜</sup> ( _n/k_ ), we obtain Theorem 3. Y.-J. Chang, M. Farach-Colton, T.-S. Hsu, and M.-T. Tsai 34:11 Step 1. To compute dist( _u, v_ ) for each _u ∈_ _U_ and _v_ _∈_ _U ∩_ _N_ <sup>_h_</sup> ( _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_ = _O_ <sup>˜</sup> ( _n/k_ ) passes and _O_ ( _n · |U_ _|_ ) = _O_ <sup>˜</sup> ( _nk_ ) space, since we need to maintain _|U_ _|_ search trees simultaneously. We show that the space requirement can be improved to _O_ <sup>˜</sup> ( _n_ + _k_ <sup>2</sup> ). 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 _Li_ ( _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 _Li_ ( _u_ ). If so, then we learn that dist( _u, v_ ) = _i_ + 1. In 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 _{τu_ + _i −_ 1 _,_ _τu_ + _i,_ _τu_ + _i_ + 1 _}_ . For 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 ≤_ 2 _h−_ 1, the number of BFS computations that involve _v_ is _O_ <sup>˜</sup> (1). The idea of using random starting time to schedule multiple algorithms to minimize congestion can be traced back from [32]. 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 _t_ th pass. - Lemma 11. _For_ _each_ _node_ _v,_ _and_ _for_ _each_ _integer_ 1 _≤_ _t ≤_ 2 _h −_ 1 _,_ _with_ _high_ _probability,_ _the_ _number_ _of_ _nodes_ _u ∈_ _U_ _such_ _that_ _τu_ + dist( _u, v_ ) _−_ 1 _≤_ _t ≤_ _τu_ + dist( _u, v_ ) + 1 _is_ _at_ _most_ _O_ (max _{_ log _n, |U_ _|/h}_ ) _._ Proof. Given two nodes _u_ _∈_ _U_ and _v_ _∈_ _V_, and a fixed number _t_, the probability that _τu_ + dist( _u, v_ ) _−_ 1 _≤_ _t_ _≤_ _τu_ + dist( _u, v_ ) + 1 is at most 3 _/h_ . Let _X_ be the total number of _u_ _∈_ _U_ such that _τu_ + dist( _u, v_ ) _−_ 1 _≤_ _t_ _≤_ _τu_ + dist( _u, v_ ) + 1. The 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}_ ). Recall that _|U_ _|_ = _O_ <sup>˜</sup> ( _k_ ) with high probability, and _h_ = _O_ <sup>˜</sup> ( _n/k_ ). By Lemma 11, we only need - _k_ <sup>2</sup> _/n_ - _·_ _O_ <sup>˜</sup> (1) space per each _v_ _∈_ _V_ to do the radius- _h_ BFS computation from all need - _k_ <sup>2</sup> _/n_ - _·_ _O_ <sup>˜</sup> (1) space per each _v_ _∈_ _V_ to do the radius- _h_ BFS computation from all nodes _u ∈_ _U_ . That is, the space complexity is _O_ <sup>˜</sup> ( _n_ + _k_ <sup>2</sup> ). To store the distance information dist( _u, v_ ) for each _u ∈_ _U_ and _v_ _∈_ _U_ _∩_ _N_ <sup>_h_</sup> ( _u_ ), we need _O_ <sup>˜</sup> ( _k_ <sup>2</sup> ) space. Thus, the algorithm for Step 1 costs _O_ <sup>˜</sup> ( _n_ + _k_ <sup>2</sup> ) space. The number of passes is 2 _h −_ 1 = _O_ <sup>˜</sup> ( _k_ ). In 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 _, . . ., Uy_ be random subsets of _U_ such that each _u ∈_ _U_ joins each _Uj_ with probability 1 _/x_, independently. Consider a node _v_ _∈_ _V_ and consider the _r_ th 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 _r_ th pass. We know that with high probability _|S| ≤_ _x_ . By our choice of _U_ 1 _, U_ 2 _, . . ., Uy_, we can infer that with high probability for each _u ∈_ _S_ there is at least one index _j_ such that _S ∩_ _Uj_ = _{u}_ . - _k_ <sup>2</sup> _/n_ STACS 2020 34:12 Streaming Complexity of Spanning Tree Computation To implement the _r_ th pass in the turnstile model, each node _v_ _∈_ _V_ virtually maintains _y_ edge set _Z_ 1 _, Z_ 2 _, . . ., Zy_ . For each insertion (resp., deletion) of an edge _e_ = _{w, v}_ satisfying _r_ = _τu_ + dist( _u, w_ ) _−_ 2 for some _u_ _∈_ _Uj_, we add (resp., remove) the edge from the set _Zj_ . After processing the entire data stream, we take one edge out of each edge set _Z_ 1 _, Z_ 2 _, . . ., Zy_ . 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 _O_ <sup>˜</sup> ( _ny_ ) = _O_ <sup>˜</sup> ( _n_ + _k_ <sup>2</sup> ). Step 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_ ). In the insertion-only model, this task can be solved using _h_ iterations of Bellman-Ford steps. Initially, _d_ 0( _v_ ) = dist( _s, v_ ) for each _v_ _∈_ _U_, and _d_ 0( _v_ ) = _∞_ for each _v_ _∈_ _V_ _\ U_ . During the _i_ th pass, we do the update _di_ ( _v_ ) _←_ min _{di−_ 1( _v_ ) _,_ 1+min _u∈N_ ( _v_ ) _di−_ 1( _u_ ) _}_ . By Equation (2), we can infer that _dh_ ( _t_ ) = dist( _s, t_ ) for each _t ∈_ _V_ . A straightforward implementation of this procedure costs _O_ <sup>˜</sup> ( _n_ ) space and _h_ = _O_ <sup>˜</sup> ( _n/k_ ) passes. In 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 _d_ ( _v_ ) = min _u∈U_ _∩N_ _h_ ( _t_ ) dist( _s, u_ ) + dist( _u, v_ ) = dist( _s, v_ ) for each _v_ _∈_ _V_ . This costs _O_ <sup>˜</sup> ( _n_ + _k_ <sup>2</sup> ) space and _O_ <sup>˜</sup> ( _n/k_ ) passes in view of the analysis of Step 1. 3.3 Extensions In 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. _Given 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_ <sup>Ω(1)</sup> _using_ _O_ <sup>˜</sup> ( _n/k_ ) _passes_ _and_ _O_ <sup>˜</sup> ( _n_ + _k_ <sup>2</sup> ) _space_ _in_ _the_ _turnstile_ _model._ Proof. 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_ _|_ = _O_ <sup>˜</sup> ( _k_ ) with high probability. Recall that Step 1 of our algorithm calculates dist( _u, v_ ) for each _u ∈_ _U_ and _v_ _∈_ _U ∩_ _N_ <sup>_h_</sup> ( _u_ ) in _O_ <sup>˜</sup> ( _n_ + _k_ <sup>2</sup> ) space and _O_ <sup>˜</sup> ( _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. For example, if _c_ = _n_ <sup>1</sup> <sup>_/_</sup> <sup>2</sup>, then Theorem 12 implies that we can compute the pairwise distances between all pairs of nodes in a given set of _c_ nodes in _O_ <sup>˜</sup> ( _n_ ) space and _O_ <sup>˜</sup> ( _n_ <sup>1</sup> <sup>_/_</sup> <sup>2</sup> ) passes. - Theorem 13. _Given 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_ <sup>Ω(1)</sup> _using_ _O_ <sup>˜</sup> ( _n/k_ ) _passes_ _and_ _O_ ˜( _cn_ + _k_ <sup>2</sup> ) _space_ _in_ _the_ _turnstile_ _model._ Y.-J. Chang, M. Farach-Colton, T.-S. Hsu, and M.-T. Tsai 34:13 Proof. 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. Same as the proof of Theorem 12, in Step 1, include each _s_ _∈_ _S_ in _U_ with probability 1. The modified Step 1 still takes _O_ <sup>˜</sup> ( _n_ + _k_ <sup>2</sup> ) space and _O_ <sup>˜</sup> ( _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_ = _O_ <sup>˜</sup> ( _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. In 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 _O_ <sup>˜</sup> ( _n_ + _k_ <sup>2</sup> ) space and _O_ <sup>˜</sup> ( _n/k_ ) passes. The extra space cost for maintaining these _cn_ variables is _O_ ( _cn_ ). For example, if _c_ = _n_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup>, then Theorem 13 implies that we can solve _c_ instances of BFS in _O_ <sup>˜</sup> ( _n_ <sup>4</sup> <sup>_/_</sup> <sup>3</sup> ) space and _O_ <sup>˜</sup> ( _n_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup> ) passes. Note that the space complexity of _O_ <sup>˜</sup> ( _n_ <sup>4</sup> <sup>_/_</sup> <sup>3</sup> ) is necessary to output _c_ = _n_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup> BFS trees. Theorem 13 immediately gives the following corollary. - Corollary 14. _Given_ _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_ <sup>Ω(1)</sup> _using_ _O_ ˜( _n/k_ ) _passes_ _and_ _O_ ˜( _cn_ + _k_ <sup>2</sup> ) _space_ _in_ _the_ _turnstile_ _model._ Note 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. 3.4 Diameter Approximation It 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. Roditty and Williams [40] 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_ ) _/_ <sup>_√_</sup> _<u>n</u>_ independently. Perform a BFS from each node _v_ _∈_ _S_ 1. 2. Let _v_ <sup>_⋆_</sup> be a node chosen to maximize dist( _v_ <sup>_⋆_</sup> _, S_ 1). Break the tie arbitrarily. Perform a BFS from _v_ <sup>_⋆_</sup> . 3. Let _S_ 2 be the node set consisting of the <sup>_√_</sup> _<u>n</u>_ nodes closest to _v_ <sup>_⋆_</sup>, where ties are broken arbitrarily. Perform a BFS from each node _v_ _∈_ _S_ 2. Let _D_ <sup>_∗_</sup> be the maximum distance label ever computed during the BFS computations in the above procedure. Roditty and Williams [40] proved that _D_ <sup>_∗_</sup> satisfies that _⌊_ 2 _D/_ 3 _⌋≤_ _D_ <sup>_∗_</sup> _≤_ _D_, where _D_ is the diameter of _G_ . The algorithm of Roditty and Williams [40] can be implemented in the streaming model by applying Theorem 13 with _c_ = _O_ <sup>˜</sup> ( <sup>_√_</sup> _<u>n</u>_ <u>),</u> 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_ <sup>_∗_</sup>, 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. STACS 2020 34:14 Streaming Complexity of Spanning Tree Computation - Theorem 15. _Given_ _an_ _n-node_ _connected_ _undirected_ _graph_ _G,_ _a_ _diameter_ _approximation_ _D_ <sup>_∗_</sup> _satisfying_ _⌊_ 2 _D/_ 3 _⌋≤_ _D_ <sup>_∗_</sup> _≤_ _D,_ _where_ _D_ _is_ _the_ _diameter_ _of_ _G,_ _can_ _be_ _computed_ _with_ _probability_ 1 _−_ 1 _/n_ <sup>Ω(1)</sup> _in_ _p_ _passes_ _using_ _O_ <sup>˜</sup> (( _n/p_ ) <sup>2</sup> ) _space,_ _for_ _each_ 1 _≤_ _p_ _≤_ _O_ <sup>˜</sup> ( <sup>_√_</sup> _<u>n</u>_ <u>)</u> _in_ _the_ _turnstile_ _model._ <mark>4</mark> Depth-First Search A straightforward implementation of the naive DFS algorithm in the streaming model costs either _n −_ 1 passes with _O_ <sup>˜</sup> ( _n_ ) space or a single pass with _O_ ( _n_ <sup>2</sup> ) space. Khan and Mehta [30] 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 _O_ <sup>˜</sup> ( _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. In the worst case, the “space _×_ number of passes” of the algorithms of Khan and Mehta [30] is still _O_ <sup>˜</sup> ( _n_ <sup>2</sup> ). In Section 4.2, 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 _O_ <sup>˜</sup> (( _n/k_ )+( _k/s_ )) passes and _O_ <sup>˜</sup> ( _ns_ ) space in the insertiononly model. After balancing the parameters, the space complexity is _O_ <sup>˜</sup> ( _n_ <sup>2</sup> _/p_ <sup>2</sup> ) for _p_ -pass algorithms, for each 1 _≤_ _p ≤_ _O_ <sup>˜</sup> ( <sup>_√_</sup> _<u>n</u>_ <u>).</u> A randomized algorithm using _O_ <sup>˜</sup> (( _n/k_ ) + ( _k/s_ )) passes and _O_ <sup>˜</sup> ( _ns_ <sup>2</sup> ) space in the turnstile model. After balancing the parameters, the space complexity is _O_ <sup>˜</sup> ( _n_ <sup>3</sup> _/p_ <sup>4</sup> ) for _p_ -pass algorithms, for each 1 _≤_ _p ≤_ _O_ <sup>˜</sup> ( <sup>_√_</sup> _<u>n</u>_ <u>).</u> 4.1 A Simple DFS Algorithm In this section, we present a simple alternative proof of the result of Khan and Mehta [30] that a DFS tree can be constructed in _⌈h/k⌉_ passes using _O_ <sup>˜</sup> ( _nk_ ) space, for any given parameter _k_, where _h_ is the height of the computed DFS tree. Sparse Certificate for _s_ -Node-Connectivity. A _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_ <sup>_∗_</sup> _, t_ <sup>_∗_</sup> _∈_ _G_, if they are _c_ -node-connected in _G_, then they are _c_ <sup>_′_</sup> -node-connected for some _c_ <sup>_′_</sup> _≥_ 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 _O_ ˜( _ns_ ) space _deterministically_ in the insertion-only model. In the turnstile model, Guha, McGregor, and Tench [25] showed that such a sparse subgraph of _O_ <sup>˜</sup> ( _ns_ <sup>2</sup> ) edges can be computed with high probability in a single pass using _O_ <sup>˜</sup> ( _ns_ <sup>2</sup> ) 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_ . If 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. Y.-J. Chang, M. Farach-Colton, T.-S. Hsu, and M.-T. Tsai 34:15 - Lemma 16. _Suppose_ _K_ _is_ _a_ ( _k_ + 1) _-VC_ _certificate_ _of_ _H._ _Let_ _T_ _be_ _any_ _DFS_ _tree_ _of_ _K._ _Consider_ _any_ _two_ _nodes_ _u_ _and_ _v_ _such_ _that_ _the_ _least_ _common_ _ancestor_ _w_ _of_ _u_ _and_ _v_ _are_ _within_ _the_ _top_ _k_ _layers_ _of_ _T_ _._ _If_ _w̸_ = _u_ _and_ _w̸_ = _v,_ _then_ _u_ _and_ _v_ _are_ _not_ _adjacent_ _in_ _H._ 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 _cH_ (resp., _cK_ ) be the _u_ - _v_ node-connectivity in _H_ (resp., _K_ ). The above discussion implies that _cK_ _≤_ _k_ and _cH_ _≥_ _cK_ + 1, contradicting the assumption that _K_ is a ( _k_ + 1)-VC certificate of _H_ . Algorithm. 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_ <sup>_′_</sup> be the tree induced by the top _k_ + 1 layers of of _T_ . Let _v_ 1 _, v_ 2 _, . . ., vz_ be the leaves of _T_ <sup>_′_</sup> . Denote _Si_ as the set of descendants of _vi_ in _T_, including _vi_ . By Lemma 16, there exists no edge in _G_ that crosses two distinct sets _Si_ and _Sj_ . For each 1 _≤_ _i_ _≤_ _z_, we recursively find a DFS tree _Ti_ of the subgraph of _G_ induced by _Si_ rooted at _vi_ . By the above observation, we can obtain a valid DFS tree of _G_ by appending _T_ 1 _, T_ 2 _, . . ., Tz_ to _T_ <sup>_′_</sup> . Analysis. 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 _O_ <sup>˜</sup> ( _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 _O_ <sup>˜</sup> ( _nk_ ). 4.2 Streaming Implementation of the Algorithm of Aggarwal and Anderson The 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. Due to the page limit, we only provide a sketch of the proof. The complete proof will be presented in the full version of this paper. At 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_ = <sup>_√_</sup> _<u>n</u>_ <u>,</u> MaximalPaths can be solved in the streaming model with _O_ <sup>˜</sup> ( <sup>_√_</sup> _<u>n</u>_ <u>)</u> passes and _O_ <sup>˜</sup> ( _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 _O_ <sup>˜</sup> ( _n_ <sup>2</sup> _/p_ <sup>2</sup> ), for each 1 _≤_ _p ≤_ _O_ <sup>˜</sup> ( <sup>_√_</sup> _<u>n</u>_ <u>).</u> For the more challenging turnstile model, we obtain a randomized algorithm with a somewhat worse space complexity of _O_ <sup>˜</sup> ( _n_ <sup>3</sup> _/p_ <sup>4</sup> ). STACS 2020 34:16 Streaming Complexity of Spanning Tree Computation <mark>5</mark> Single-Pass Lower Bounds In 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. _In 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_ <sup>2</sup> _/k_ <sup>2</sup> ) _bits_ _for_ _any_ _single-pass_ _randomized_ _streaming_ _algorithm_ _that_ _can_ _succeed_ _with_ _probability_ _at_ _least_ 2 _/_ 3 _._ Proof. We begin with a reduction from an _n_ <sup>2</sup> -bit instance of the Index problem to computing a spanning tree of (2 _n_ +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_ <sup>2</sup>, we construct an _n_ by _n_ bipartite graph _H_, as part of _G_, in which edge ( _xi, yj_ ) 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̸_ = _yj_ in _H_, and adding edge ( _ℓ, xi_ ), ( _s, t_ ), and ( _t, yj_ ). It clear that _G_ is connected and has leaf( _G_ ) = - 2 _n_ + 1 if ( _xi, yj_ ) _∈_ _H_ 2 _n_ otherwise Thus, having a single-pass streaming algorithm to compute leaf( _G_ ) suffices to decide the _n_ <sup>2</sup> -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_ <sup>2</sup> ) 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)(2 _n_ + 2) + 1 nodes, and has leaf( _G_ ) = - (2 _n_ + 1)( _k_ + 1) if ( _xi, yj_ ) _∈_ _H_ 2 _n_ ( _k_ + 1) otherwise Hence, having a single-pass streaming algorithm to compute leaf( _G_ ) for _G_ of ( _k_ + 1)(2 _n_ + 2) + 1 nodes to within an additive error _k_ suffices to decide the _n_ <sup>2</sup> -bit Index problem. Replace ( _k_ + 1)(2 _n_ + 2) + 1 = _n_ <sup>_′_</sup> and _n_ <sup>2</sup> = Ω(( _n_ <sup>_′_</sup> _/k_ ) <sup>2</sup> ) yields the desired bound. <mark>6</mark> Conclusion In 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_ <sup>2</sup> ) space to compute the exact solution, we show how to compute a (1 + _ε_ )-approximation using a single pass and _O_ <sup>˜</sup> ( _n_ ) space, albeit in super-polynomial time. For BFS trees and DFS trees, we show how to compute them using _O_ ( <sup>_√_</sup> _<u>n</u>_ <u>)</u> passes and _O_ <sup>˜</sup> ( _n_ ) space, and offer a smooth tradeoff between pass complexity and space usage. The 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. Y.-J. Chang, M. Farach-Colton, T.-S. Hsu, and M.-T. Tsai 34:17 ~~References~~ 1 Farid M. Ablayev. Lower bounds for one-way probabilistic communication complexity and their application to space complexity. _Theor._ _Comput._ _Sci._, 157(2):139–159, 1996. 2 Alok Aggarwal and Richard J. Anderson. A random NC algorithm for depth first search. _Combinatorica_, 8(1):1–12, March 1988. 3 Kook Jin Ahn, Sudipto Guha, and Andrew McGregor. Analyzing graph structure via linear measurements. In _Proceedings_ _of_ _the_ _Twenty-Third_ _Annual_ _ACM-SIAM_ _Symposium_ _on_ _Discrete_ _Algorithms,_ _SODA_ _2012,_ _Kyoto,_ _Japan,_ _January_ _17-19,_ _2012_, pages 459–467, 2012. 4 Sepehr Assadi, Yu Chen, and Sanjeev Khanna. Sublinear algorithms for (∆+ 1) vertex coloring. In _Proceedings_ _of_ _the_ _Thirtieth_ _Annual_ _ACM-SIAM_ _Symposium_ _on_ _Discrete_ _Algorithms,_ _SODA_ _2019,_ _San_ _Diego,_ _California,_ _USA,_ _January_ _6-9,_ _2019_, pages 767–786, 2019. 5 Jesse Beisegel. Characterising AT-free graphs with BFS. In _Graph-Theoretic_ _Concepts_ _in_ _Computer_ _Science_ _-_ _44th_ _International_ _Workshop,_ _WG_ _2018,_ _Cottbus,_ _Germany,_ _June_ _27-29,_ _2018,_ _Proceedings_, pages 15–26, 2018. 6 Richard Bellman. On a routing problem. _Quarterly_ _of_ _Applied_ _Mathematics_, 16(1):87–90, 1958. 7 Vladimir Braverman, Rafail Ostrovsky, and Dan Vilenchik. How hard is counting triangles in the streaming model? In _Automata,_ _Languages,_ _and_ _Programming_ _-_ _40th_ _International_ _Colloquium,_ _ICALP_ _2013,_ _Riga,_ _Latvia,_ _July_ _8-12,_ _2013,_ _Proceedings,_ _Part_ _I_, pages 244–254, 2013. 8 Joseph Cheriyan and Ramakrishna Thurimella. Algorithms for parallel _k_ -vertex connectivity and sparse certificates. In _Proceedings_ _of_ _the_ _Twenty-third_ _Annual_ _ACM_ _Symposium_ _on_ _Theory_ _of_ _Computing_, STOC ’91, pages 391–401. ACM, 1991. 9 Miroslav Chlebík and Janka Chlebíková. Approximation hardness of dominating set problems in bounded degree graphs. _Inf._ _Comput._, 206(11):1264–1275, 2008. 10 Derek G. Corneil, Feodor F. Dragan, and Ekkehard Köhler. On the power of BFS to determine a graph’s diameter. _Networks_, 42(4):209–222, 2003. 11 M. Elkin. Distributed exact shortest paths in sublinear time. In _Proceedings_ _of_ _the_ _49th_ _Annual_ _ACM_ _SIGACT_ _Symposium_ _on_ _Theory_ _of_ _Computing_ _(STOC)_, pages 757–770, New York, NY, USA, 2017. ACM. 12 David Eppstein, Zvi Galil, Giuseppe F. Italiano, and Amnon Nissenzweig. Sparsification - a technique for speeding up dynamic graph algorithms. _JACM_, 44(5):669–696, 1997. 13 Shimon Even and Robert Endre Tarjan. Computing an st-numbering. _Theoretical_ _Computer_ _Science_, 2(3):339–344, 1976. 14 Martin Farach-Colton, Tsan-sheng Hsu, Meng Li, and Meng-Tsung Tsai. Finding articulation points of large graphs in linear time. In _Algorithms_ _and_ _Data_ _Structures_ _-_ _14th_ _International_ _Symposium,_ _WADS_ _2015,_ _Victoria,_ _BC,_ _Canada,_ _August_ _5-7,_ _2015._ _Proceedings_, pages 363–372, 2015. 15 Martin Farach-Colton and Meng-Tsung Tsai. Tight approximations of degeneracy in large graphs. In _LATIN_ _2016:_ _Theoretical_ _Informatics_ _-_ _12th_ _Latin_ _American_ _Symposium,_ _Ensenada,_ _Mexico,_ _April_ _11-15,_ _2016,_ _Proceedings_, pages 429–440, 2016. 16 Joan Feigenbaum, Sampath Kannan, Andrew McGregor, Siddharth Suri, and Jian Zhang. On graph problems in a semi-streaming model. _Theor._ _Comput._ _Sci._, 348(2-3):207–216, 2005. 17 Joan Feigenbaum, Sampath Kannan, Andrew McGregor, Siddharth Suri, and Jian Zhang. Graph distances in the data-stream model. _SIAM_ _J._ _Comput._, 38(5):1709–1727, 2008. 18 T. Fleiner and G. Wiener. Coloring signed graphs using DFS. _Optimization_ _Letters_, 10(4):865– 869, April 2016. 19 L.R. Ford. _Network_ _Flow_ _Theory_ . Paper P. Rand Corporation, 1956. 20 Giulia Galbiati, Francesco Maffioli, and Angelo Morzenti. A short note on the approximability of the maximum leaves spanning tree problem. _Inf._ _Process._ _Lett._, 52(1):45–49, 1994. STACS 2020 34:18 Streaming Complexity of Spanning Tree Computation 21 Rajiv Gandhi, Mohammad Taghi Hajiaghayi, Guy Kortsarz, Manish Purohit, and Kanthi K. Sarpatwar. On maximum leaf trees and connections to connected maximum cut problems. _Inf._ _Process._ _Lett._, 129:31–34, 2018. 22 Mohsen. Ghaffari and Jason. Li. Improved distributed algorithms for exact shortest paths. In _Proceedings_ _of_ _the_ _50th_ _Annual_ _ACM_ _SIGACT_ _Symposium_ _on_ _Theory_ _of_ _Computing_ _(STOC)_, 2018. 23 Mohsen Ghaffari and Merav Parter. Near-optimal distributed DFS in planar graphs. In _31st_ _International_ _Symposium_ _on_ _Distributed_ _Computing,_ _DISC_ _2017,_ _October_ _16-20,_ _2017,_ _Vienna,_ _Austria_, pages 21:1–21:16, 2017. 24 A. V. Goldberg, S. A. Plotkin, and P. M. Vaidya. Sublinear-time parallel algorithms for matching and related problems. _JALG_, 14(2):180–213, 1993. 25 Sudipto Guha, Andrew McGregor, and David Tench. Vertex and hyperedge connectivity in dynamic graph streams. In _Proceedings_ _of_ _the_ _34th_ _ACM_ _Symposium_ _on_ _Principles_ _of_ _Database_ _Systems,_ _PODS_ _2015,_ _Melbourne,_ _Victoria,_ _Australia,_ _May_ _31_ _-_ _June_ _4,_ _2015_, pages 241–247, 2015. 26 Mohammad Taghi Hajiaghayi, Guy Kortsarz, Robert MacDavid, Manish Purohit, and Kanthi K. Sarpatwar. Approximation algorithms for connected maximum cut and related problems. In _Algorithms_ _-_ _ESA_ _2015_ _-_ _23rd_ _Annual_ _European_ _Symposium,_ _Patras,_ _Greece,_ _September_ _14-16,_ _2015,_ _Proceedings_, pages 693–704, 2015. 27 Chien-Chung Huang, Danupon Nanongkai, and Thatchaphol Saranurak. Distributed exact weighted all-pairs shortest paths in _O_ <sup>˜</sup> ( _n_ <sup>5</sup> <sup>_/_</sup> <sup>4</sup> ) rounds. In _IEEE_ _58th_ _Annual_ _Symposium_ _on_ _Foundations_ _of_ _Computer_ _Science_ _(FOCS)_, pages 168–179, 2017. 28 Hossein Jowhari, Mert Sağlam, and Gábor Tardos. Tight bounds for _ℓp_ samplers, finding duplicates in streams, and related problems. In _Proceedings_ _of_ _the_ _Thirtieth_ _ACM_ _SIGMOD-_ _SIGACT-SIGART_ _Symposium_ _on_ _Principles_ _of_ _Database_ _Systems_, PODS ’11, pages 49–58, New York, NY, USA, 2011. ACM. 29 Michael Kapralov, Yin Tat Lee, Cameron Musco, Christopher Musco, and Aaron Sidford. Single pass spectral sparsification in dynamic streams. _SIAM_ _J._ _Comput._, 46(1):456–477, 2017. 30 Shahbaz Khan and Shashank Mehta. Depth first search in the semi-streaming model. In _36th_ _International_ _Symposium_ _on_ _Theoretical_ _Aspects_ _of_ _Computer_ _Science_ _(STACS_ _2019)_ . Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2019. 31 Daniel J. Kleitman and Douglas B. West. Spanning trees with many leaves. _SIAM_ _J._ _Discrete_ _Math._, 4(1):99–106, 1991. 32 F. T. Leighton, B. M. Maggs, and S. B. Rao. Packet routing and job-shop scheduling in _O_ (Congestion + Dilation) steps. _Combinatorica_, 14(2):167–186, 1994. 33 R. Lipton and R. Tarjan. A separator theorem for planar graphs. _SIAM_ _Journal_ _on_ _Applied_ _Mathematics_, 36(2):177–189, 1979. 34 Hsueh-I Lu and R. Ravi. The power of local optimization: Approximation algorithms for maximum-leaf spanning tree. In _In_ _Proceedings,_ _Thirtieth_ _Annual_ _Allerton_ _Conference_ _on_ _Communication,_ _Control_ _and_ _Computing_, pages 533–542, 1992. 35 Hsueh-I Lu and R. Ravi. Approximating maximum leaf spanning trees in almost linear time. _J._ _Algorithms_, 29(1):132–141, 1998. 36 Andrew McGregor, David Tench, Sofya Vorotnikova, and Hoa T. Vu. Densest subgraph in dynamic graph streams. In _Mathematical_ _Foundations_ _of_ _Computer_ _Science_ _2015_ _-_ _40th_ _International_ _Symposium,_ _MFCS_ _2015,_ _Milan,_ _Italy,_ _August_ _24-28,_ _2015,_ _Proceedings,_ _Part_ _II_, pages 472–482, 2015. 37 S. Muthukrishnan. Data streams: Algorithms and applications. _Found._ _Trends_ _Theor._ _Comput._ _Sci._, 1(2):117–236, August 2005. 38 Hiroshi Nagamochi and Toshihide Ibaraki. A linear-time algorithm for finding a sparse _k_ -connected spanning subgraph of a _k_ -connected graph. _Algorithmica_, 7(5&6):583–596, 1992. 39 Jelani Nelson and Huacheng Yu. Optimal lower bounds for distributed and streaming spanning forest computation. In _Proceedings_ _of_ _the_ _Thirtieth_ _Annual_ _ACM-SIAM_ _Symposium_ _on_ _Discrete_ Y.-J. Chang, M. Farach-Colton, T.-S. Hsu, and M.-T. Tsai 34:19 _Algorithms,_ _SODA_ _2019,_ _San_ _Diego,_ _California,_ _USA,_ _January_ _6-9,_ _2019_, pages 1844–1860, 2019. 40 Liam Roditty and Virginia Vassilevska Williams. Fast approximation algorithms for the diameter and radius of sparse graphs. In _Proceedings_ _45th_ _ACM_ _Symposium_ _on_ _Theory_ _of_ _Computing_ _(STOC)_, pages 515–524, 2013. 41 Jens M. Schmidt. A simple test on 2-vertex- and 2-edge-connectivity. _Inf._ _Process._ _Lett._, 113(7):241–244, 2013. 42 Roberto Solis-Oba, Paul S. Bonsma, and Stefanie Lowski. A 2-approximation algorithm for finding a spanning tree with maximum number of leaves. _Algorithmica_, 77(2):374–388, 2017. 43 Xiaoming Sun and David P. Woodruff. Tight bounds for graph problems in insertion streams. In _Approximation,_ _Randomization,_ _and_ _Combinatorial_ _Optimization._ _Algorithms_ _and_ _Techniques,_ _APPROX/RANDOM_ _2015,_ _August_ _24-26,_ _2015,_ _Princeton,_ _NJ,_ _USA_, pages 435–448, 2015. 44 Robert Endre Tarjan. A note on finding the bridges of a graph. _Inf. Process. Lett._, 2(6):160–161, 1974. 45 J. D. Ullman and M. Yannakakis. High-probability parallel transitive-closure algorithms. _SIAM_ _Journal_ _on_ _Computing_, 20(1):100–125, 1991. STACS 2020

섹션 본문 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.

참고문헌

참고문헌 정보가 없습니다.