Manuscript Offprint
arXiv:2610.21299Testing Connectedness and Edge Connectedness
Abstract
We revisit the classical problem of testing connectedness of graphs represented in the adjacency lists model and obtain optimal bounds. Specifically, we show that -testing connectedness of graphs with maximum degree at most requires queries (when ). Our result implies that the connectedness tester of Levi, Pallavoor, Raskhodnikova, and Varma (ACM Trans. Comput. Theory, 2022) is optimal. We also study the problem of testing -edge-connectedness of both directed and undirected graphs of average degree in the adjacency lists model and design a tester with query complexity , improving upon the bounds by Forster, Nanongkai, Saranurak, Yang, and Yingchareonthawornchai (SODA '20). Furthermore, we complement our upper bound by showing that every one-sided error -edge-connectedness tester must make queries.
1 Introduction
Edge connectedness is a fundamental graph property and is a measure of the fault tolerance of a network that the graph represents. For integer , an undirected (directed, respectively) graph is -edge-connected, or simply -connected, if at least edges must be removed from in order to make the graph disconnected (not strongly connected, respectively).
The problem of efficiently determining if a graph is k-connected has been studied under various computational models and is one of the earliest problems considered in graph property testing [GR02]. The goal of an -tester for k-edge-connectedness is to determine, with probability at least 2/3, whether a given graph is k-connected, or whether an fraction of the representation of G needs to be modified in order to obtain a k-connected graph. We consider graphs represented as adjacency lists and algorithms that access the graph via neighbor and degree queries. Formally, a neighbor query specifies a vertex and an integer i, upon which an oracle returns the i-th (out-)neighbor of u, if it exists. Similarly, a degree query specifies a vertex u, upon which an oracle returns the (out-)degree of u.
The conference version of this paper will appear at SOSA 2027.
The model. We work in the adjacency lists model for general graphs (also called the unbounded-degree incidence-lists model): a graph with m edges is -far from a property if at least edge modifications are needed to obtain a graph with the property, and, as in prior work on testing connectedness in this model [LPRV22, FNS 20], the algorithm knows the number of vertices n and the average degree (equivalently, m). This model differs from the bounded-degree model of Goldreich and Ron [GR02], in which the algorithm knows an upper bound d on all degrees, distance is measured relative to nd rather than m, and the modified graph must also respect the degree bound. In the general model, degrees can be highly non-uniform, and a tester has to adapt the amount of work it invests to the degrees of the vertices it samples. For directed graphs, we assume, as in [OR11, FNS 20], that both outgoing and incoming adjacency lists (and degrees) can be queried; if only outgoing lists can be queried, testing strong connectedness requires queries [BR02].
State of the art. For general , the best known testers are due to Forster, Nanongkai, Saranurak, Yang, and Yingchareonthawornchai [FNS20], for both directed and undirected graphs. In the general model, their testers make queries, and queries for simple directed graphs, even when is unknown [FNS20, Theorem 1.3]. When is known, as in our setting, their bounds are and , respectively [FNS20, Theorem 6.1]; these are never worse, since one may then assume . In the bounded-degree model, their testers make queries [FNS20, Theorem 1.4]. These bounds were an exponential improvement, in terms of the dependence on , over prior results [YI10, OR11]. For the important special case of undirected connectedness (), the best known tester has query complexity [LPRV22].
Our second contribution concerns testing -edge-connectedness. Building on a local subroutine of Forster, Nanongkai, Saranurak, Yang, and Yingchareonthawornchai [FNS20], we simplify their algorithm and obtain a tester with query complexity for both directed and undirected simple graphs (Theorems 4.1 and 4.11). In the model we study, where is known, the best previous bound for simple graphs is [FNS20, Theorem 6.1], so our bound is smaller by a factor of whenever . Moreover, the case , which our bounds do not explicitly address, is easy: for simple graphs, it suffices to check the degrees of uniformly random vertices (see Section B).
Finally, we complement this upper bound by proving that every one-sided error tester for k-edge-connectedness requires queries, for graphs of average degree and (Theorem 5.1).
1.2 Prior work
Goldreich and Ron [GR02] gave the first testers for edge and vertex connectedness in the bounded-degree model, initiating a long line of work on sublinear-time algorithms for connectedness-related properties. For general , the current state of the art is due to Forster, Nanongkai, Saranurak, Yang, and Yingchareonthawornchai [FNS20], who designed testers for both directed and undirected edge and vertex connectedness with queries in the bounded-degree model, and with the bounds stated above in the general model. Their work substantially improved the dependence on the connectedness parameter over previous algorithms [GR02, YI10, YI12, OR11].
For the special case of connectedness , Parnas and Ron [PR02] gave the first sublinear tester in the adjacency list model. This line of work was subsequently refined by Berman, Raskhodnikova, and Yaroslavtsev [BRY14] and culminated in the -query tester of Levi, Pallavoor, Raskhodnikova, and Varma [LPRV22].
1.3 Technical overview
Our lower bound for testing connectedness is based on a graph primitive, denoted , consisting of a cycle of supernodes, where each supernode is a d-clique with a pendant edge attached to all but two of its vertices. The key property of is that, to move from a supernode to the next one, a tester has to find the single edge leaving the supernode among adjacency list entries; hence exploring s supernodes costs queries in expectation, which is a constant fraction of the number of edges in the explored part of the graph. Our hard distributions consist of a connected instance formed by a single copy of (for the yes case), and disconnected instances formed by many smaller copies of (for the no case), where the size of the small cycles is chosen uniformly at random from a logarithmic range. The graph primitive prevents the tester from discovering a cycle with significantly fewer queries than its size, while the random choice of cycle size reflects the logarithmic factor from the work investment argument of [BRY14, LPRV22], yielding our lower bound.
Our tester for k-connectedness builds on the framework of . Specifically, we use their LocalEC subroutine and observe that, for the purpose of property testing, its volume and slack parameters can be merged into a single parameter. Combined with the work investment strategy and a separate treatment of vertices of degree less than k, this simplification leads to both a cleaner analysis and an improved query complexity.
Finally, our one-sided error lower bound for testing k-connectedness is inspired by the connectedness lower bound. Here, we consider a single cycle size and modify the supernode construction so that every component is itself k-connected. A one-sided error tester can reject only if the answers to its queries are inconsistent with every k-connected graph. We show that, unless the tester makes queries, the edges it has not seen can be rewired so as to make the graph k-connected without changing any of the answers, leading to the desired lower bound.
2 Preliminaries
Throughout the paper, all graphs are simple, and log denotes the logarithm to base 2. For an integer , we write . We assume that the number of vertices and the average degree of the input graph are known to the algorithm; for an undirected graph , we have , and for a directed graph, is the average out-degree. Graphs are represented in the adjacency list model, where the algorithm may make degree and neighbor queries. For directed graphs, we assume access to both incoming and outgoing degree and neighbor queries.
The distance of a graph from k-edge-connectedness is measured by the number of edge modifications (insertions and deletions) required to obtain a k-edge-connected graph. Specifically, an undirected graph is -far from k-edge-connectedness if at least edge modifications are required to make k-edge-connected. The definition for directed graphs is analogous.
For a directed graph and , let denote the set of edges from to , and let and . For a vertex , we write and for its out- and in-degree, and we let denote the out-volume of . A directed graph is -edge-connected if and only if for every set with ; an undirected graph is -edge-connected if and only if at least edges cross every such cut .
Definition 2.1 (Tester for k-connectedness). A randomized algorithm A is an -tester for k-edge-connectedness if, given query access to a graph G, it satisfies the following:
-
if is -edge-connected, then accepts ;
-
if is -far from -edge-connectedness, then rejects .
A tester has one-sided error if it always accepts k-edge-connected graphs.
Our upper bounds are stated for the interesting range , in which .
3 Lower bound for testing connectedness
In this section, we prove a lower bound for testing connectedness of graphs that are represented as adjacency lists. Our lower bound implies that the connectedness tester of Levi et al. [LPRV22] has optimal query complexity when . A tester is allowed to make both neighbor queries and degree queries.
Theorem 3.1. For and , every algorithm that -tests connectedness on graphs of average degree in the adjacency list model with degree and neighbor queries requires queries for sufficiently large inputs .
Proof. We use Yao's minimax principle [Yao77] as stated by [RS06].
Theorem 3.2 (Yao's minimax principle, the version from [RS06]). To prove a lower bound q on the worst-case query complexity of a randomized algorithm, it is enough to give two distributions on inputs:
• on positive instances, and
• on negative instances
For larger , all our upper bounds hold with replaced by 1.
Our constructions work for ; we have not optimized this.
such that it is hard for any q-query deterministic algorithm A to distinguish from . Let be the answers to the queries on input G. Define -view to be the distribution on the subgraphs of G induced by when G is selected according to . Similarly, define -view. By “hard to distinguish from ”, we mean SD ( -view, -view) , where SD denotes the statistical distance between two distributions.
Specifically, we construct distributions and over -vertex graphs that are connected and -far from connected, respectively, such that every deterministic algorithm that makes at most queries, for a sufficiently small constant , fails to distinguish the two distributions with high probability.
Graph primitives. We use the following graph primitives for our constructions.
Definition 3.3 (Graph ). The spider graph , parameterized by degree , where , has 2d - 2 vertices, partitioned into sets and . The first vertices, called internal, form a -clique, and there is an exit edge between and for all . Vertices are called leaves; vertices and are called the source and terminal, respectively.
Definition 3.4 (Graph ). Let be such that is a multiple of . The graph is a cycle consisting of supernodes, where each supernode is a copy of the spider graph , with the source of one supernode adjacent to the terminal of the next (see Figure 1b). The edge between the terminal of one supernode and the source of the next one is also called an exit edge, and the source and the terminal of a supernode are called its ports.
The graph has vertices, out of which internal vertices have degree each and leaves have degree 1 each. So the maximum degree is , the average degree is , and the number of edges is . We will prove a query lower bound of for average degree . This suffices because substituting does not change the asymptotic bound.
Hard distributions. Let and . For , let and , so that has supernodes. Let . Distribution first chooses uniformly at random from , and returns a uniformly random isomorphism of a graph consisting of
• t connected components isomorphic to , called small cycles, and
• one connected component isomorphic to , called the large cycle.
Distribution outputs a uniformly random isomorphism of . In both distributions, the order of every adjacency list is an independent, uniformly random permutation.
Every graph in is connected, and every graph in is -far from connected, since it has connected components, so at least edges must be added to connect it. We will show that cannot distinguish these two distributions.
Let denote the number of supernodes. Since , we have , and hence .

(a) The spider graph .

(b) The graph , with 8 supernodes.
Figure 1: The graph primitives used in the proof of Theorem 3.1. The ports of each supernode (its source and terminal) are green, the other internal vertices are white, and the leaves are light gray. Exit edges between an internal vertex and a leaf are red, exit edges between the ports of consecutive supernodes are blue, and the edges of the d-cliques are gray.
Views of the algorithm. We make the following simplifying assumption on the view of the algorithm A: whenever a vertex of a supernode appears in the view for the first time, the labels of all d internal vertices of the supernode are revealed to A, and if this vertex is a leaf, then its unique neighbor is revealed as well. The positions of the vertices in the adjacency lists are not revealed. A vertex is discovered if it has appeared in the view, and a supernode is discovered if at least one of its vertices has appeared in the view. A query is fresh if it is made to a vertex that is not discovered. We consider two discovered supernodes adjacent if an exit edge between them has been revealed, and define the connected components of the view accordingly.
We say that A resolves an internal vertex w when it queries the adjacency list of w at the position of the exit edge of w. If w is a port, then resolving w reveals a vertex of the neighboring supernode; we call this an extension. Since all internal vertices of a discovered supernode are known, the only way for A to reach a new supernode is a fresh query or an extension.
The idealized process and the coupling. We compare both distributions to the following process I, which answers the queries of A as if the input consisted of infinitely many supernodes such that no two explored parts are ever connected. Whenever a supernode has to be revealed, because of a fresh query or an extension, I creates a new supernode: its internal vertices receive distinct labels chosen uniformly at random among the labels that are not discovered. Note that the run of I does not depend on , , or .
For , let denote the process that answers the queries of on , where
G is sampled lazily. Since G is a uniformly random isomorphism of a fixed graph, in a fresh query of the queried vertex is uniformly distributed among the undiscovered vertices of G. Such a vertex is either a leaf of a discovered supernode (we call this a collision), or a uniformly random vertex of an undiscovered supernode X. In the latter case, and also when an extension of reaches an undiscovered supernode, the new supernode is revealed exactly as in I. Therefore, we can couple with I as follows. We run I and, in parallel, sample G lazily: we sample if . Whenever I creates a new connected component of the view by a fresh query, first decide whether this query results in a collision in . If not, choose the undiscovered supernode X of G to which the new supernode of I is mapped; and every extension of I is mapped to the corresponding neighboring supernode in G. Under this coupling, and I give identical answers until the first query at which a collision occurs or an extension of reaches a supernode that is already discovered. Note that and the supernodes of G at which the connected components of the view start are chosen using randomness that is independent of the run of I.
Bad events. We now define the bad events. The first and second are events of the coupled process for , and together they describe the first query at which and give different answers; the third is an event of the run of only.
Merge ( ): Before SmallCycle occurs, a fresh query of results in a collision, or an extension of reaches a discovered supernode in a different connected component of the view (that is, two components of the view merge).
SmallCycle ( ): Before Merge occurs, an extension of reaches a discovered supernode in the same connected component of the view (that is, the algorithm discovers a cycle of supernodes).
CheapExplore (C): During the run of I, the total number of extensions is at least , for a sufficiently small constant . Since a connected component of the view of I with s supernodes is discovered using extensions, this means that the algorithm discovers connected components with supernodes while making at most queries.
Indistinguishability assuming no bad events. By the coupling, the views of under and under are identical unless occurs. Recall that if two random variables can be coupled so that they are equal except on an event of probability , then their statistical distance is at most . Hence for both , where denotes the view of under . Note that never occurs, since closing the only cycle of supernodes of a graph from requires extensions. For the same reason, can occur only on a small cycle, as the large cycle has more than supernodes.
Probability of bad events. Now it remains to bound the probability of the bad events.
Lemma 3.5. For both , we have .
Proof. At any point during the execution, at most supernodes and at most vertices are discovered, since each query reveals at most one new supernode and at most one leaf.
Collisions. In a fresh query, the queried vertex is uniform among at least undiscovered vertices, of which at most are leaves of discovered supernodes. By a union bound over at most fresh queries, a collision occurs with probability at most .
Merges through extensions. Consider a fresh query that reveals a new supernode X, which is uniform among at least undiscovered supernodes. Each extension moves one step along a cycle, and makes at most extensions, so the component of X can later run into an earlier component only if X is within distance of a supernode discovered before X. At most supernodes are discovered before X, and at most supernodes are within distance of them, so this happens with probability at most . Charging each merge to the fresh query that started the later of the two components, a union bound over at most fresh queries shows that two components merge with probability at most , where we used .
Summing these for large enough n, we get .
Lemma 3.6. .
Proof. We first compute the expected number of extensions. Call an internal vertex of a discovered supernode X a candidate if A does not yet know whether it is a port. When X is discovered, it has at least candidates, at most two of which are ports. The exit edge of an internal vertex is uniform among its neighbors, so if neighbors of have been queried, the next query resolves with probability . The ports are also uniform among the internal vertices of X, so if candidates have been resolved, the next resolved candidate is a port with probability at most . An extension is a query that resolves a candidate that is a port. We split the extensions according to the state at the time of the query.
-
Cheap extensions, with and . Each query is a cheap extension with probability at most , so the expected number of cheap extensions is at most .
-
Extensions at heavily queried vertices, with and . At most vertices receive more than queries, and each of them is resolved at most once, as a port with probability at most . So the expected number of these extensions is at most .
-
Extensions in heavily explored supernodes, with . Split the total number of resolutions to vertices which have at most neighbors queried, and those without. The expected number of resolutions with few queries is at most , and the resolutions with a lot of queries can be bounded above by . Thus the expected total number of resolutions is at most , so by the law of total expectation, the expected number of supernodes with at least resolved candidates is at most . Each has at most two extensions, so the expected number of these extensions is at most .
The expected number of extensions is thus at most , and by Markov's inequality, .
Lemma 3.7. , and thus .
Proof. We first bound the probability that a component in the view starts (upon discovering a fresh supernode ) on a small cycle. Fix , and condition on , on the run of , and on the choices made for the components created before component . The supernode is uniformly distributed among at least undiscovered supernodes, of which at most lie on small cycles. The probability that lies on a small cycle is at most
Importantly, this bound holds for every fixed run of , because the coupling chooses and independent to the run of . In particular, we never need to analyze how the choices of depend on : the view under does not depend on at all. Next, we condition on . This is an event of the run of , so it does not change the distribution of or of the .
For each component i in the view, let denote the number of extensions in that component. Taking a union bound over all components and averaging over the choice of , which is uniform over the L elements of J, we get
For each component , the inner sum is over cycle sizes that component is long enough to traverse. By definition, , so
Conditioned on , we have . Therefore,
□
Completing the proof. By the triangle inequality and Theorems 3.5 and 3.7,
By Yao’s principle, every -tester for connectedness of the graphs in our distributions makes more than queries. Because , we get , so . Moreover, and give . Hence .
4 k-Connectedness Tester
In this section, we present our tester for k-connectedness. We first consider the directed setting, where we instantiate the local subroutine of with parameters tailored to our application, yielding an improved query complexity. We then show a reduction from testing undirected k-connectedness to testing directed k-connectedness, allowing us to obtain the desired bounds in the undirected setting.
4.1 Directed k-Connectedness Tester
In this section, we prove the following upper bound for testing k-connectedness of directed graphs.
Theorem 4.1. There exists a one-sided error -tester for k-edge-connectedness of simple directed graphs that makes queries (with access to both incoming and outgoing adjacency lists). Its running time is if the input graph has edges, and otherwise.
We use the following characterization of graphs that are far from being k-connected.
Fact 4.2 ([OR11, Corollary 8]). A directed graph is -far from being k-edge-connected if and only if there exists a family of disjoint non-empty proper subsets satisfying or .
Note that the sets with can be removed from without decreasing the first sum (and similarly for the second sum).
We use a local algorithm of as a subroutine. The following lemma is a corollary of , but we include a proof in Section A for completeness. Specifically, required four parameters for their algorithm, but by a careful analysis, we merge two of them.
Lemma 4.3. There is an algorithm LocalEC that takes as inputs
- a vertex v of an m-edge directed graph , accessed via out-degree and out-neighbor queries,
• a cut-size parameter , and
• a volume-slack ratio parameter , where .
It makes queries, runs in time, and outputs either or a set with and . Moreover, if there exist and a vertex set such that , , and , then LocalEC outputs a set (rather than ) with probability at least 3/4.
We also use the following lemma of Berman, Raskhodnikova, and Yaroslavtsev [BRY14], which underlies their work investment strategy.
Lemma 4.4 ([BRY14, Lemma 2.3]). Let be a random variable that takes values in . Suppose , let , and let . For all , let and . Then .
We now describe our tester. Let , where is known to the algorithm.
Proof of Theorem 4.1. One-sided error. If is -edge-connected, then every vertex has out-degree and in-degree at least , so , and every set with satisfies and (note that is the out-degree of in ). Hence Step 1 does not reject, Step 2 accepts if it applies, no sampled vertex has out-degree less than in , and, by Theorem 4.3, LocalEC never returns a set. Thus, Algorithm 1 always accepts graphs that are -connected.
Rejection of far graphs. Consider a graph that is -far from -connected. If Step 1 or Step 2 applies, then the algorithm rejects with probability 1. So assume that and ; in particular, . By Theorem 4.2, and since the algorithm handles both and (where ), we may assume without loss of generality that there exists a family of pairwise disjoint nonempty proper subsets of such that , and consider the iteration of Step 3 with . Fix such a family , and remove from it all sets with .
Algorithm 1 Directed k-Connectedness Tester
Input: , , , , oracle access to a simple directed graph via in- and out-degree and neighbor queries
1: if then reject
2: if then query all out-adjacency lists of ; reject if is not -edge-connected, and accept otherwise
3: for , where is with all edges reversed do
4: repeat times: Sample uniformly at random; reject if
5: for to do
6: repeat times:
7: Sample uniformly at random and query ; reject if
8: Run LocalEC(, ) on and reject if it returns a set
9: Accept
Definition 4.5 (Slack). For a set , the slack of is .
For each , the slack satisfies , and . We partition into three parts. Let be the set of low-degree vertices, and let
• ,
• , and
• .
Since the sets in are disjoint, . Hence , and one of the following two cases holds.
Case 1: . Since , we have , and since the sets in are disjoint and each of them contains a low-degree vertex, . So each vertex sampled in Step 4 is a low-degree vertex with probability at least , and the algorithm fails to reject in this step with probability at most .
Case 2: . We define the k-quality of the vertices with respect to .
Definition 4.6 (k-quality). For a vertex , its k-quality, denoted by , is defined as
This is well defined, because every vertex of has , so .
Claim 4.7. For every vertex , we have . Moreover, .
Proof. Let , , and , so that . Every vertex of has out-degree at least , and at most of its out-edges stay inside . So every vertex of has at least out-edges leaving , and . If , then , a contradiction. Thus . Fix . Each out-edge of goes to one of the other vertices of or leaves , so . Together with , we get
where the second inequality holds because is increasing in for , and .
Now, for every . Since the sets are disjoint,
and the bound on follows.
Let be the random variable denoting the -quality of a vertex sampled in Step 7. By Theorem 4.7, takes values in and , and the parameters in Steps 5–6 are exactly and . Hence, by Theorem 4.4 with , with probability at least , there is an such that Algorithm 1 samples a vertex with in iteration . Fix such and . Since , there is a set with , and satisfies . Moreover, , so the algorithm runs LocalEC with . By definition of , we have and also , so , meaning . By Theorem 4.3, LocalEC returns a set, and the algorithm rejects, with probability at least . So in Case 2, the algorithm rejects with probability at least .
Query complexity and running time. Step 1 makes no queries. If Step 2 applies, then , and since , we have . So reading all adjacency lists takes queries. Moreover, is -edge-connected if and only if, for a fixed vertex and every other vertex , there are edge-disjoint paths from to and from to . This can be checked with at most augmenting path computations for each of the pairs, in time , using . Otherwise, Step 4 makes queries, since . By Theorem 4.3, for a vertex sampled in iteration , LocalEC makes queries and runs in time. A uniformly random vertex has expected out-degree , both in and in . Since , , and , the expected query complexity of Steps 5–8 is at most
By a similar calculation, the expected running time is .
The tester claimed in Theorem 4.1 is obtained by running Algorithm 1, halting and accepting if the number of queries or the running time exceeds 50 times the corresponding bound on its expectation established above. This modification preserves one-sided error. By Markov's inequality and a union bound, the algorithm is halted with probability at most . In both cases above, the unmodified algorithm accepts an -far graph with probability at most , so the modified algorithm accepts it with probability at most . This completes the proof of Theorem 4.1.
4.2 Undirected k-Connectedness Tester
We first show how to reduce undirected k-connectedness testing to directed k-connectedness testing, and then use Theorem 4.1 to derive a tester for undirected graphs.
Definition 4.8 (Reduction). Given an undirected graph , define its directed version by replacing each edge with two directed edges and .
Note that, for every , the edges of from to are in one-to-one correspondence with the edges of between and .
Lemma 4.9 (Reduction completeness). If an undirected graph G is k-connected, then its directed version is also k-connected.
Proof. We prove the contrapositive. If is not k-connected, then there is a set with such that fewer than edges of go from to . By the correspondence above, fewer than edges of cross the cut , and removing them disconnects . So is not k-connected.
Lemma 4.10 (Reduction soundness). If an undirected graph G is -far from being k-connected, then its directed version is -far from being k-connected.
Proof. Let be a k-connected directed graph that is obtained from with edge modifications, and let be the set of edges of that are not edges of , so that . The graph obtained by adding to contains , so it is also k-connected. Let be the graph obtained from by inserting the edge for every pair such that or ; this inserts at most edges, none of which belongs to . For every set with , distinct edges of or of going from to correspond to distinct edges of crossing the cut . Hence at least edges of cross this cut, and is k-connected. Since is -far from k-connected, . So is -far from being k-connected.
We are now ready to state our final tester for k-connectedness of undirected graphs.
Theorem 4.11. There exists a one-sided error -tester for k-edge-connectedness of simple undirected graphs with average degree that makes queries. Its running time is if the input graph has at least edges, and otherwise.
Proof. Given an undirected graph G, run the tester from Theorem 4.1 on with parameter . Each query to (to an incoming or outgoing adjacency list or degree) can be answered with one query to G, and has the same average degree as G and twice as many edges, so the query and time complexities follow from Theorem 4.1. If G is k-connected, then is k-connected by Theorem 4.9, so the tester always accepts. If G is -far from k-connected, then, by Theorem 4.10, is -far from k-connected, so the tester rejects with probability at least 2/3.
5 One-sided error lower bound for k-connectedness testing
We prove the following lower bound for one-sided error testers of k-edge-connectedness.
Theorem 5.1. Let and be integers, let , and let be a multiple of . Every one-sided error -tester for -edge-connectedness of -vertex undirected graphs with average degree , in the adjacency list model with degree and neighbor queries, makes at least queries on some input.
This is consistent with the upper bound of for simple graphs in the bounded-degree model, since our assumptions imply , and therefore .
Proof of Theorem 5.1. Let , and note that .
Graph primitives. We use the following graph primitives for our construction.
Definition 5.2 ( ). The graph has vertices labeled . It is obtained from the -clique on these vertices by removing the edges of the matching .
Definition 5.3 ( ). For an integer , the graph is a cycle consisting of supernodes, indexed by , where each supernode is a copy of . For every and , vertex of supernode is joined by an edge to vertex of supernode . The edges of the copies of are called internal edges.
In , the vertices have degree , and all other vertices have degree . Each of the vertices of a supernode is incident to exactly one edge between supernodes, so is a simple -regular graph with vertices.
Claim 5.4. The graph is k-connected. Moreover, a graph obtained by removing at most one internal edge from each supernode of is also k-connected.
Proof. Consider a cut of that separates two vertices of some supernode , and let , where . Exactly edges of the -clique on cross the cut. At most of them belong to the removed matching, and at most one more was removed from to obtain . If , then at least internal edges of cross the cut. Otherwise, , and at least internal edges of cross the cut.
Now consider a cut that separates two supernodes, but no two vertices of the same supernode. Then and are unions of supernodes. Since the supernodes are arranged in a cycle, there are at least two indices such that supernodes and are on different sides of the cut. For each such , the edges between supernodes and cross the cut. So at least edges cross the cut. Thus and subsequently is -connected.
Hard instance. Let and . Let be the graph consisting of connected components isomorphic to , called small components, and one connected component isomorphic to , called the large component, where . Thus is a simple -regular graph with vertices and edges, and by Theorem 5.4, each of its components is -connected. The graph itself is -far from being -connected, because it has connected components.

(a) The supernode .

(b) The graph , with 8 supernodes.
Figure 2: The graph primitives used in the proof of Theorem 5.1, for and , so that . The vertices of each supernode (green) are incident to the edges between supernodes (blue); the other vertices are white, the edges of the -cliques are gray, and the removed matching edges are dashed red. In (a), the dashed blue stubs indicate the edges to the neighboring supernodes: the odd vertices 1 and 3 are adjacent to the next supernode , and the even vertices 2 and 4 to the previous supernode .
Query lower bound. Let A be a one-sided error -tester for k-connectedness, and fix its random coins. Suppose that, on input G, A makes fewer than queries. We say that an edge is seen if A queried the position of w in the adjacency list of u or the position of u in the adjacency list of w. We will construct a k-connected n-vertex graph with the same degrees as G, on which every query of A receives the same answer as on G. Then A (with these coins) behaves identically on G and on , and since it must accept , it accepts G. If this were the case for every choice of coins, then A would accept G with probability 1, contradicting the fact that G is -far from k-connected.
A supernode is exhausted if all of its internal edges are seen. Each supernode has internal edges, since . So fewer than supernodes are exhausted. Since every component has at least supernodes, there are more than
non-exhausted supernodes in every component, that is, at least 2h of them.
Constructing . Order the components of cyclically as , with indices modulo . In every component , choose 2h non-exhausted supernodes and, in each of them, one unseen internal edge. Assign of the chosen edges of to the pair and the other edges to the pair . For every and every , take the -th unseen edge of assigned to the pair and the -th unseen edge of assigned to the same pair, and replace them by the edges and . Let be the resulting graph.

(a) A single swap.

(b) All swaps, for r = 3.
Figure 3: The repair procedure in the proof of Theorem 5.1, for , so that . (a) Unseen internal edges of a supernode of and of a supernode of (red) are replaced by the edges and (blue); all degrees and all queried positions are unchanged. (b) The components are arranged in a cycle, and swaps are performed between every two consecutive components, creating new edges between them.
It remains to show that is k-connected. Consider a cut of . For each component , the graph contains a copy of or on the vertices of , with at most one internal edge removed from each supernode. If the cut separates two vertices of the same component, then at least k edges cross it, by Theorem 5.4 applied to this subgraph. Otherwise, A and B are unions of components of G. Since the components are arranged in a cycle, there are at least two indices j such that and are on different sides of the cut, and for each such j, the h new edges created for the pair cross the cut. So at least edges cross the cut. Therefore, is k-connected, which completes the proof.
References
[BR02] Michael A. Bender and Dana Ron. Testing properties of directed graphs: acyclicity and connectivity. Random Struct. Algorithms, 20(2):184–205, 2002.
[BRY14] Piotr Berman, Sofya Raskhodnikova, and Grigory Yaroslavtsev. -testing. In Symposium on Theory of Computing, STOC 2014, New York, NY, USA, May 31 - June 03, 2014, pages 164–173, 2014.
[FNS 20] Sebastian Forster, Danupon Nanongkai, Thatchaphol Saranurak, Liu Yang, and Sorrachai Yingchareonthawornchai. Computing and testing small connectivity in near-linear time and queries via fast local cut algorithms. In Shuchi Chawla, editor, Proceedings of ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2046–2065. SIAM, 2020.
[GR02] Oded Goldreich and Dana Ron. Property testing in bounded degree graphs. Algorithmica, 32(2):302–343, 2002.
[LPRV22] Amit Levi, Ramesh Krishnan S. Pallavoor, Sofya Raskhodnikova, and Nithin Varma. Erasure-resilient sublinear-time graph algorithms. ACM Trans. Comput. Theory, 14(1):1:1–1:22, 2022.
[OR11] Yaron Orenstein and Dana Ron. Testing eulerianity and connectivity in directed sparse graphs. Theor. Comput. Sci., 412(45):6390–6408, 2011.
[PR02] Michal Parnas and Dana Ron. Testing the diameter of graphs. Random Struct. Algorithms, 20(2):165–183, 2002.
[RS06] Sofya Raskhodnikova and Adam D. Smith. A note on adaptivity in testing properties of bounded degree graphs. Electronic Colloquium on Computational Complexity (ECCC), 13(089), 2006.
[Yao77] Andrew Chi-Chih Yao. Probabilistic computations: Toward a unified measure of complexity (extended abstract). In Proceedings of IEEE Symposium on Foundations of Computer Science (FOCS), pages 222–227, 1977.
[YI10] Yuichi Yoshida and Hiro Ito. Testing k-edge-connectivity of digraphs. J. Syst. Sci. Complex., 23(1):91–101, 2010.
[YI12] Yuichi Yoshida and Hiro Ito. Property testing on k-vertex-connectivity of graphs. Algorithmica, 62(3-4):701–712, 2012.
A Proof of Theorem 4.3
The algorithm, given as Algorithm 2, is the algorithm of , Algorithm 1] with the parameters used for Theorem 4.3. It repeatedly grows a depth-first search (DFS) tree from v, stops it at a random point, and reverses the edges on the path from v to the vertex at which it stopped. An edge is marked when it is explored for the first time, and it stays marked (even after being reversed).
Algorithm 2 LocalEC(v, k, ), adapted from [FNS 20, Algorithm 1]
Input: vertex v; integer ; real with
1:
2: repeat k times:
3:
4: Grow a DFS tree T of the vertices reachable from v in the current graph, as follows:
5: while the DFS has an edge to explore do
6: if e is not marked then
7: Mark e
8: if at least edges are marked then return
9: With probability , set and stop the DFS
10: if then return
11: Reverse the direction of every edge on the path from v to y in T
12: return
We use the following observation (see [FNS 20, Lemma 3.5]).
Lemma A.1. Let with , and let be a path from to a vertex . Reversing all edges of decreases by exactly one if , and does not change if .
Proof. Each edge of that crosses the cut goes either from to or from to . Since starts in , the number of crossings of the first type exceeds the number of crossings of the second type by one if , and the two numbers are equal if . Reversing swaps the two types.
Proof of Theorem 4.3. Complexity. At most edges are marked. Each marked edge is obtained with one out-neighbor query, and each vertex visited by the DFS requires one out-degree query. Since every visited vertex other than v is the head of a marked edge, the algorithm makes queries. Reversed edges are marked, so their current direction is known to the algorithm without further queries. As shown in [FNS 20, Lemma 3.4], with suitable data structures, each of the k iterations takes time linear in the number of marked edges, so the running time is .
Output. Suppose that the algorithm returns in Line 10 of iteration . Then , and no edge leaves in the current graph. All out-edges of vertices of in the current graph were explored by the DFS and are thus marked. Fewer than edges are marked, and , so the vertices of have fewer than out-edges in total, and therefore . Before iteration , exactly paths starting at were reversed. By Theorem A.1, each of them decreased by at most one, so in the original graph.
Success probability. Suppose that there exist and with and . The algorithm returns only in one of the following two ways.
First, it may reach the budget in Line 8. Every newly marked edge, except the one that reaches the budget, triggers an independent coin flip with success probability , and every success ends an iteration. Thus, Line 8 is reached only if fewer than of the first coin flips succeed, that is, only if the number of coin flips needed for successes is at least . Since , by Markov's inequality, this happens with probability at most .
Second, it may complete all iterations, setting in each of them, and return in Line 12. Let be the number of iterations in which is set to a vertex of . By Theorem A.1, each iteration in which decreases by one. Moreover, once in the current graph, no vertex outside is reachable from , so in all later iterations. Hence, at most iterations have , and returning in Line 12 implies . Now, is set to a vertex of only when the coin flip of a newly marked edge with succeeds. A newly marked edge has never been reversed, since only marked edges are reversed, so is one of the out-edges of vertices of in the original graph. Each edge is newly marked at most once, so , and by Markov's inequality, .
Therefore, the algorithm returns with probability at most .
B Testing when is large
In this section, we show that testing k-edge-connectedness of simple graphs is easy when is at least a sufficiently large constant: it suffices to check the degrees of a few random vertices.
Lemma B.1. The following algorithm is a one-sided error -tester for k-edge-connectedness of simple directed graphs with average degree : sample vertices uniformly at random, and reject if and only if one of them has out-degree or in-degree less than k. It makes queries. For simple undirected graphs with , the same algorithm works with .
Proof. If G is k-edge-connected, every vertex has out- and in-degree at least k, so the algorithm always accepts.
Now let be a simple directed graph with edges that is -far from -edge-connected. By Theorem 4.2, there is a family of pairwise disjoint nonempty proper subsets of such that or . Since the algorithm checks both out- and in-degrees, we assume the former holds wlog. Remove from all sets with . As shown in the proof of Theorem 4.7, every set in whose vertices all have out-degree at least has at least vertices. Since the sets in are disjoint, there are at most such sets, and they contribute at most to the sum, where the last inequality follows from and . Therefore, the remaining sets contribute more than to the sum. Each of them contributes at most and contains a vertex of out-degree less than , so more than vertices have out-degree less than . Hence, the probability that all sampled vertices have out-degree at least is at most , and the algorithm rejects with probability at least . The algorithm makes degree queries.
For a simple undirected graph with , consider its directed version , which is simple, has average out-degree , and in which the out- and in-degree of every vertex equal its degree in . Running the directed algorithm on with parameter , which satisfies , gives exactly the undirected algorithm, and its correctness follows from Theorems 4.9 and 4.10.