Dynamic Graph Stream Algorithms in o(n) Space
 190 Downloads
Abstract
In this paper we study graph problems in the dynamic streaming model, where the input is defined by a sequence of edge insertions and deletions. As many natural problems require \(\varOmega (n)\) space, where n is the number of vertices, existing works mainly focused on designing \({O}(n\cdot \mathrm {poly}\log n)\) space algorithms. Although sublinear in the number of edges for dense graphs, it could still be too large for many applications (e.g., n is huge or the graph is sparse). In this work, we give singlepass algorithms beating this space barrier for two classes of problems. We present o(n) space algorithms for estimating the number of connected components with additive error \(\varepsilon n\) of a general graph and \((1+\varepsilon )\)approximating the weight of the minimum spanning tree of a connected graph with bounded edge weights, for any small constant \(\varepsilon >0\). The latter improves upon the previous \(O(n\cdot \mathrm {poly}\log n)\) space algorithm given by Ahn et al. (SODA 2012) for the same class of graphs. We initiate the study of approximate graph property testing in the dynamic streaming model, where we want to distinguish graphs satisfying the property from graphs that are \(\varepsilon \)far from having the property. We consider the problem of testing kedge connectivity, kvertex connectivity, cyclefreeness and bipartiteness (of planar graphs), for which, we provide algorithms using roughly \({O}(n^{1\varepsilon }\cdot \mathrm {poly}\log n)\) space, which is o(n) for any constant \(\varepsilon \). To complement our algorithms, we present \(\varOmega (n^{1O(\varepsilon )})\) space lower bounds for these problems, which show that such a dependence on \(\varepsilon \) is necessary.
Keywords
Dynamic graph streams Graph sketching Property testing Minimum spanning tree1 Introduction
Graphs or networks are a natural way to describe structural information. For example, users of Facebook and the acquaintance relations among them form a social network, the proteins together with interactions between them define a biological network, and webpages and hyperlinks give rise to a huge web graph. Due to the rapid development of information technology, many such graphs become extremely large, and are constantly changing, which poses great challenges for analyzing their structures. Over the last decade, the data stream model [34] has proven to be successful in dealing with big data. In this model, the algorithm should make only one pass (or a few passes) over the stream, and use sublinear working space. The time required to output the final answer and process each element is also important. There is a growing body of work studying graph problems over data streams. Graph streams were first considered by Henzinger et al. [24], and later have been extensively studied in the insertiononly model (eg., [17, 18, 34]), where there is no edge deletion in the stream. Recently, starting from the seminal works of Ahn, Guha and McGregor [2, 3], the interest has shifted to the dynamic streaming model, where the edges can be both inserted and deleted (see eg., [1, 5, 6, 7, 9, 10, 14, 23, 28, 29, 31, 33]). In this setting, most algorithms designed are linear sketchbased, which is also an effective technique for processing distributed graphs. For more information about graph streaming algorithms see the recent survey by McGregor [32].
For graph streams, both insertiononly and dynamic, the research in the past has mostly focused on the semistreaming model, in which the algorithms are allowed to use \({\tilde{O}}(n)\) space, where n is the number vertices in the graph. (For notational convenience, we will use \({\tilde{O}}(g)\) and \({\tilde{\varOmega }}(g)\) to hide \(\mathrm {poly}\log (g)\) factors.) The reason behind this is that even in the insertiononly model, many natural graph problems require \(\varOmega (n)\) space (e.g., testing if the graph is connected [18]). Note that the allowed space in semistreaming model is sublinear in the input size as the number of edges of the graph might be as large as \(\varOmega (n^2)\). However, in many real applications (e.g., the input graph is already very sparse), an \({\tilde{O}}(n)\) space algorithm might be even worse than just storing all the edges. From this perspective, one may naturally ask the question which kind of problems can be solved with even less space, i.e., o(n) space.
To the best of our knowledge, very few results are known in this direction. Chitnis et al. [10] and Fafianie and Kratsch [16] introduced parameterized graph stream algorithms which may only use o(n) space with some promise of the size of the solution. This parameterized setting has been further investigated in [9]. In addition, it has been shown that the size of the maximum matching can be approximated within constant factor in \({\tilde{O}}(n^{4/5})\) space for graphs with bounded arboricity [7, 9, 15].
In this paper, we study two classes of graph problems that admit singlepass o(n) space algorithms in the dynamic streaming model. The first class contains the problems of estimating the number of connected components and the weight of the minimum spanning tree (MST). We show that one can estimate the number of connected components within an additive error of \(\varepsilon n\) with o(n) space and postprocessing time, for any constant \(\varepsilon >0\). We also present an algorithm to \((1+\varepsilon )\)approximate the weight of the MST with o(n) space and postprocessing time for connected graphs with bounded edge weights, which improves the best known algorithm with \({\tilde{O}}(n)\) space in the same setting given by Ahn et al. [2]. It is worth noting that the problem of estimating the number of connected components within small multiplicative error requires \(\varOmega (n)\) space, as it is generally harder than the problem of (exactly) testing graph connectivity; and that estimating the weight of MST for graphs with arbitrarily large edge weights (e.g., \(\varOmega (\log n)\)) requires \(\varOmega (n)\) space (see Theorem 10). Previously these two problems have been studied in the framework of sublinear time algorithms (see eg. [8, 40]).
The second class consists of problems that are relaxations of deciding graph properties. Given a huge graph, it is very useful to know whether the graph has some predetermined property, such as kconnectivity, bipartiteness, cyclefreeness and etc., which provide valuable information about the graph. However, besides the requirement of \(\varOmega (n)\) space, exactly testing properties sometimes is too strong a requirement for analyzing highly dynamic graphs, since the answer may change in the next second due to an insertion or deletion of a single edge. In this paper, we initiate the study of approximate graph property testing in the dynamic streaming model: we want to test whether a graph satisfies some property or one has to modify a small constant fraction of edges to make it have the property. This notion of approximation is adapted from the framework of property testing [21, 22, 36], and a large number of existing literatures have given efficient testing algorithms (called testers) for many properties under different query models (see surveys [20, 39]). We show that some fundamental properties can be tested in both o(n) space and postprocessing time in the dynamic streaming model and we also present close lower bounds for these problems which hold even in the insertiononly model. We remark that McGregor [32] also suggested to study the (approximate) property testers in graph streaming model, and asked whether more spaceefficient algorithms exist for these problems, and we thus give an affirmative answer to this question.
1.1 Our Results

Estimating the Number of Connected Components We present a dynamic streaming algorithm that estimates the number of connected components within additive error \(\varepsilon n\) in \({\tilde{O}}(n^{1\varepsilon +\varepsilon ^{q+1}})\) space and postprocessing time for any constant \(q\ge 1\). We note that a lower bound of \(\varOmega (n^{1O(\varepsilon )})\) for this problem follows from the work [42].

Estimating the Weight of the Minimum Spanning Tree (MST) In this problem, we want to estimate the weight of the MST of a connected graph with edge weights in the set \(\{1,2,\cdots ,W\}\). We give a dynamic streaming algorithm that computes a \((1+\varepsilon )\)approximation of the MST weight and uses space and postprocessing time \({\tilde{O}}(Wn^{1\frac{\varepsilon }{W1}+\frac{\varepsilon ^t}{(W1)^t}})\) for any constant \(t\ge 1\). By an argument in [8], the result can be extended to nonintegral weights, as long as the ratio between the largest and the smallest weight is bounded. A space lower bound of \(\varOmega (n^{1\frac{4\varepsilon }{W1}})\) is shown for this problem.
Upper and lower bounds of streaming testers
Space  Space lower bound  

\({\tilde{O}}\)  \({\varOmega }\)  
Connectivity  \(n^{1\varepsilon }\)  \(n^{18\varepsilon }\) 
kEdge connectivity  \(k^{1+\varepsilon }\cdot n^{1\varepsilon }\)  
kVertex connectivity  \(\frac{k^{1+\varepsilon /4}}{\varepsilon }\cdot n^{1\varepsilon /4}\)  
Cyclefreeness  \(n^{1\varepsilon +\varepsilon ^2}\)  \(n^{18\varepsilon }\) 
Bipartiteness of planar graphs  \(n^{1\varOmega (\varepsilon ^2)}\)  \(n^{14\varepsilon }\) 
1.2 Our Techniques
To estimate the number of connected components with small additive error \(\varepsilon n\), we note that it is sufficient to estimate the number \(\text {scc}(G)\) of connected components of small size (i.e., \(O(1/\varepsilon )\)), since the number of components of size larger than this is at most \(O(\varepsilon n)\) (see also [8]). To estimate \(\text {scc}(G)\), the following vertex sampling framework is used: we sample a sufficiently large set of vertices S by sampling each vertex in G with some probability p, and then use the statistics of the sampled connected components of the original graph to estimate \(\text {scc}(G)\). For any small connected component C in G, it is likely that all the vertices in C will be sampled out. Conditioned on this, we add \(1/p^{C}\) to our final estimator, which is the reciprocal of the probability that C is entirely sampled out. Now the task is then to identify which subsets of S are connected components in the original graph. A trivial way is to check all subsets of S, which takes too much time. A more efficient way is to only check all the connected components in G[S], since a sampled component of G must also form a component in G[S]. We carefully use a set of linear sketches to do this. More specifically, we first recover all connected components in G[S] by invoking a sketchbased streaming algorithm given in [2], which only needs space nearlinear in S. Then we use (different) linear sketches to check if any of these components is indeed a connected component of the original graph. We remark that the first set of linear sketches of a vertex v sketch its neighborhood information in G[S], while the second set sketch its neighborhood information in G. Our o(n) space streaming algorithm for \((1+\varepsilon )\)approximating the weight of MST follows via a connection between the number of connected components and the weight of MST established in [8].
To give testers for some graph property \(\Pi \) in dynamic streaming model, we start from the observation that if a graph G is far from having \(\Pi \), then typically, there exist many small disjoint subgraphs, each of which is a witness that the graph G does not satisfy \(\Pi \). (For example, if \(\Pi \) is connectivity, then there exists at least \(\varOmega (\varepsilon m)\) connected components of size at most \(O(1/\varepsilon )\) in a graph that is \(\varepsilon \)far from being connected.) This implies that by sampling a sufficient large set of vertices, with high probability, one of such subgraphs will be entirely sampled. Checking which vertices form a witness of the original graph can then be done by using the aforementioned framework. Different sketches will be used for testing different properties.
To prove lower bounds for our studied problems, we give reductions from Boolen Hidden Hypermatching (BHH) problem that was studied in [42]. Our reductions share similarity with the reduction in [42] to the cyclecounting problem and the reductions in [27, 30] to the approximate maxcut problem.
1.3 Related Work
Ahn et al. [2] initiated the study of graph sketches, and gave dynamic semistreaming algorithms for computing a spanning forest (which can be used to count the exact number of connected components), and \((1+\varepsilon )\)approximate the weight of MST. They also proposed algorithms to exactly testing of a set of properties, including testing connectivity, kedge connectivity, and bipartiteness. Recently, Guha et al. gave dynamic streaming algorithms for exactly testing of kvertex connectivity [23]. All these algorithms use \({\tilde{O}}(n)\) space (\({\tilde{O}}(kn)\) for kconnectivity). On the other hand, the randomized space lower bounds for these exact testing problems were known to be \(\varOmega (n)\) in the insertiononly model [17, 18]. Recently, Sun and Woodruff improved these lower bounds to \(\varOmega (n\log n)\) [41]. Verbin and Yu [42] proved a lower bound for cyclecounting, which implied a lower bound of \(\varOmega (n^{1O(\varepsilon )})\) for estimating the number of components.
In the random order insertiononly model Kapralov et al. [26] gave a one pass streaming algorithm that estimates the maximum matching size with polylogarithmic approximation ratio in polylogarithmic space. Although sublinear in n, the model considered is very different from ours.
Sublinear time algorithms for estimating the number of connected component and the weight of MST were first given by Chazelle et al. [8]. Later these two problems have been further considered in geometric settings [11, 13, 19]. In particular, Frahling et al. studied the problem of \((1+\varepsilon )\)approximating the weight of MST in dynamic geometric data stream [19].
There has been a rich line of work on graph property testing in the query model (see surveys [20, 39]) and the goal there is to design fast algorithms that make as few queries as possible. The query models that are mostly related to ours are bounded degree model and general graph model. In particular, our definition of \(\varepsilon \)far is adapted from the general graph model. Goldreich and Ron [22] initiated the study of property testers in bounded degree graph model, and gave testers for connectivity, kedge connectivity, 2, 3vertex connectivity, cyclefreeness, Eulerianity. Testing kvertex connectivity in bounded degree graphs for arbitrary constant k was given in [43]. These testers have later been generalized to general graph model [35, 36]. Testing bipartiteness in planar graphs was studied in [12].
After having submitted the paper, we became aware that Hossein Jowhari [25] has independently studied the problem of estimating the number of connected components and provided similar results as ours, while he did not consider the streaming property testers considered here. Furthermore, subsequent to our work, Peng and Sohler [37] showed that in random order streams, approximating the number of connected components with additive error \(\varepsilon n\) and \((1+\varepsilon )\)approximating the weight of the MST of a connected graph with bounded edge weights can be solved in a singlepass and constant space (in terms of words), i.e., the space complexity only depends on \(\varepsilon \) and is independent of the size of the graph.
2 Preliminaries
2.1 Notations
Let \([n]:=\{1,\cdots , n\}\). We use \(V:=[n]\) to denote the vertex set of the graph G defined by the stream, and let m denote the number of edges of G. For an undirected graph \(G=([n],E)\) and a vertex \(i\in [n]\), we let \(\varGamma (i)\) denote all the neighbors of i. For a set \(C\subseteq [n]\), let \(\varGamma (C)\) denote the set of vertices in \(V{\setminus } C\) that have at least one neighbor in C, that is, \(\varGamma (C)=\cup _{i\in C}\varGamma (i) {\setminus } C\). Let \(E(C,V{\setminus } C)\) denote the set of edges crossing C and \(V{\setminus } C\). We will use G[C] to denote the subgraph induced by C.
2.2 Linear Sketches
Linear sketch (or sketch for short) is a powerful tool widely used in the streaming model and other areas. Given a large vector \(\mathbf x \in \mathbb {R}^n\), we want to construct a small sketch \(\mathcal {L}(\mathbf x )\), from which certain properties of \(\mathbf x \) can be recovered. We call \(\mathcal {L}\) a linear sketch if \(\mathcal {L}(\mathbf x +\mathbf y )=\mathcal {L}(\mathbf x )+\mathcal {L}(\mathbf y )\) for all \(\mathbf x ,\mathbf y \), and this additive property make it trivial to implement linear sketches in the dynamic streaming model. As in the previous works, we will use linear sketches as our main tool.
AGM sketch We will use a dynamic streaming algorithm for constructing a spanning forest of a graph by Ahn, Guha and McGregor [2], which is summarized as follows.
Theorem 1
(AGM sketch [2]) There exists a singlepass sketchbased dynamic streaming algorithm that uses \(O(n\log ^3 n)\) space, and recovers a spanning forest of the graph with probability 0.99. The recovery time of the algorithm is \({\tilde{O}}(n)\), and the update time is \(\mathrm {poly}\log n\).
AMS sketch To check whether the input vector \(\mathbf x \) is \(\mathbf 0 \) or not, one can simply maintain a constant approximation of its second frequency moment, that is \(F_2(\mathbf x ):=\sum _i{x_i^2}\). In particular, by using the classical AMS sketch that was introduced by Alon, Matias and Szegedy [4], one can approximate \(F_2(\mathbf x )\) within a multiplicative factor of c using \(O(\log (1/\delta )\log n)\) bits of memory with probability at least \(1\delta \), for any \(0<\delta <1\) and constant \(c>1\).
Exactksparse recovery We call a vector ksparse if \(\text {supp}(\mathbf x )\le k\). Given a nonzero vector \(\mathbf x \in \mathbb {R}^n\), the goal here is to recover \(\mathbf x \) if \(\mathbf x \) is ksparse, otherwise outputs Fail. We have the following result from [38].
Lemma 1
[38] There exists an \(O(k\log n \log _k\delta ^{1})\) space sketchbased algorithm that takes as input a nonzero vector \(\mathbf x \in \mathbb {R}^n\), and with probability \(1\delta \), recovers \(\mathbf x \) if \(\mathbf x \) is ksparse, otherwise outputs Fail. The update time is \(O(\mathrm {poly}\log n)\) and the recovery time is \(O(k\cdot \mathrm {poly}\log n)\).
3 Estimating the Number of Connected Components and MST Weight
In this section, we present and analyze our algorithms for estimating the number of the connected components in a graph and \((1+\varepsilon )\)approximating the weight of the MST.
3.1 Estimating the Number of Connected Components
Our first observation is that, to estimate the number of connected components within additive error \(\varepsilon n\), we can simply ignore all the large components (see also [8]). In particular, the number of components of size larger than \(\varOmega (1/\varepsilon )\) is at most \(O(\varepsilon n)\). Thus it will be sufficient to estimate the number of components of small size, for which we have the following theorem.
Theorem 2
For any constant \(t\ge 1\), there exists a onepass dynamic streaming algorithm that uses \({\tilde{O}}(e^t n^{1\varepsilon })\) space and postprocessing time to estimates the number of connected components of size at most \(1/\varepsilon \) within an additive error \(\varepsilon ^t n\). The update time is \(O(\mathrm {poly}\log n)\).
By invoking Theorem 2 with parameter \(\varepsilon '=(1\varepsilon ^q)\varepsilon \) and \(t=(q+1)\), we get an estimator for the number of connected components of size smaller than \(1/\varepsilon '\) within additive error at most \(\varepsilon ^{q+1}n\). Since the number of components of size at least \(1/\varepsilon '\) is at most \(\varepsilon ' n = \varepsilon n\varepsilon ^{1+q}n\), the estimator also approximates the total number of connected components within additive error at most \(\varepsilon n\). The space of the algorithm is \({\tilde{O}}(e^{q+1}n^{1\varepsilon +\varepsilon ^{q+1}})\), and we have the following result.
Theorem 3
Let \(q\ge 1\) be a constant. There exists a onepass dynamic streaming algorithm that with constant success probability, estimates the number of connected components of a graph within an additive error \(\varepsilon n\) in \({\tilde{O}}(e^{q+1} n^{1\varepsilon +\varepsilon ^{q+1}})\) space and postprocessing time.
Now we give the proof of Theorem 2. Recall that the vectors \({\varvec{\Delta }}^C\) encode the information of the number of edges between C and \(V{\setminus } C\).
Proof of Theorem 2
Let \(\text {scc}(G)\) denote the number of connected components of size at most \(1/\varepsilon \) in G. Our algorithm for estimating \(\text {scc}(G)\) is as follows. We first sample each vertex with probability \(p:=(\varepsilon ^{2t} n/16)^{\varepsilon }\). Let S be the set of sampled vertices. We then use the AGM sketch from Theorem 1 to maintain a spanning forest F of the subgraph induced by S. Then for each component C in F, we test whether C is actually a connected component in G by testing whether the vector \({\varvec{\Delta }}^C:=\sum _{v\in C}{\varvec{\Delta }}^v\) is \(\mathbf 0 \), which can be done by the AMS sketch. If \({\varvec{\Delta }}^C=\mathbf 0 \), we set \(X_C=1\), otherwise set \(X_C=0\). Our estimator is then defined as \(\sum _{C} \frac{X_C}{p^{C}}\), where C ranges over all components of F with size at most \(\frac{1}{\varepsilon }\). See Algorithm 1 for the details.
Note that the algorithm samples at most \(16np=O(\varepsilon ^{2t\varepsilon }\cdot n^{1\varepsilon })\) vertices and we maintained an AGM sketch on G[S] and an AMS sketch for each sampled vertex, which imply that the space complexity of the algorithm is \(O(\varepsilon ^{2t\varepsilon } n^{1\varepsilon }\cdot \mathrm {poly}\log n)\). By simple calculus, for any \(\varepsilon \), it holds that \(\varepsilon ^{2\varepsilon }\le e^{2/e}<e\), so the space is at most \({\tilde{O}}(e^tn^{1\varepsilon })\). The postprocessing time is near linear in the space, and the update time is \(O(\mathrm {poly}\log n)\).
Now we prove the correctness of the above algorithm. First we note that the expected number of sampled vertices in Step (1) is np, and thus by Markov inequality, the probability that more than 16np vertices are sampled is at most \(\frac{1}{16}\). Also note that with probability at least \(1\frac{1}{16}\), the AGM sketch returns a true spanning forest of G[S]. In addition, since the number of components in F is at most n, we will query the AMS sketch at most n times. Thus if we set the error probability of the AMS sketch to be \(\delta =\frac{1}{16n}\), then with probability at least \(1\frac{1}{16n}\cdot n = 1\frac{1}{16}\), all invocations of AMS sketches (with \(\log ^2 n\) bits of space per sketch) for testing if \({\varvec{\Delta }}^C = \mathbf 0 \) will give the correct answer. Conditioned on this event, \(X_\ell \) defined in Step (6) is exactly the number of connected components B of size \(\ell \) in G such that all vertices in B are sampled out, which is true since for any component \(C\in F\), \(F_2({\varvec{\Delta }}^C)=\mathbf 0 \) if and only if C is a connected component in G.
Let \(B_1,\cdots ,B_{\text {scc}(G)}\) be the connected components of size at most \(\frac{1}{\varepsilon }\) of G.
For any integer \(\ell \le \frac{1}{\varepsilon }\), let \(\mathcal {B}_\ell \) denote the set of connected components of size \(\ell \) in G, that is, \(\mathcal {B}_\ell =\{B_i: 1\le i\le \text {scc}(G), \left B_i\right =\ell \}\). Let \(b_\ell :=\mathcal {B}_\ell \). Note that \(\text {scc}(G)=\sum _{\ell \le \frac{1}{\varepsilon }}b_\ell \). For any set B, let \(Z_B\) denote the indicator random variable that all the vertices in B have been sampled. Note that \(\Pr [Z_B=1] = p^{\left B\right }\). Now by the above argument, \(X_\ell =\sum _{B\in \mathcal {B}_\ell }Z_B\), and \(\text {E}[X_\ell ] = b_\ell \cdot p^\ell \). Furthermore, we have \(Y=\sum _{\ell \le \frac{1}{\varepsilon }} \frac{X_\ell }{p^\ell }=\sum _{\ell \le \frac{1}{\varepsilon }} \frac{\sum _{B\in \mathcal {B}_\ell }Z_B}{p^\ell },\) and thus \(\text {E}[Y]=\sum _{\ell \le \frac{1}{\varepsilon }}b_\ell =\text {scc}(G)\).
3.2 Approximating the Weight of Minimum Spanning Tree
We use the previous algorithm on estimating the number of connected components to approximate the weight of a minimum spanning tree of a weighted graph. Let \(W\ge 2\) be an integer, G be a connected graph with integer edge weights from \([W]:=\{1,\cdots ,W\}\), and \(c(\text {MST})\) be the weight of an MST of G. For any \(1\le \ell \le W\), let \(G^{(\ell )}\) denote the subgraph of G consisting of all edges of weight at most \(\ell \). Let \(\text {cc}^{(\ell )}\) denote the number of connected components of \(G^{(\ell )}\). Chazelle et al. [8] give the following lemma relating the weight of MST to the number of connected components of \(G^{(\ell )}\).
Lemma 2
[8] It holds that \(c(\text {MST})=n  W + \sum _{\ell =1}^{W1}\text {cc}^{(\ell )}\).
For a connected graph with integer edge weights, the weight of any MST is at least \(n1\), so it is sufficient to estimate \(cc^{(\ell )}\) within an additive error of \(\varepsilon n/(W1)\) for each \(\ell \). To do this, we can simply run \(W1\) parallel instances of Theorem 3, each of which sketches a subgraph \(G^{(\ell )}\). Then the space of the algorithm will be \({\tilde{O}}(Wn^{1\frac{\varepsilon }{W1}})\).
Theorem 4
Let \(t\ge 1\) be any constant. There exists a singlepass dynamic streaming algorithm that uses space and postprocessing time \({\tilde{O}}(e^tW n^{1\frac{\varepsilon }{W1}+\frac{\varepsilon ^t}{(W1)^t}})\) to compute a \((1+\varepsilon )\)approximation of the weight of the MST.
We remark that Ahn et al. [2] have given a dynamic streaming algorithm for this problem for any graph with maximum edge weight upper bounded by \(O(\mathrm {poly}(n))\), and their algorithm uses space \(O(n\cdot \mathrm {poly}\log n)\). Our algorithm uses o(n) space for any connected graph with maximum edge weight bounded by \(o(\log n)\) (for constant \(\varepsilon \)), which improves the algorithm of [2] in this setting. We also note that \(\varOmega (n)\) space is necessary for estimating the weight of MST for graphs with maximum edge weight at least \(c\log n\) for constant \(\varepsilon \) and some large universal constant c (see Theorem 10). Finally, we remark that the algorithm can also be extended to the setting where nonintegral weights are allowed (see [8] for more details).
4 Dynamic Streaming Testers
In this section, we give our streaming testers for a number of graph properties, including kedge connectivity, kvertex connectivity, cyclefreeness, planar graph bipartiteness, and Eulerianity.
4.1 Testing kEdge Connectivity
A graph is kedge connected if the minimum cut of the graph has size at least k. We start from the simplest case, i.e., \(k=1\), which is equivalent to the problem of testing connectivity.
4.1.1 Connectivity
It is clear that if G is \(\varepsilon \)far from being connected, one must add at least \(\varepsilon m\) edges to make it connected, which implies that there are at least \(\varepsilon m + 1\) connected components in G [22, 36]. Therefore, we can distinguish a connected graph from any graph that is \(\varepsilon \)far from being connected by estimating the number of connected components with an additive error \(\Theta (\varepsilon n)\). However, by a more careful analysis, we can reduce the space by a factor of \(O(n^{O(\varepsilon )})\).
Theorem 5
There exists a dynamic streaming tester for 1edge connectivity that runs in \({\tilde{O}}(n^{1\varepsilon })\) postprocessing time and space.
Proof
It is easy to see that Algorithm 2 only uses \({\tilde{O}}(S)\) space, which is bounded by \({\tilde{O}}(np)={\tilde{O}}(\varepsilon ^{\varepsilon } n^{1\varepsilon })={\tilde{O}}(n^{1\varepsilon })\). The postprocessing time is nearly linear in the size of S, since the AGM algorithm needs \({\tilde{O}}(S)\) postprocessing time, and we invoke at most S AMS queries, each of which takes \({\tilde{O}}(1)\) time. The update time is \(\mathrm {poly}\log n\).
For the correctness of the algorithm, we condition on the event that the number of sampled vertices is at most 16np, which occurs with probability at least \(1\frac{1}{16}\), and on the event that the spanning forest F is constructed correctly, which occurs with probability 0.99. By setting the error probability of the AMS sketch to be \(1/n^2\) (with an extra \(\log n\) factor in space), with probability 0.99, all the answers from AMS sketches are all correct, and we also condition on this.
4.1.2 kEdge Connectivity: \(k\ge 2\)
By using a slightly more involved argument and replacing AMS sketches with \((k1)\)sparse recovery sketches, we can generalize the above idea to testing kedge connectivity for \(k\ge 2\). We have the following theorem on testing kedge connectivity.
Theorem 6
Let \(k\le O(n^{\varepsilon /(1+\varepsilon )})\). There exists a singlepass dynamic streaming tester for kedge connectivity with postprocessing time and space \({\tilde{O}}(k^{1+\varepsilon }\cdot n^{1\varepsilon })\).
In order to prove Theorem 6, we will use the following result by Orenstein and Ron [35], who have given, for any \(k\ge 2\), a characterization of graphs that are \(\varepsilon \)far from being kedge connected (which simplifies the corresponding result in [22]). We define a subset C to be \(\ell \)extreme if \(E(C,V{\setminus } C)= \ell <k\) and for any \(C'\subset C\), \(E(C',V{\setminus } C')> \ell \).
Lemma 3
(Corollary 14 and Claim 16 in [35]) If G is \(\varepsilon \)far from being kedge connected, then there are at least \(\frac{2\varepsilon m}{k}\) disjoint subsets with an edgecut smaller than k. For each such a subset C, it contains a minimal subset \(C'\subseteq C\) that is \(\ell \)extreme for some \(\ell <k\).
Now we present the proof of Theorem 6.
Proof of Theorem 6
It is clear that \(m\ge nk/2\) for any kconnected graph, and thus we can safely reject whenever \(m<nk/2\). In the following, we will only consider the case that \(m\ge nk/2\). Our tester is then described in Algorithm 3.
Note that the AGM sketch use space \({\tilde{O}}(S)={\tilde{O}}(np)={\tilde{O}}(k^\varepsilon n^{1\varepsilon })\). In addition, each sampled vertex only needs to store a ksparse recovery sketch, so the space complexity of the algorithm is \({\tilde{O}}(k)\cdot np={\tilde{O}}(k^{1+\varepsilon }n^{1\varepsilon })\). The postprocessing time is near linear in the space, and the update time is \(O(\mathrm {poly}\log n)\).
For the correctness of the algorithm, we first note that if G is kedge connected, then G will be accepted as long as there is no error happening when querying the ksparse recovery sketches. This happens with probability \(11/n\) by setting the error probability of the sketch to be \(1/n^2\), and we will condition on this event.
Now if G is \(\varepsilon \)far from being kedge connected, then from Lemma 3, it follows that there are at least \(\frac{2\varepsilon m}{k}\ge \varepsilon n\) disjoint \(\ell \)extreme subsets. Let \(B_1,\cdots ,B_s\) be the set of these \(\ell \)extreme subsets where \(s\ge \varepsilon n\). Observe that for any \(\ell \)extreme subset B, the induced subgraph G[B] is connected. This is true since otherwise, there exists a subset \(B'\subset B\) satisfying \(E(B', B{\setminus } B')=0\), which implies that \(E(B',V{\setminus } B')\le E(B,V{\setminus } B)=\ell \), contradicting to the assumption that B is \(\ell \)extreme.
Let \(\mathcal {E}_i\) be the event that \(B_i\) is entirely sampled out, and \(\mathcal {F}_i\) be the event that none of the vertices in \(\varGamma (B_i)\) is sampled.
Lemma 4
 1.
\(E(B_i,B_j)=0\) for all \(i,j\in I\) and \(i\ne j\), and
 2.
\(\sum _{i\in I}B_i \le \sum _{j=1}^sB_j/k\).
Proof
We say \(B_i\) and \(B_j\) are neighbors, if \(E(B_i,B_j)>0\). We iteratively construct the index set \(I\subset [s]\) as follows. We start from the empty set \(I_0=\emptyset \) and add one index at each step. Let \(I_t\) denote the set that at the end of step t. In the \((t+1)\)th step, we find the smallest set \(B_{i_{t+1}}\) that is not a neighbor of \(B_{i_h}\) for any \(h\le t\) and add the index \(i_{t+1}\), i.e., \(I_{t+1}=I_t\cup \{i_{t+1}\}\). Note that since each \(\ell \)extreme set has at most \(k1\) neighbors, we can always find such a set if \(t<s/k\). Let \(I= I_{s/k}\). Then Item 1 of the lemma follows by our construction. Since the set \(B_{i_t}\) that we found in the tth step may intersect with at most k sets, and \(B_{i_t}\) is the smallest set that has no intersection with all sets found in the first \(t1\) steps, there must exist a partition of [s] into s / k sets \(\{P_1,P_2,\cdots , P_{s/k}\}\), such that for any \(t\le s/k\) and \(j\in P_t\), \(B_j\ge B_{i_t}\). Item 2 of the lemma then follows from our construction of the index subset \(I=\{i_j: 1\le j\le s/k\}\), and the fact that \([s]=\cup _{t=1}^{s/k} P_t\). \(\square \)
We remark that the problem can still be solved in space \({\tilde{O}}(kn^{1\varepsilon })\) for larger k by testing the neighborhood of all subsets of size smaller than \(1/\varepsilon \) in S, however the postprocessing time will be \({\tilde{O}}(kn^{O(1/\varepsilon )})\). Also, \(k\le O(n^{\varepsilon })\) is the most interesting case for us, since we are mostly interested in o(n) space algorithms.
4.2 kVertex Connectivity
A graph is kvertex connected if the minimum vertex cut of the graph has size at least k, i.e. it remains connected whenever fewer than k vertices are removed. The following lemma on the structure of graphs that are \(\varepsilon \)far from being kvertex connected can be directly deduced from Corollary 19 in [35].
Lemma 5
If the graph is \(\varepsilon \)far from kvertex connected, then there exists at least \(\frac{\varepsilon m}{2k}\) subsets C of size at most \(\frac{2k n}{\varepsilon m}\) such that G[C] is connected and \(\varGamma (C)< k\).
Proof
(sketch) In Corollary 19 in [35], it is proven that for any directed graph G that is \(\varepsilon \)from kvertex connected, then there exists at least \(\frac{\varepsilon m}{2k}\) subsets C of size at most \(\frac{2kn}{\varepsilon m}\), and either \(\varGamma ^+(C)< k\) or \(\varGamma ^(C) < k\), where \(\varGamma ^+(C):=\{v\in V{\setminus } C: \langle v,u\rangle \in E(G), u\in C\}\) (resp., \(\varGamma ^(C):=\{v\in V{\setminus } C: \langle u,v\rangle \in E(G), u\in C\}\)) denotes the set of vertices in \(V{\setminus } C\) that are endpoints of incoming (resp., outgoing) edges incident to C.
On the other hand, in Sect. 5.3 in [35], it is proven that if an undirected graph G is \(\varepsilon \)far from kvertex connected, then the corresponding directed graph \(G'\) that is obtained by turning each undirected edge (u, v) into directed edges \(\langle u,v\rangle \) and \(\langle v,u\rangle \) is \(\varepsilon \)far from being kvertex connected. Therefore, there exists at least \(\frac{\varepsilon m}{2k}\) subsets C in \(G'\) of size at most \(\frac{2k n}{\varepsilon m}\), and either \(\varGamma _{G'}^+(C)< k\) or \(\varGamma _{G'}^(C) < k\). This directly implies that the corresponding set C in G satisfies that \(\varGamma _{G}(C)<k\). Finally, if G[C] is not connected, then we can replace C by one maximal subset \(C'\subset C\) such that \(G[C']\) is connected. Note that \(\varGamma _{G}(C')\le \varGamma _G(C)<k\). This completes the proof of the lemma. \(\square \)
Now we use the above lemma to show our kvertex connectivity tester.
Theorem 7
Let \(k\le O(n^{\frac{\varepsilon }{4+\varepsilon }})\). There exists a singlepass dynamic streaming tester for kvertex connectivity with postprocessing time and space complexity \({\tilde{O}}(\frac{k^{1+\varepsilon /4}}{\varepsilon }\cdot n^{1\varepsilon /4})\).
Proof
(sketch) We can also simply consider the case that \(m\ge nk/2\), since otherwise the graph cannot be kvertex connected and we can directly reject. Our approach for testing kconnectivity is similar to testing kedge connectivity. The difference here is that now we cannot use the \((k1)\)sparse recovery sketch for the vector \({\varvec{\Delta }}^v\). Instead, for each vertex \(v\in S\), we will maintain an exact \(k'\)sparse recovery sketch of the vector \({\varvec{\Lambda }}^v\) (defined in Sect. 2.1), \(\mathcal {S}_{k'}({\varvec{\Lambda }}^v)\), for \(k'=\frac{4}{\varepsilon }+k\). Then for each detected connected component C of size smaller than \(4/\varepsilon \) in G[S] (by AGM sketch), recover \({\varvec{\Lambda }}^C:=\sum _{v\in C}{\varvec{\Lambda }}^v\) from the sketch \(\mathcal {S}_{k'}({\varvec{\Lambda }}^C)=\sum _{v\in C}\mathcal {S}_{k'}({\varvec{\Lambda }}^v)\). If it succeeds, we get the set \(C\bigcup \varGamma (C)\), and since we know C, we get \(\varGamma (C)\). If \(\varGamma (C)<k\), we reject. For any kvertex connected graph, the tester will never reject if all the sparse recover sketches return correctly, which happens with high probability. On the other hand, if G is \(\varepsilon \)far from kvertex connected, by similar analysis as in kedge connectivity together with Lemma 5, we know that with high probability, there is a subset \(C\subseteq S\) such that G[C] is a connected component in G[S], \(\varGamma (C)<k\) and \(C\le 4/\varepsilon \), and conditioned on this the algorithm will successfully recover \(\varGamma (C)\), and reject with high probability. Here to make the analysis work, we have to set the sampling probability \(p:=(\varepsilon n/16k)^{\varepsilon /4}\), so the space used is \({\tilde{O}}(k'\cdot k^{\varepsilon /4}\cdot n^{1\varepsilon /4})={\tilde{O}}(\frac{k^{1+\varepsilon /4}}{\varepsilon }\cdot n^{1\varepsilon /4})\). Since the analysis is almost the same as kedge connectivity, we omit the details here.
\(\square \)
4.3 Testing CycleFreeness
Theorem 8
There exists a singlepass dynamic streaming algorithm that tests cyclefreeness of a graph with space and postprocessing time \({\tilde{O}}(n^{1\varepsilon +\varepsilon ^2})\).
Proof
Note that if \(m>n1\), then the graph must contain at least one cycle, and thus we can safely reject the graph. In the following, we assume that \(m\le n1\). Note that if \(\varepsilon \le 1/(10\log n)\), then we can simply store whole graph and test if it is cyclefree, as the size of the graph is \(O(n)=O(n^{1\varepsilon +\varepsilon ^2}\cdot \mathrm {poly}\log n)\). In the following, we will assume that \(\varepsilon >1/(10\log n)\). Our algorithm for testing cyclefreeness depends on the construction of AGM sketch, in which each vertex u maintains a linear sketch of \({\varvec{\Delta }}^{u}\) (denoted as \(\mathcal {A}({\varvec{\Delta }}^u)\)). Each such sketch has size \(\mathrm {poly}\log n\) and the property that \(\mathcal {A}(\mathbf 0 )=\mathbf 0 \) (it consists of \(O(\log n)\)\(l_0\)samplers, see [2] for details). Our main idea is to maintain a sparse recovery sketch for the AGM sketch (i.e. a composition of sparse recovery sketch and AGM sketch). Now we describe our algorithm in Algorithm 4.
Note that the space used by the algorithm is \(\max \{{\tilde{O}}(np_0),{\tilde{O}}(np), k\cdot \mathrm {poly}\log n\} = {\tilde{O}}(n^{1\varepsilon +\varepsilon ^2}+n^{2\varepsilon /(1+\varepsilon +\varepsilon ^2)}/\varepsilon ^6)={\tilde{O}}(n^{1\varepsilon +\varepsilon ^2})\) as \(\varepsilon >1/(10\log n)\), and the postprocessing time is near linear in space.
Now we prove the correctness of the algorithm. We define \(G'\subseteq G\) to be a subgraph which consists of all the vertices of positive degree. Let \(n'=G'\). Note that \(m\ge n'/2\).
If \(n'\le n^{1\eta }\), then the vector \({\varvec{\Upsilon }}\) is \({\tilde{O}}(n^{1\eta })\)sparse, since for all isolated vertices u, we have \(\mathcal {A}({\varvec{\Delta }}^u)=\mathbf 0 \), and thus we can recover the entire \({\varvec{\Upsilon }}\) exactly. Then by Step 2(c) and Theorem 1, we can get the exact number of components of \(G'\). Since the number of vertices of \(G'\) is Y, and \(\lambda = m\) is the total number of edges, then the graph is cyclefree if and only if \({\tilde{c}}_1= Y\lambda \).
If \(n'>n^{1\eta }\), then conditioned on the event that all \(AMS({\varvec{\Delta }}^v)\) for \(v\in S_0\) are correct (which occurs with high probability), our estimator \({\tilde{c}}_0\) approximates the number of isolated vertices in G, denoted by \(c_0\), with an additive error \((\varepsilon ^3/16) n^{1\eta }\) with probability at least \(1\frac{1}{16}\) (by our choice that \(p_0=\frac{1}{4096\varepsilon ^6n^{12\eta }}\) and similar analysis for the proof of Theorem 2). We will condition on this event. Since \(n'>n^{1\eta }\) and \(m\ge n'/2\), we have that \(c_0{\tilde{c}}_0\le (\varepsilon ^3/8)m\).
Now note that by Theorem 2, \({\tilde{c}}_2\) is an estimator for the number, denoted by \(c_2\), of components in \(G'\) of size smaller than \(1/\eta \) with additive error \(\eta ^t\sqrt{n'n^{1\eta }}\). This follows by the upper bound \(\eta ^{2t}n^{1\eta } n'/16\) of the variance of the estimator (which can be shown similarly to inequality (1) in Sect. 3) and the Chebyshev’s inequality. Now note that the additive error is at most \(\eta ^t n'\le \varepsilon ^3 m/8\) for some constant t since \(n'>n^{1\eta }\) and \(m\ge n'/2\). That is, with high probability, \(c_2{\tilde{c}}_2\le \varepsilon ^3 m/8\). In the following, we condition on this event.
Let L be the number of components in \(G'\) of size larger than \(1/\eta \). Note that each such component has at least \(1/\eta 1\) edges. Thus, \(m\ge L\cdot (1/\eta 1)\), which gives that \(L\le \frac{\eta }{1\eta } m=\frac{\varepsilon }{1+\varepsilon ^2}m\) by our choice of \(\eta \).
If the original graph G is cyclefree, then the number of connected components of G equals \(nm\), i.e., \(c_0+L+c_2 = n  m\). Thus, we have that \({\tilde{c}}_0+{\tilde{c}}_2 \le c_0+\varepsilon ^3 m/8+ c_2 + \varepsilon ^3 m/8 = n  m  L +\varepsilon ^3 m/4 \le n  m+ \frac{\varepsilon ^3}{4}m\). The algorithm will output Accept.
If G is \(\varepsilon \)far from being cyclefree, then \(c_0+L+c_2 > n  m + \varepsilon m\). Thus, \({\tilde{c}}_0+{\tilde{c}}_2 \ge c_0\varepsilon ^3 m/8+c_2  \varepsilon ^3 m/8> n  m + \varepsilon m L  \varepsilon ^3 m/4\ge nm +\frac{\varepsilon ^3}{1+\varepsilon ^2} m  \varepsilon ^3 m/4>nm+\varepsilon ^3 m/4\). The algorithm will output Reject.
Thus, our algorithm can distinguish cyclefree graphs from those graphs that are \(\varepsilon \)far from being cyclefree with probability at least 2 / 3. This completes the proof of the theorem. \(\square \)
4.4 Testing Bipartiteness of the Planar Graphs
Now we consider the problem of testing if a planar graph is bipartite or \(\varepsilon \)far from bipartite. Here a planar graph is \(\varepsilon \)far from bipartite if one has to delete at least \(\varepsilon m\) edges to get a bipartite graph. Czumaj et al. [12] showed the following result^{1}.
Lemma 6
[12] For any (simple) planar graph G that is \(\varepsilon \)far from bipartite, then G has at least \(\varepsilon m/q(\varepsilon )\) edgedisjoint oddlength cycles of length at most \(q(\varepsilon )/2\) each, where \(q(\varepsilon )=O(1/\varepsilon ^2)\).
By the above lemma, we only need to sample each edge independently with some probability (rather than vertices as we did before) of the graph so that with high probability the resulting sampled graph contains at least one short oddlength cycle. The edgesampling process can be done by using hash functions (see e.g. [3]). Similar to our previous analysis, it will be sufficient to set the sample probability to \(p=O_\varepsilon ( n^{q(\varepsilon )})\), which implies that the space used is \({\tilde{O}}(n^{1\varOmega (\varepsilon ^2)})\). We omit the details here.
4.5 Testing Eulerianity
Note that the algorithm for connectivity testing can be directly used to testing Eulerianity. A graph G is Eulerian if there is a path in the graph that traverses each edge exactly once, or equivalently, if G is connected and the degrees of all vertices are even or exactly two vertices have odd degrees. Note that if graph G is \(\varepsilon \)far from being Eulerian then either G has \(\varOmega (\varepsilon n)\) connected components (i.e. far from being connected) or has \(\varOmega (\varepsilon n)\) vertices of odd degree (cf., [22, 36]). Then one can test Eulerianity by first invoking the previous algorithm on testing connectivity, and then sample \(O(1/\varepsilon )\) vertices and check if some sampled vertex has odd degree. The postprocessing time and space complexity of the final algorithm are \({\tilde{O}}(n^{1c\cdot \varepsilon })\) for some universal constant c.
5 Lower Bounds
In this section we present lower bounds, which hold in the insertiononly model. Our proofs are based on the reductions to the Boolean Hidden Hypermatching (BHH) problem (See [42]), which are in the same spirit as the lower bound proof for the Cycle Counting problem in [42]. We first give the definition of the boolean hidden hypermatching problem.
Definition 1
(\(\text {BHH}_n^t\)) In the this problem, Alice gets a boolean vector \(x\in \{0,1\}^n\), where \(n=2kt\) for some integer k. Bob gets a partition (or hypermatching) of the set [n], \(\{m_1,\cdots ,m_{n/t}\}\), where the size of each \(m_i\) is t, and a vector \(w\in \{0,1\}^{n/t}\). For convenience, we will also use the corresponding ndimensional boolean indicator vector \(M_i\) to represent \(m_i\), and let M be a \(n/t\times n\) matrix, the i row of which is \(M_i\). The promise of the input is either \(Mx+w=\mathbf 1 \) or \(Mx+w=\mathbf 0 \), where all the operations are modulo 2. The goal of the problem is to output 1 when \(Mx+w=\mathbf 1 \), and output 0 otherwise.
We have the following lower bound from [42].
Theorem 9
[42] The randomized oneway communication complexity of \(\text {BHH}_n^t\) when \(n=2kt\) for some integer \(k\ge 1\) is \(\varOmega (n^{11/t})\).
Our lower bounds will be built upon the following basic construction.
Observe that the edges added by Alice and Bob form two paths \(p_{2i1},p_{2i}\) over vertex set \(S_i\), where \(p_{2i1}\) starts from \(v_{2m_{i,1}1}\) and \(p_{2i}\) starts from \(v_{2m_{i,1}}\) for each i. The entire graph G(x, M) consists of 2n / t disjoint paths \(\{p_1\cdots ,p_{2n/t}\}\). It also has the following property.
Fact 1
Based on the value of \((Mx)_i\), we have: 1) if \((Mx)_i=0\), then \(p_{2i1}\) is a path from \(v_{2m_{i,1}1}\) to \(u_{2m_{i,t}1}\) and \(p_{2i}\) is a path from \(v_{2m_{i,1}}\) to \(u_{2m_{i,t}}\); 2) if \((Mx)_i=1\), then \(p_{2i1}\) is a path from \(v_{2m_{i,1}1}\) to \(u_{2m_{i,t}}\) and \(p_{2i}\) is a path from \(v_{2m_{i,1}}\) to \(u_{2m_{i,t}1}\).
5.1 Minimum Spanning Tree
Theorem 10
In the insertiononly model, if all edges of the graph have weights in [W], any algorithm that \((1\pm \varepsilon )\)approximates the weight of the MST must use \(\varOmega (n^{1\frac{4\varepsilon }{W1}})\) bits of space.
Proof
Given x and M, Alice and Bob first construct the graph G(x, M) as described above. Next Bob adds \((u_{2m_{i,t}1},v_{2m_{i,1}1})\) and \((u_{2m_{i,t}},v_{2m_{i,1}})\) if \(w_i=0\); adds \((u_{2m_{i,t}1},v_{2m_{i,1}})\) and \((u_{2m_{i,t}},v_{2m_{i,1}1})\) if \(w_i=1\). The weight of all the edges added so far is 1. Next, regardless of the value of \(w_i\), Bob places edges \((v_{2m_{i,t}},v_{2m_{i+1,1}})\) with weight 1 for \(i=1,\cdots ,n/t1\) and edges \((v_{2m_{i,t}},u_{2m_{i,t}})\) with weight W for each \(i\in [n/t]\), so that the graph become connected. By similar argument as above, if \(Mx+w=\mathbf 0 \), all the edges \((v_{2m_{i,t}},u_{2m_{i,t}})\) must be picked in any minimum spanning tree, since each of these edges forms a cut, and thus the weight of any MST is \(nW/t+4nn/t1=4n\varepsilon +4n1\), where we set \(t=(W1)/4\varepsilon \). On the other hand, when \(Mx+w=\mathbf 1 \), the weight of the MST is \(4n1\), since in this case, the graph is already connected without those edges with weight W. So if the algorithm can compute an \((1+\varepsilon )\)approximation of the weight of the minimum spanning tree, it solves the \(\text {BHH}_n^t\) problem. This completes the proof. \(\square \)
5.2 Testing Connectivity
Theorem 11
In the insertiononly model, to distinguish whether a graph of 4n vertices is connected or \(\frac{1}{8t+1}\)far from being connected, any algorithm must use \(\varOmega (n^{11/t})\) bits of space.
Proof
Given x and M, Alice and Bob first construct the graph G(x, M). Next Bob adds another set of edges based on vector w. If \(w_i=0\), he adds \((u_{2m_{i,t}1},v_{2m_{i,1}1})\) and \((u_{2m_{i,t}},v_{2m_{i,1}})\); if \(w_i=1\), he adds \((u_{2m_{i,t}1},v_{2m_{i,1}})\) and \((u_{2m_{i,t}},v_{2m_{i,1}1})\). So when \((Mx)_i+w_i=0\), \(p_{2i1}\) and \(p_{2i}\) become 2 disjoint cycles. On the other hand, when \((Mx)_i+w_i=1\), \(p_{2i1}\) and \(p_{2i}\) together form a larger cycle. Now Bob places \((v_{2m_{i,t}},v_{2m_{i+1,1}})\) in E for \(i=1,\cdots ,n/t1\) which connect \(p_{2i}\) with \(p_{2(i+1)}\) for all \(i\in [n/t1]\), i.e. all the paths in G(x, M) with even indices become a connected component. The total number of edges is \(8n+n/t\). When \(Mx+w=\mathbf 0 \), the graph has \(n/t+1\) components which is \(\frac{1}{8t+1}\)far from connected; when \(Mx+w=\mathbf 1 \) the graph is connected. So if a streaming algorithm can distinguish whether a graph of size 4n is connected or 1 / 8tfar from being connected, it solves \(\text {BHH}_n^t\), since Alice can first run the algorithm on her part of the graph and send the memory to Bob, and then Bob continues to run the algorithm on his part and output the answer. Therefore, the communication lower bound of \(\text {BHH}_n^t\) implies a space lower bound of testing connectivity. \(\square \)
5.3 Testing CycleFreeness
As in the proof of Theorem 11, given x and M, Alice and Bob first construct G(x, M). Then, for \(i\in [n/t]\), Bob adds \((u_{2m_{i,t}1},v_{2m_{i,1}1})\) if \(w_i=0\); adds \((u_{2m_{i,t}1},v_{2m_{i,1}})\) if \(w_i=1\). The total number of edges is less than 8n. Through similar arguments, it is easy to verify that if if \(Mx+w=\mathbf 0 \), the graph has exactly n / t cycles and n / t paths, which is 1 / 8tfar from cyclefree. On the contrary, if \(Mx+w=\mathbf 1 \), the graph has n / t paths and no cycle. So if an algorithm can distinguish whether a graph of size 4n is cyclefree or 1 / 8tfar from cyclefree, it solves \(\text {BHH}_n^t\).
Theorem 12
In the insertiononly model, any algorithm that can distinguish whether a graph of 4n vertices is cyclefree or 1 / 8tfar from being cyclefree, must use \(\varOmega (n^{11/t})\) bits of space.
5.4 Testing Bipartiteness of Planar Graphs
Alice and Bob first construct the graph G(x, M). Next, for each \(i\in [n/t]\), Bob adds edges \((v_{2m_{i,1}1}, \xi _1)\) and \((v_{2m_{i,1}}, \xi _2)\), where \(\xi _1,\xi _2\) are new vertices. For \(i\in [n/t]\), Bob also adds \((u_{2m_{i,t}1},\xi _1)\) and \((u_{2m_{i,t}},\xi _2)\) if \(w_i=0\); adds \((u_{2m_{i,t}1},\xi _2)\) and \((u_{2m_{i,t}},\xi _1)\) if \(w_i=1\). For this problem we assume t is odd. So by similar arguments, we can easily verify that, if \(Mx+w=\mathbf 0 \), the graph contains 2n / t edgedisjoint cycles of length \(2t+1\), and if \(Mx+w=\mathbf 1 \), the graph has no odd cycle, and thus bipartite. The graph constructed is planar and has \(4n+2\) vertices and \(8n+4n/t\) edges, so we have the following lower bound for testing bipartiteness.
Theorem 13
In the insertiononly model, any algorithm that can distinguish whether a planar graph of \(4n+2\) vertices is bipartite or \(\frac{1}{4t+2}\)far from being bipartite, must use \(\varOmega (n^{11/t})\) bits space.
Footnotes
Notes
References
 1.Ahn, K.J., Cormode, G., Guha, S., McGregor, A., Wirth, A.: Correlation clustering in data streams. In: Proceedings of the 32nd International Conference on Machine Learning, ICML, pp. 6–11 (2015)Google Scholar
 2.Ahn, K.J., Guha, S., McGregor, A.: Analyzing graph structure via linear measurements. In: Proceedings of the Twentythird Annual ACMSIAM Symposium on Discrete Algorithms, pp. 459–467. SIAM, Philadelphia (2012)Google Scholar
 3.Ahn, K.J., Guha, S., McGregor, A.: Graph sketches: sparsification, spanners, and subgraphs. In: Proceedings of the 31st Symposium on Principles of Database Systems, pp. 5–14. ACM, New York (2012)Google Scholar
 4.Alon, N., Matias, Y., Szegedy, M.: The space complexity of approximating the frequency moments. In: Proceedings of the TwentyEighth Annual ACM Symposium on Theory of Computing, pp. 20–29. ACM, New York (1996)Google Scholar
 5.Assadi, S., Khanna, S., Li, Y., Yaroslavtsev, G.: Maximum matchings in dynamic graph streams and the simultaneous communication model. In: Proceedings of the TwentySeventh Annual ACMSIAM Symposium on Discrete Algorithms, SODA ’16, pp. 1345–1364. SIAM, Philadelphia (2016)Google Scholar
 6.Bhattacharya, S., Henzinger, M., Nanongkai, D., Tsourakakis, C.E.: Spaceand timeefficient algorithm for maintaining dense subgraphs on onepass dynamic streams. In: ACM Symposium on Theory of Computing (2015)Google Scholar
 7.Bury, M., Schwiegelshohn, C.: Sublinear estimation of weighted matchings in dynamic data streams. ESA (2015)Google Scholar
 8.Chazelle, B., Rubinfeld, R., Trevisan, L.: Approximating the minimum spanning tree weight in sublinear time. SIAM J. Comput. 34(6), 1370–1379 (2005)MathSciNetCrossRefzbMATHGoogle Scholar
 9.Chitnis, R., Cormode, G., Esfandiari, H., Hajiaghayi, M., McGregor, A., Monemizadeh, M., Vorotnikova, S.: Kernelization via sampling with applications to dynamic graph streams. SODA (2016)Google Scholar
 10.Chitnis, R., Cormode, G., Hajiaghayi, M., Monemizadeh, M.: Parameterized streaming: maximal matching and vertex cover. In: Proceedings of the TwentySixth Annual ACMSIAM Symposium on Discrete Algorithms, pp. 1234–1251. SIAM, Philadelphia (2015)Google Scholar
 11.Czumaj, A., Ergün, F., Fortnow, L., Magen, A., Newman, I., Rubinfeld, R., Sohler, C.: Approximating the weight of the euclidean minimum spanning tree in sublinear time. SIAM J. Comput. 35(1), 91–109 (2005)MathSciNetCrossRefzbMATHGoogle Scholar
 12.Czumaj, A., Monemizadeh, M., Onak, K., Sohler, C.: Planar graphs: random walks and bipartiteness testing. In: Foundations of Computer Science (FOCS), 2011 IEEE 52nd Annual Symposium on, pp. 423–432. IEEE (2011)Google Scholar
 13.Czumaj, A., Sohler, C.: Estimating the weight of metric minimum spanning trees in sublinear time. SIAM J. Comput. 39(3), 904–922 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
 14.Esfandiari, H., Hajiaghayi, M., Woodruff, D.P.: Brief announcement: applications of uniform sampling: densest subgraph and beyond. In: Proceedings of the 28th ACM Symposium on Parallelism in Algorithms and Architectures, SPAA 2016, pp. 397–399 (2016)Google Scholar
 15.Esfandiari, H., Hajiaghayi, M.T., Liaghat, V., Monemizadeh, M., Onak, K.: Streaming algorithms for estimating the matching size in planar graphs and beyond. In: Proceedings of the TwentySixth Annual ACMSIAM Symposium on Discrete Algorithms, pp. 1217–1233. SIAM, Philadelphia (2015)Google Scholar
 16.Fafianie, S., Kratsch, S.: Streaming kernelization. In: Mathematical Foundations of Computer Science 2014, pp. 275–286. Springer, Berlin (2014)Google Scholar
 17.Feigenbaum, J., Kannan, S., McGregor, A., Suri, S., Zhang, J.: On graph problems in a semistreaming model. Theor. Comput. Sci. 348(2), 207–216 (2005)MathSciNetCrossRefzbMATHGoogle Scholar
 18.Feigenbaum, J., Kannan, S., McGregor, A., Suri, S., Zhang, J.: Graph distances in the datastream model. SIAM J. Comput. 38(5), 1709–1727 (2008)MathSciNetCrossRefzbMATHGoogle Scholar
 19.Frahling, G., Indyk, P., Sohler, C.: Sampling in dynamic data streams and applications. In: Proceedings of the TwentyFirst Annual Symposium on Computational Geometry, pp. 142–149. ACM, New York (2005)Google Scholar
 20.Goldreich, O.: Introduction to testing graph properties. In: Property Testing, pp. 105–141. Springer, Berlin (2011)Google Scholar
 21.Goldreich, O., Goldwasser, S., Ron, D.: Property testing and its connection to learning and approximation. J. ACM 45(4), 653–750 (1998)MathSciNetCrossRefzbMATHGoogle Scholar
 22.Goldreich, O., Ron, D.: Property testing in bounded degree graphs. Algorithmica 32, 302–343 (2002)MathSciNetCrossRefzbMATHGoogle Scholar
 23.Guha, S., McGregor, A., Tench, D.: Vertex and hyperedge connectivity in dynamic graph streams. In: Proceedings of the 34th ACM Symposium on Principles of Database Systems, pp. 241–247. ACM, New York (2015)Google Scholar
 24.Henzinger, M.R., Raghavan, P., Rajagopalan, S.: Computing on data streams. In: External Memory Algorithms, Proceedings of a DIMACS Workshop, New Brunswick, New Jersey, USA, May 20–22, pp. 107–118 (1998)Google Scholar
 25.Jowhari, H.: Estimating the number of connected components in graph streams. Personal CommunicationGoogle Scholar
 26.Kapralov, M., Khanna, S., Sudan, M.: Approximating matching size from random streams. In: Proceedings of the TwentyFifth Annual ACMSIAM Symposium on Discrete Algorithms, pp. 734–751. SIAM, Philadelphia (2014)Google Scholar
 27.Kapralov, M., Khanna, S., Sudan, M.: Streaming lower bounds for approximating maxcut. In: Proceedings of the TwentySixth Annual ACMSIAM Symposium on Discrete Algorithms, pp. 1263–1282. SIAM, Philadelphia (2015)Google Scholar
 28.Kapralov, M., Lee, Y.T., Musco, C., Sidford, A.: Single pass spectral sparsification in dynamic streams. In: Foundations of Computer Science (FOCS), 2014 IEEE 55th Annual Symposium on, pp. 561–570. IEEE (2014)Google Scholar
 29.Kapralov, M., Woodruff, D.: Spanners and sparsifiers in dynamic streams. In: Proceedings of the 2014 ACM symposium on Principles of distributed computing, pp. 272–281. ACM, New York (2014)Google Scholar
 30.Kogan, D., Krauthgamer, R.: Sketching cuts in graphs and hypergraphs. In: Proceedings of the 2015 Conference on Innovations in Theoretical Computer Science, pp. 367–376. ACM, New York (2015)Google Scholar
 31.Konrad, C.: Maximum matching in turnstile streams. ESA (2015)Google Scholar
 32.McGregor, A.: Graph stream algorithms: a survey. ACM SIGMOD Rec. 43(1), 9–20 (2014)MathSciNetCrossRefGoogle Scholar
 33.McGregor, A., Tench, D., Vorotnikova, S., Vu, H.T.: Densest subgraph in dynamic graph streams. MFCS (2015)Google Scholar
 34.Muthukrishnan, S.: Data streams: algorithms and applications. Theor. Comput. Sci. 1(2), 117–236 (2005)MathSciNetzbMATHGoogle Scholar
 35.Orenstein, Y., Ron, D.: Testing eulerianity and connectivity in directed sparse graphs. Theor. Comput. Sci. 412(45), 6390–6408 (2011)MathSciNetCrossRefzbMATHGoogle Scholar
 36.Parnas, M., Ron, D.: Testing the diameter of graphs. Random Struct. Algorithms 20(2), 165–183 (2002)MathSciNetCrossRefzbMATHGoogle Scholar
 37.Peng, P., Sohler, C.: Estimating graph parameters from random order streams. In: Proceedings of the TwentyNinth Annual ACMSIAM Symposium on Discrete Algorithms, pp. 2449–2466. SIAM, Philadelphia (2018)Google Scholar
 38.Price, E.: Efficient sketches for the set query problem. In: Proceedings of the twentysecond annual ACMSIAM symposium on Discrete Algorithms, pp. 41–56. SIAM, Philadelphia (2011)Google Scholar
 39.Ron, D.: Algorithmic and analysis techniques in property testing: foundations and trends \(\textregistered \). Theor. Comput. Sci. 5(2), 73–205 (2010)Google Scholar
 40.Rubinfeld, R., Shapira, A.: Sublinear time algorithms. SIAM J. Discrete Math. 25(4), 1562–1588 (2011)MathSciNetCrossRefzbMATHGoogle Scholar
 41.Sun, X., Woodruff, D.P.: Tight bounds for graph problems in insertion streams. In: The 18th International Workshop on Approximation Algorithms for Combinatorial Optimization Problems (APPROX’2015) (2015)Google Scholar
 42.Verbin, E., Yu, W.: The streaming complexity of cycle counting, sorting by reversals, and other problems. In: Proceedings of the twentysecond annual ACMSIAM symposium on Discrete Algorithms, pp. 11–25. SIAM, Philadelphia (2011)Google Scholar
 43.Yoshida, Y., Ito, H.: Property testing on kvertexconnectivity of graphs. In: Automata, Languages and Programming, pp. 539–550. Springer, Berlin (2008)Google Scholar
Copyright information
Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.