Testing -Freeness in Bounded Admissibility Graphs
Abstract
We study -freeness in sparse graphs from a property testing perspective, specifically for graph classes with bounded -admissibility. Our work is motivated by the large gap between upper and lower bounds in this area: -freeness is known to be testable in planar graphs [4], but not in graphs with bounded arboricity for [7]. There are a large number of interesting graph classes that include planar graphs and have bounded arboricity (e.g. classes excluding a minor), calling for a more fine-grained approach to the question of testing -freeness in sparse graph classes.
One such approach, inspired by the work of Nesetril and Ossona de Mendez [11], is to consider the graph measure of -admissibility, which naturally forms a hierarchy of graph families where contains all graph classes whose -admissibility is bounded by some constant. The family contains classes with bounded arboricity, the class contains classes like planar graphs, graphs of bounded degree, and minor-free graphs. Awofeso et al. [3] recently made progress in this direction. They showed that - and -freeness is testable in . They further showed that -freeness is not testable in and conjectured that -freeness is testable in . In this work, we prove this conjecture: -freeness is indeed testable in graphs of bounded -admissibility.
Keywords and phrases:
Property Testing, Sparse Graphs, Cycle, AdmissibilityCategory:
Track A: Algorithms, Complexity and GamesCopyright and License:
![[Uncaptioned image]](x1.png)
2012 ACM Subject Classification:
Theory of computation Streaming, sublinear and near linear time algorithmsEditors:
Keren Censor-Hillel, Fabrizio Grandoni, Joël Ouaknine, and Gabriele PuppisSeries and Publisher:

1 Introduction
Finding a -cycle () as a subgraph is a fundamental problem in graph theory with applications in network analysis, bioinformatics, and theoretical computer science. Given a graph , the goal is to detect cycles of exactly vertices. Various algorithmic approaches have been proposed, including combinatorial search techniques [9], matrix-based methods using spectral graph theory [2], and more recent advancements leveraging graph sparsification and algebraic techniques [12, 5].
In this paper, the focus is on a variation of this problem, where access to the input algorithm is through an oracle that answers queries of the sort: “What is the degree of vertex ?”, “What is the -th neighbour of the vertex ?”, and “are the vertices and neighbours?”. The goal in this variation is to determine whether a graph is -free (it does not have a subgraph isomorphic to ), given the size of the input graph and oracle access to the graph, using the minimal possible number of queries.
A deterministic algorithm of this type, for determining whether a graph is -free, may require a number of queries that is at least linear in the size of the graph. Therefore, to reduce the number of queries, an alternative approach is to require the algorithm only to distinguish between graphs that are -free and those that are far from being -free, which means that they require the removal of many edges to become -free. The algorithm is also allowed to be probabilistic and is only required to produce the correct answer with high probability. Observe that if the algorithm is required to be error-free when the input graph is -free (as is the case with the algorithm presented here), it must explicitly identify a subgraph to conclude that the graph is not -free, essentially solving the detection problem for inputs that are far from being -free.
This relaxation of requirements is captured by the framework of property testing. In this framework, the problem described above is referred to as testing -freeness. A central goal is to show that the number of queries required for testing -freeness, when the input is restricted to graphs from a specific family, is independent of the size of the input graph, yet may depend on the parameters of the class and the distance parameter (which is a fixed parameter provided with the input) that governs the ‘farness‘ of the input from -freeness. If such an algorithm exists for some family of graphs, then we say that -freeness is testable for this family.
The results in this work focus on testing -freeness for sparse graph families, specifically those with a bounded average degree. This line of research was initiated in the seminal work of Goldriech and Ron [8] who showed that the query complexity of testing -freeness in graphs with maximum degree is . Although that result was promising, Alon et al. [1] later showed that the query complexity testing triangle-freeness (-freeness) in graphs with constant average degree is , where is the number of vertices in the input graph.
This raised the question of whether -freeness has a better query complexity in families of graphs that are strict subsets of graphs with a bounded average degree. Czumaj et al. [4] showed that the more general property of -freeness (i.e. graphs that don’t have a subgraph isomorphic to ) is testable in planar graphs, which implies that -freeness is also testable in this setting. Subsequently, Levi [10] showed that the special case of triangle-freeness is testable for graphs with bounded arboricity, a superset of planar graphs. However, Eden et al. [7] recently showed that this does not extend to larger cycles: testing -freeness and -freeness has query complexity in graphs of bounded arboricity, and testing -freeness for has query complexity . This left open the question of which (strict) subsets of classes with bounded arboricity still allow testing of -freeness.
Awofeso et al. [3] recently presented results in this direction. They considered a hierarchy of sparse graph classes defined by the -admissibility measure, which was first introduced by Dvořák [6] and plays an important role in the study of sparse classes [11, 14]. We postpone the rather technical definition to the next section; for now let us note that graphs of bounded -admissibility are equivalent to graphs of bounded arboricity, and graphs whose -admissibility is bounded for any integer include many well-known sparse classes such as planar graphs, graphs with bounded genus, graphs of bounded degree and graphs excluding a (topological) minor. Consequently, if we define as the family of all graph classes whose -admissibility is bounded by some constant, then we have an infinite hierarchy of classes between graphs of bounded arboricity () and classes whose -admissibility is bounded for any value of (, also known as bounded expansion classes [11]). Note that all these inclusions are proper, for example, the class consisting of all cliques with every edge is replaced with a length path, is contained in but not in .
In this hierarchy, Awofeso et al. [3] showed that testing - and -freeness is possible in , the graphs with bounded -admissibility. They supplement this with a lower bound, which shows that for all the number of queries required for -freeness testing and -freeness testing of classes in is polynomial in the size of the input graph. The two results lead them to conjecture that - and -freeness should be testable for classes in , i.e. classes with bounded -admissibility.
In this work, we complete the picture and prove the following.
Theorem (Informal).
For any integer , there exists a testing algorithm for -freeness and -freeness of bounded -admissible graphs with query complexity depending only on , and the proximity parameter , where is the bound on the -admissibility bound.
We prove the theorem for -freeness, but a minor (and slightly simpler) version of our proof implies the same result -freeness. We also provide the lower bounds that do not appear in [3]. Specifically, that for every , -freeness and -freeness are not testable in bounded -admissible graphs.
Techniques and their relation to existing work
The results in this paper are derived from the classical property tester for -freeness in bounded-degree graphs. The tester selects a small initial random subset of the vertices of a graph that is far from being -free; then, with sufficiently high probability, one of these vertices participates in a subgraph of the input graph (a subgraph of the input graph that is isomorphic to ). Since the input graph has a bounded degree, starting a “bounded range” breadth-first search (BFS) from each one of the vertices in the initial set of vertices will result in the discovery of a subgraph with sufficient probability. If this event occurs, then the graph is rejected and, otherwise, it is accepted. Clearly, this algorithm will always accept a -free graph.
Suppose that we tried to use a variation of this tester on a graph with a bounded average degree, where the latter bound is provided as part of the input. We call this variation pseudo-BFS (PBFS). To guarantee that the PBFS’s query complexity remains low, the algorithm first computes some that depends only on the given average degree and then behaves like the bounded-degree tester until it encounters a vertex with a degree greater than (a heavy vertex). When this occurs, the search only includes a size randomly selected subset of the vertex’s neighbours. If the PBFS initiates a search on a vertex that is part of a and this contains at most one heavy vertex, then the PBFS will uncover all vertices of said . However, if a contains at least two non-neighbouring heavy vertices, then the PBFS might not find all the vertices of this copy with sufficiently high probability since it only sees a small random subset of a heavy vertex’s neighbours. The lower bound result is based on this scenario.
This raised the question of whether the PBFS approach still works if we impose more restrictions than just the bounded average degree. In [3] it was shown that -freeness is testable in using PBFS as the testing algorithm. The technique involves showing that if the input graph has bounded -admissibility and is far from being -free, then with sufficiently high probability the PBFS will start its search in a vertex that belongs to a with at most two heavy vertices and the crucial insight is that these two heavy vertices necessarily have a large joint neighbourhood of non-heavy vertices – meaning that if the PBFS locates one of these joint neighbours, it will immediately find both heavy vertices in the next step and two steps later a will be detected with high probability. This technique is sufficient to establish testability of -freeness in -admissible graphs, but not for -freeness in -admissible graphs. The reason is that a might contain two heavy vertices of distance exactly four, which means that these paths include vertices that are not neighbours of either of the heavy endpoints, a case that is not covered by this technique.
We model our approach on [3] by using a process called trimming. That is, given an input graph that is far from being -free, we carve out a subgraph of by removing just enough edges from to ensure that has some required structural properties and is still far from being -free (with some changes to the “farness” parameter). The graph is only used for the analysis of our algorithm. Specifically, it is shown that if has a subgraph and one of its vertices is detected when our algorithm runs on , then with high probability, a -subgraph will be detected.
The main tools used here are various structural properties of graphs with bounded admissibility. For example, a graph with bounded -admissibility admits a total ordering of its vertex set such that every heavy vertex can only reach a bounded number of heavy vertices via paths of length at most . This allows us to enforce that in the trimmed graph , if such a path of length at most between and exists, then there must be a large number of such paths in and therefore also in (since otherwise they would have been removed from ).
2 Preliminaries
We use for the set of integer numbers, for the set of real numbers, for the set of positive reals. For an integer , we use as a shorthand for the set . For integers and such that we use as a shorthand for the set and as a shorthand for the set . For a graph , we use and to refer to its vertex and edge set, respectively. All graphs considered in this work are simple undirected graphs. The degree of a vertex , denoted , is the number of edges incident on . is the set of neighbours of the vertex . The distance between two vertices is denoted . The distance between a vertex and a subset , is the minimum of over every .
For sequences of vertices (and in particular, paths), we use the shorthand to represent the sequence, and use to denote the length of the corresponding path. In addition, we use (or ) to refer to a subsequence of . All paths considered in this work are simple paths. Though paths here are undirected, we often treat them as directed by specifying a start and end vertex.
Property testing
A graph property (or simply property) is a class of graphs closed under isomorphism. We say that a graph has the property if .
We say that a graph with vertices and at most edges is -far from if at least edge modifications are required to make the graph have the property. Otherwise, we say that it is -close to .
Definition 1.
A property tester for a property of graphs is a randomized algorithm that receives as input parameters , and oracle access to a graph with vertices and at most edges. If the graph is -far from , then rejects with probability at least . If the graph , then accepts with probability (if the tester has one-sided error) or with probability at least (if the tester has two-sided error).
In this work, we consider the setting of sparse graphs where the oracle access to is defined as follows.
Definition 2 (Sparse graph oracle).
Given a graph , a sparse graph oracle can answer the following queries for vertices :
-
The degree of a vertex (degree query).
-
The th neighbour of in (neighbour query).
-
Whether is an edge in (adjacency query).
By combining these queries, the whole neighbourhood of a vertex can be revealed by using queries. The oracle returns the special symbol “” when asked a query without sensible answers, e.g. when asked to return the -th neighbour of a vertex with .
In this paper, we consider a particular set of graphs (which will be defined later on) for the property of -freeness. That is, a graph that does not have a subgraph isomorphic to . We refer to the problem as -freeness. We call a graph -free if it is contained in the -freeness property.
In further sections, we use the term knowledge-graph to refer to the graph that includes all the vertices and edges revealed by the algorithm queries.
3 Graph admissibility
We start this section by presenting the definitions required for defining when a graph is -admissible. Afterwards, we provide the actual definition and a structural lemma for -admissible graphs. Then, we explain why this lemma is critical and provide an extra definition and two more structural claims.
An ordered graph is a pair where is a graph and is a total order relation on . We write to denote the ordering of and extend this notation to derive the relations , , .
To define -admissibility we need the following ideas and notations.
Definition 3.
Let and . A path is -admissible in if , and (where the minimum is with respect to the ordering in ). That is, the path goes from to using only vertices such that and satisfy .
Definition 4.
For every integer we let be the set of all vertices in such that and is reachable from via an -admissible path of length at most . We omit the subscript when it is clear from context.
Definition 5.
An -admissible path packing is a collection of paths with joint root and the additional properties that every path is -admissible and the subpaths are all pairwise vertex-disjoint. In particular, all endpoints are distinct. We write to denote the maximum size of any -admissible path packing rooted at .
Examples of - and -admissible path packings are depicted in Figure 1.
Definition 6 (Admissibility).
The -admissibility of an ordered graph , denoted and the admissibility of an unordered graph , denoted are111Note that some authors choose to define the admissibility as as this matches with some other, related measures.
where is the set of all possible orderings of .
If is an ordering of such that , then we call an admissibility ordering of . The -admissibility of a graph coincides with its degeneracy, and therefore such orderings are easily computable in linear time. For , an optimal ordering can also be computed in linear time in if the class has bounded expansion, i.e. if the graph class has bounded admissibility for every (see [6]).
Now we are ready to define the set of graphs we consider for testing -freeness.
Definition 7.
We say that a graph is -admissible if . Note that by definition, if a graph is -admissible, it is also -admissible for all . We call a graph class -bounded if all of its members are -admissible for some finite value .
We state the following fact regarding -admissible graphs.
Fact 7.
If is -admissible, then .
The next lemma is a well-known structural result for admissible graphs. This lemma is the critical component of the result of this paper.
Lemma 8.
Let be such that , then for every , and we have .
We refer the reader to [3] (Proposition 3) for a proof.
Lemma 8, is the structural property of bounded admissibility graphs that enables the result in this paper. To understand the importance of the above lemma, fix and suppose that we have a admissible graph with ordering . Suppose also that is -far from being -free and all the -subgraphs in it have exactly two vertices of degree and vertices of degree . Let be the set of degree vertices and let be the set of degree vertices. Consider any ordering placing the vertices in before the vertices in . For an example of such a graph see Section 7. Note that that graph is not -admissible, however, a -admissible graph with such attribute exists. Suppose that we create a new graph from by doing the following: (i) for every and we remove if , and (ii) for every and , such that , if there exists a maximum set of less than edge disjoint paths in , then we remove all the edges in these paths from .
It is easy to see that in (i) at most two edges are removed for every vertex in . So, after the removal of all these edges is still far from -freeness. Regarding (ii) it can be shown, using Lemma 8, that after (i), for every there are at most vertices in such that and and are connected by a path of length . This, along with some accounting, implies that after (ii), far fewer than edges were removed from to obtain . Thus, is -far from being -free.
Now, since is -far from being -free, because of the type of s it has, a constant portion of the vertices of are in such . So, an algorithm that randomly selects a few vertices from the graph, with high probability, will pick one of these vertices. Suppose that this was the algorithm described in the introduction. Once a vertex from in a -subgraph of is selected, its neighbours are discovered. Now, since in , and are connected by a path of length , and have many common vertices (at least ) and hence the algorithm will discover one of them with high probability. This will lead to the discovery of a -subgraph in .
This technique cannot be generalized beyond , since for the -subgraphs may include more complicated subpaths. To deal with this issue, we need the following definition.
Definition 9.
Let . A path is a chain if for every , we have .
Proposition 10.
Let , be such that , be an -admissible path in , and . The subpath of is a chain.
Proof.
By the definition of an -admissible path for every , we have and, in particular, . Thus, by definition, is a chain. Lemma 8 describes how sets of vertices reachable through -admissible paths from a fixed start vertex are bounded by a function of and . We can obtain a comparable bound for the more general cases where the vertices are now reachable via chains:
Lemma 11.
Let , and be an ordered -admissible graph. Let be a collection of chains of length at most that all start at the same vertex and each end with a vertex smaller than under .
Then the set which contains the respective minima, under , of each of the above paths has size at most .
Proof.
Let , and . That is, is the maximum number of vertices of in a path . Next, we show by induction that the set has size at most , since this implies the lemma.
For the statement becomes vacuous, so consider . This is the case that for every , the only vertex of smaller than is its other end point. Since all paths are -chains the set of these endpoints is a subset of . Therefore, by Lemma 8, which provides us with the inductive base.
Assume that the statement holds for all , where , and all collections of -chains of length , such that for every , starts at the vertex and ends at some vertex smaller than under , and .
Let and for every , let be such that and , where . According to the base of the induction .
Pick a vertex and let be the collection of all the paths such that . Since , every path in is a subpath of a path in , we can conclude that for every , we have . Thus, by the induction assumption, . Finally, by construction, we have .
4 Nadirs and Braids
Definition 12.
For every pair of vertices , a braid is a set of edge-disjoint -admissible paths each having as the start vertex and as the end vertex, and all having the same length. A braid is a full-braid if the number of paths it has is maximum.
We use a tilde on an upper case letter to denote a braid, for example . In addition, we use the following notations for paths and braids :
-
is the number of paths in .
-
is the length of the paths in .
-
, is an order pair where is the start vertex of every path in , and is the end vertices of every path in and otherwise it is undefined.
Definition 13.
The of a path , denoted , is the vertex such that for every we have . The of a braid , denoted is the set .
Definition 14.
Let be a braid and , a vertex is -weak for , if the maximum size of a braid such that is at most and otherwise it is -strong for .
Definition 15.
For every , a braid is a -braid if every vertex in is -weak for .
Proposition 16.
Let , be such that , an -admissible path in , and . Then, and the subpath of is a chain.
Proof.
By the definition of an -admissible path for every , we have . Thus, by definition, and is a chain.
Lemma 17.
Let , and be an ordered -admissible graph and such that . If there exists a braid such that , and , then there exists a braid such that and the only vertices that are shared between the paths of are and .
Proof.
Let where for every , there exists exactly one path such that . By assumption, . Let be the set of all vertices in the paths of except and .
We first argue that every vertex can be contained in at most members of . To that end, assume that is contained in members . Let be the respective nadirs of these subgraphs under , so . For every , let be a subpath of . Since each of the paths is -admissible, by Proposition 16, all the paths are chains. We can therefore invoke Lemma 11 on the paths to conclude . Thus, can be contained in at most members of .
It follows immediately that every path in shares vertices that are not or with at most other paths of . Consequently, a simple greedy selection process can construct the claimed braid such that .
5 Trimming
In this section, we present the procedure that we refer to as trimming. It is important to note that the trimming procedure is used only for the analysis of the algorithm we present. This is the reason that trimming can read the entire input graph.
Trimming receives as input a graph that is -admissible, an ordering and the parameters and . From now on, in this section, assume that these parameters are fixed. Trimming creates a subgraph of that has a number of properties that are essential for the analysis of our algorithm. For example, with the right choice of parameters, if is -far from -freeness, then is -far from -freeness; for every , if there exists an full-braid in such that and , then . Note that the choice of and not , in the last inequality, is crucial for our proof to work and that is -admissible since it is a subgraph of .
The trimming procedure
Initialize to be equal to and repeat the following steps until each one does not result in any edge removal:
-
1.
For every distinct , , , and full-braid in such that and , if , then all the edges participating in the paths of are removed from .
-
2.
For every distinct , , , and -braid in such that and , if , then all the edges participating in the paths of are removed from .
Next, we show that the graph created by using the trimming process is far from being -free.
Lemma 18.
Let , , , and be a -admissible graph that is -far from -freeness. If , then the graph created by trimming with parameters , and , is -far from -freeness and -admissible.
Proof.
Note first that is a subgraph of since it was created from by taking a copy of and removing specific edges from it. So, to prove the claim, we only need to show that at most edges have been removed from to obtain . Since is -far from being -free, this implies the claim.
Trimming step (1).
For every and , the maximum number of edges removed in this step is at most the number of edges in the paths of a full-braid such that and . Thus, for every such and at most edges are removed from . By Lemma 8, , and therefore the total number of edges removed in this step is at most , where the inequality follows since .
Trimming step (2).
The proof is the same as the previous step.
Proposition 19.
Let be such that and assume that was created by trimming with parameters and . Then
-
1.
if then ,
-
2.
if has an -admissible path , then there exists a full-braid in such that , and , and
-
3.
if has an -admissible path , and there does not exist a in such that , , , , then there exists a -braid in such that , and .
Proof.
(1) By definition, the braid that contains only the pass is a full-braid, such that and . Since , the edge is removed from during step 1 of Trimming.
(2) The proof follows directly from the definition of a full-braid and Step (1) of trimming.
(3) The proof follows directly from Step (2) of trimming.
6 The main algorithm
We refer to the loop on line 3 of Algorithm 1, as Selection Loop, to the loop on line 5 of Algorithm 1, as Outer Loop, to the loop on line 7 as middle loop and to the loop on line 12 as Inner Loop. In all of this section, is a -admissible graph with vertices, is an ordering of , is a subgraph of obtained by trimming with the parameters , and when we use the parameter we assume that it is a multiple of . Note that by Fact 3, Algorithm 1 receives a bound on the number of edges implicitly, since the value of is part of its input.
The following lemma follows directly from Algorithm 1.
Lemma 20.
The query complexity of Algorithm 1 is .
In this section, we use the term knowledge-graph to refer to the subgraph of that is discovered by queries of Algorithm 1.
6.1 Proof overview of the main theorem
Bounding the query complexity of Algorithm 1 and proving that it returns ACCEPT given a -free input graph is rather simple. The challenge is to prove that Algorithm 1 returns REJECT with probability at least on an input graph that is -admissible and -far from being -free. This is the focus of this subsection; suppose that Algorithm 1 is given as input , , oracle access to a -admissible graph that is -far from being -free.
The proof is divided into three phases: (i) showing that, with high probability, Algorithm 1 discovers a set of vertices in some -subgraph of , such that every path in that does not include a vertex from has a length of at most .
(ii) showing that if (i) occurred, then with high probability, all the vertices of a -subgraph of are discovered; and (iii) showing that if (ii) occurred, then with high probability, the knowledge-graph includes a -subgraph.
Note that since is a subgraph of , this implies that, with high probability, a -subgraph of is discovered. We next further explain each phase starting with (iii), proceeding to (i), and ending with (ii).
(iii) The knowledge-graph includes all the vertices of a -subgraph of . By (1) of Proposition 19, every edge in is incident to a vertex with degree at most in . Thus, line 9 of Algorithm 1 ensures that the edge is discovered.
(i) By using (1) of Proposition 19, it is shown that a significant portion of the vertices in are such that:
, is in some -subgraph of , , where is the smallest vertex in according to .
The value of is set so that with high probability a vertex such as is discovered.
As in (iii), both of ’s neighbours in will also be discovered.
Now, notice that and are selected so that the shorter path in between and is a chain of length .
Since is in , so is the chain above.
Thus, by Lemma 22 (appears later), with high probability, will also be discovered. Thus, a set of vertices as above is discovered with high probability. The formal proof appears later in Lemma 23.
(ii) Suppose that a set of vertices like above was discovered by Algorithm 1 and is the -subgraph of such that .
Note that if we can ensure that, with high probability, we find a vertex such that satisfies the same attributes as (though not necessarily with the initial subgraph ), then we are guaranteed that, with high probability, all the vertices of some subgraph of will eventually be discovered.
Let be the smallest vertex in according to . Assume that is on a subpath of such that . If , then, as in (i), there exists a chain of length at most in between one of the vertices and and the vertex . By the same reasoning as in (i), with high probability this vertex is discovered. Next, we describe what happens if .
Suppose that . If there exists a braid such that and , then by future choice of the value of , with high probability, a vertex and one of the paths in is selected. The fact that ensures that there exists a chain of length at most in between and , containing the vertex . As in (i), this ensures that is discovered with high probability. This is proved later on formally in Lemma 24. Hence, it remains to deal with the case that a braid like does not exist.
The nonexistence of a braid like implies that there exists a -braid such that . Notice that according to the definition of a -braid, this implies that . The value of is selected to be significantly higher than , thus ensuring that is sufficiently large. Using a similar proof to the previous case with some significant extra work and the help of a sufficiently large value of , it is shown later in Lemma 25, that eventually a sufficiently large portion of the vertices in are discovered. Once this happens, we are guaranteed by Lemma 17, that there are paths in such that the are vertex-disjoint. This implies that one of these paths together with includes a -subgraph of such that , where is the nadir of the path, and satisfies the same attributes as . The formal proof for this case appears later in Lemma 26.
6.2 Proof of the main theorem
Lemma 21.
Let and be the set of all vertices of an -subgraph of . If and all the vertices of are in the knowledge-graph at the end of iteration of Outer Loop, then with probability , at the end of iteration of Outer Loop, the knowledge-graph is not -free.
Proof.
Let be a subgraph of and let , be such that and . By Proposition 19, . Thus, according to Inner Loop, if both and are in the knowledge-graph at the end of iteration of Outer Loop, then because with probability , at the end of iteration of Outer Loop, the edge is also in the knowledge-graph. The same applies to all other edges.
Lemma 22.
Let , , and be such that . Assume that there exists a chain in such that . If is in the knowledge-graph at the end of iteration of Outer Loop, then with probability at least , at the end of iteration of Outer Loop, is also in the knowledge-graph.
Proof.
We proceed by induction on the value of . Suppose that . Thus, and are neighbours in and therefore, by Proposition 19, . Thus, according to the contents of Outer Loop, with probability , at the end of iteration of Outer Loop, is also in the knowledge-graph.
Assume by induction that the lemma holds for every chain in , where . Let be the closest vertex to in such that and let be a subpath of . By construction, for every , we have and therefore is an -admissible path in .
Suppose that . As , according to the induction assumption, given that is in the knowledge-graph at the end of iteration of Outer Loop, with probability at least , at the end of iteration of Outer Loop, is also in the knowledge-graph.
Let be a subpath of . Since is a subpath of , we conclude that . Thus, by the induction assumption, given that is in the knowledge-graph at the end of iteration of Outer Loop, with probability at least , at the end of iteration of Outer Loop, the vertex is also in the knowledge-graph. Consequently, together with the previous, given that is in the knowledge-graph at the end of iteration of Outer Loop, with probability at least , at the end of iteration of Outer Loop, the vertex is also in the knowledge-graph.
Suppose that . By definition, is an -admissible path in . Therefore, by Proposition 19, has a full-braid , such that and .
Since there are at least edge-disjoint paths in , at least of the neighbours of the vertex are in one of the paths of . Thus, according to the contents of Inner Loop, given that is in the knowledge-graph at the end of iteration of Outer Loop, with probability at least , at the end of iteration of Outer Loop, a vertex adjacent to in a path of is also in the knowledge-graph.
Let , be the specific -admissible path of that includes . By Proposition 10, is a chain. Since , by the induction assumption, given that is in the knowledge-graph at the end of iteration of Outer Loop, with probability at least , at the end of iteration of Outer Loop, the vertex is also in the knowledge-graph. Consequently, in this case, given that is in the knowledge-graph at the end of iteration of Outer Loop, with probability at least , at the end of iteration of Outer Loop, the vertex is also in the knowledge-graph.
Lemma 23.
Let . If is -far from -freeness, then with probability at least , at the end of iteration of Outer Loop the knowledge-graph includes a set of vertices , such that for some -subgraph of we have and for every path in , where , we have .
Proof.
Let be the set of all vertices such that . For every -subgraph of let be the vertex in such that for every we have , and let be an arbitrary vertex in such that . Let be the set of all vertices such that for some -subgraph of .
Let be an arbitrary -subgraph of . exists since there are exactly two vertices such that , they are neighbours in and therefore, by Proposition 19, at least one of them is in .
We first show that, with probability at least , after Selection Loop and prior to the first iteration of Outer Loop, the set of Algorithm 1 includes a vertex from . Afterwards, we show that if the above occurred, then with probability at least , at the end of iteration of Outer Loop, the knowledge-graph includes a set as required.
Suppose that we removed from every edge adjacent to a vertex in , then by construction, the graph we get is -free. Since, by Lemma 18, is -far from being -free it holds that . Thus, according to Selection Loop, with probability at least , after Selection Loop and prior to the first iteration of Outer Loop, the set of Algorithm 1 includes a vertex from .
Suppose that is a -subgraph of and that is set of Algorithm 1 after Selection Loop and prior to the first iteration of Outer Loop. Let be the set of vertices that includes , ’s neighbours in and . We note that the set satisfies the requirements of the lemma.
According to the Inner Loop, with probability , at the end of the first iteration of Outer Loop, the neighbours of in will also be in the knowledge-graph. By construction and has a chain of length whose end-vertices are and . By Lemma 22, with probability at least , at the end of iteration of Outer Loop, the knowledge-graph includes the vertex . Applying a union bound finishes the proof.
Lemma 24.
Let , , , and be such that . Suppose that there exists a braid in such that , , and . If is in the knowledge-graph at the end of iteration of Outer Loop, then with probability at least , at the end of iteration of Outer Loop, is also in the knowledge-graph.
Proof.
Since , by the same reasoning as in Lemma 22, if is in the knowledge-graph at the end of iteration of Outer Loop, then with probability at least , at the end of iteration of Outer Loop, the knowledge-graph includes a vertex that is adjacent to in a path of . Assume that , since otherwise we are done. Let , be the specific -admissible path of that includes . Let we a subpath of . By Proposition 16 and is a chain.
Using the same reasoning as in Lemma 22, if is in the knowledge-graph at the end of iteration of Outer Loop, then with probability at least , at the end of iteration of Outer Loop, the knowledge-graph includes . An application of a union bound concludes the proof.
Lemma 25.
Let , and . Assume that has a -braid such that , , and . Assume also that is in the knowledge-graph at the end of iteration of Outer Loop. With probability at least , at the end of iteration of Outer Loop, the knowledge-graph also includes a size subset of .
Proof.
Let be the set of all vertices adjacent to in a path of . The following analysis is for iteration of Outer Loop.
For every , let be the set of all vertices of that are in the knowledge-graph at the end of iteration of the inner loop, and let be a bipartite graph such that if and only if , and there exists a path in such that and . Also, let be the size of a maximum matching in .
We show first that if , then with probability at least , at the end of iteration of Outer Loop, the knowledge-graph includes at least vertices from . Afterwards, we show that with probability at least , we have , which together with the previous implies the lemma.
Suppose that , and let be a size matching in . For every edge , where and , the braid has an -admissible path in such that and . By Proposition 16 the subpath of is a chain in . Thus, by Lemma 22, for every edge , if is in the knowledge-graph at the end of iteration of Outer Loop, then with probability at least , at the end of iteration of Outer Loop, the vertex is also in the knowledge-graph. Thus, by the union bound, given that , with probability at least , the knowledge-graph includes at least vertices of .
Now, we show that, with probability at least , at the end of iteration of Outer Loop, . We use martingales for this purpose.
For every , let be the identity of the neighbour of selected in iteration of Inner Loop, and let be a bipartite graph such that and if and only if , , and has a chain such that .
For every , let be the size of a maximum matching in minus the size of a maximum matching in and . Since , by using the linearity of expectation, we have . Next, we show that for every , we have . Together, with the above, this implies that .
Fix , and to be a maximum matching in . Note that if , is a vertex in that is not in and there exists a vertex , such that is not in and has a chain such that , then has an edge that does not share a vertex with any edge in and therefore . We next lower bound the probability that this happens.
By the definition of a -braid, for every , there are at most paths in . So, if we remove from all the the paths in which the vertices of participate, then we removed from at most edges. Thus, after the removal of these edges the resulting braid includes at least paths. So, the probability that a vertex selected in Inner Loop will be in one of the paths of is at least . Note that if this event occurs for some , then . Thus, we conclude that, indeed, for every , we have .
We use the vertex exposure martingale to show that with sufficiently high probability the maximum matching in the random graph is sufficiently large. We reveal the whole graph , iterating over , and for every we reveal the identity of and the identities of its neighbours in and the edges of incident on . For every , we let and let .
We note that for every , we have since has only one fixed vertex more than . Thus, by the Azuma Hoeffding tail bound, with probability at least , we have . This implies that with probability at least , we have .
Lemma 26.
Let , a -subgraph of and such that every subpath of that does not include vertices from has length at most . If , and all vertices of were in the knowledge-graph at the end of iteration of Outer Loop, then with probability at least , at the end of iteration of Outer Loop, all the vertices of some -subgraph of are in the knowledge-graph.
Proof.
We shall show that if all vertices of are in the knowledge-graph at the end of iteration of Outer Loop, then with probability at least , at the end of iteration of Outer Loop, the knowledge-graph also includes a vertex such that are all vertices of some -subgraph of (not necessarily ). By the union bound, this implies the lemma.
Let be such that for every we have . Let be such that and the path in satisfies .
Suppose first that , by construction the path of is a chain of length at most in . Thus, by Lemma 22, with probability at least , at the end of iteration of Outer Loop, the knowledge-graph also includes . Note that .
Assume now that , then by the definition of a , . Suppose also that there exists a braid in such that , , and . By Lemma 24, with probability at least , at the end of iteration of Outer Loop, is also in the knowledge-graph. Note that .
Finally, suppose that there does not exist a braid in such that , , and . Then, by (3) of Proposition 19, there exists a -braid such that , and . By Lemma 25, with probability at least , at the end of iteration of Outer Loop, the knowledge-graph also includes a size subset of . Since we assumed that , by Lemma 17, the graph includes a braid such that , and the only vertices that are shared between the paths of are and . Thus, has a path such that , , . Consequently, together with includes a -subgraph of , such that .
Theorem 27.
Given oracle access to a -free graph, Algorithm 1 returns “ACCEPT”. Let and . There exist values for , and , that depend only on , and for which the following holds: on input , and , oracle access to a graph and , Algorithm 1 computes the values of , and , and if is admissible and -far from being -free, with probability at least , Algorithm 1 returns “REJECT”. The query complexity of Algorithm 1 depends only on , and .
Proof.
The first part of the claim follows from the fact that Algorithm 1 returns “REJECT” only if its knowledge-graph is not -free. Since the knowledge-graph of Algorithm 1 is a subgraph of the input graph, then it will not return “REJECT” if the input graph is -free.
So, suppose that is admissible and -far from being -free. Let , , , and . The last part of the claim follows from Lemma 20, since , and depend only on , and .
Let be the graph created by Trimming with parameters and . Since , by Lemma 18, is -far from being -free.
Since, is -far from being -free, by Lemma 23, with probability at least
(the inequality follows because and ), at the end of iteration of Outer Loop, the knowledge-graph includes a set of vertices , such that for some -subgraph of we have and every subpath of that does not include a vertex from has length at most .
By Lemma 26, given that a set of vertices such as is in the knowledge-graph at the end of iteration of Outer Loop, with probability at least
(the inequality follows because and ), at the end of iteration of Outer Loop, all the vertices of some -subgraph of are in the knowledge-graph.
By Lemma 17, if at the end of iteration of Outer Loop all the vertices of some -subgraph of are in the knowledge-graph, then at the end of iteration of Outer Loop, the knowledge-graph is not -free.
The previous three observations imply that, in this case, Algorithm 1 rejects with probability at least .
7 Lower bounds for testing -freeness in -admissible graphs for
For this section we need some extra notation. For an ordered graph we write for the before neighbourhood and for the after neighbourhood of a vertex . We also use and , as well as and . We omit the subscript if the context implies it.
Theorem 28.
For every integers and sufficiently large , every two-sided property tester for -freeness has query complexity , on -admissible input graphs of size .
The following proofs are for testing -freeness in -admissible graphs. In the end, we explain how this implies the above theorem.
We prove the lower-bound theorems using Yao’s minimax principle [13], which allows us to prove lower bounds for randomized property testers in the following manner.
In the theorem for the one-sided error case, we show that there exists a distribution over input graphs that are -far from -freeness which further satisfy the following property: every deterministic one-sided property-tester for -freeness – when given the parameters , oracle access to a random graph picked from – with probability at least its knowledge-graph will not have a -subgraph after using up to queries. Since a one-sided property tester can only accept if its knowledge-graph has a -subgraph and must reject with probability at least , the above implies that it has query complexity .
In the theorem for the two-sided error case, we design two distributions , over -admissible graphs. The support of is over -free graphs, and the support of graphs is over graphs that are -far being -free. These distributions are constructed so that any two-sided deterministic error tester that uses queries, has a very low probability of computing which one of the two distributions is the origin of the input graph. If such a property tester rejects a graph from with probability at least , then it accepts graphs from with probability strictly less than .
We now define the graph that is used to construct the distribution and later, with some modifications, and . For every , we define to be the graph that consists of the following vertices and edges: is the union of two sets and . consists of all edges .
We sample a graph from by applying a random permutation of the names of the vertices in and the same for the names of the in .
Proposition 29.
For every , the graph is -admissible and -far from -freeness.
Proof.
To see that is -admissible, pick an arbitrary ordering of the vertices of where all the vertices of are larger than all the vertices of . Clearly , so every vertex in participates in at most two -admissible paths.
For every pair of vertices , has exactly one that includes both vertices. We note that all these subgraphs are edge disjoint and is the union of all their edges. So, to turn into a -free graph, at least edges must be removed from . Since -admissible graphs have less than edges, for a large enough value of , is -far from being -free. In order to simplify the proofs, we will make the following assumptions about the oracle: if the algorithm queries the identity of a vertex for , then it also receives the identity of ’s neighbour that is different from (since it has degree two) for the price of one query. Similarly, if it queries the neighbour of a vertex , it receives the identity of both of ’s neighbours. Furthermore, we let the algorithm know all degrees (and thus the sets and ) in advance. Therefore, we can assume that the algorithm never asks for edges between vertices if either or and never uses degree queries. Thus, we may also assume that algorithm uses only adjacency queries between a vertex in and a vertex in . In the case that the algorithm asks such a query between the vertices and and that exists, then we also give the algorithm the identity of the second neighbour of . Since all these modified queries provide at least as much information as queries in the original setting, the lower bound naturally applies to the latter.
Theorem 30.
For every sufficiently large integer , every one-sided property tester for -freeness of -graphs on vertices has query complexity .
Proof.
Fix to be an arbitrary deterministic one-sided property tester for -freeness and suppose that it receives as input , , and oracle access to a random graph generated by .
For , let be the probability that after queries the knowledge-graph does not contain a subgraph conditioned on the event that the same holds after queries, where the probabilities are over the choice of the input graph according to . The probability that after queries ’s knowledge-graph does not contain a is . Thus, to conclude the proof, we only need to show that for and every , we have , since this implies that
Let be the knowledge-graph after queries and suppose that does not contain a .
Note that after a neighbour query at most vertices are added to the knowledge-graph, one of degree and two of degree . The same holds for adjacency queries.
Therefore, contains at most vertices from the set and at most vertices of the set .
Observe that for every , all edges incident on are in .
So, the only type of queries that can result in not being -free are:
-
a neighbour query to one of the vertices in that returns a vertex in and a vertex in ,
-
a neighbour query to a vertex in that returns two vertices in , and
-
an adjacency query with a vertex in and a vertex in that returns a vertex in .
The probability that the first case does not occur is at least . The probability that the second case does not occur is at least , which is strictly larger than , when . Finally, the probability that the third case occurs is at least , which is strictly larger than , when . We now define the graphs and and the distributions and . consists of two disjoint copies of the graph , and we distinguish the vertices of the copy with a prime (e.g. and ). We construct by first setting and then for every distinct , we remove from the edge and and add the edges and . We sample a graph from by applying a random permutation of the names of the degree- vertices and doing the same for the names of the degree-two vertices. The distribution is defined in the same way.
Note that here we also set to be the set of all degree vertices and to be the rest of the vertices. for a two sided-error algorithm we make the same assumptions on the queries as we did for a one-sided error algorithm.
Proposition 31.
For every , the graphs and are -admissible. Moreover, is far from freeness, and is free.
Proof.
The proof of the first part of the claim follows from Proposition 29. For the second part, note that in all the subgraphs are of the form . Thus, when we constructed from , we “disconnected” all the s that were in , and we did not introduce any new s.
Theorem 32.
For every sufficiently large integer , every two-sided property tester for -freeness of -bounded graphs on vertices has query complexity .
Proof.
Fix to be an arbitrary deterministic two-sided property tester for -freeness and suppose that it receives as input , , and oracle access to a random graph generated by selecting u.a.r. one of the distributions and and then selecting a graph according to the chosen distribution.
Next, we show that, given that the input is selected from only one of the two distributions, with probability at least the answers that are vertices of degree were drawn one by one u.a.r. without returns (after a vertex is drawn, it cannot be drawn again) from the vertices of degree . The same applies to vertices of degree .
This means that , with probability , will behave exactly the same way, regardless of whether the input was drawn from or . So, if given an input that is drawn from , rejects, with probability at least , then with probability at least it rejects an input that is drawn from , that is, it accepts such an input with probability strictly less than . This is a contradiction to being a property tester, since it must reject an input drawn from with probability at least and must accept an input drawn from with probability at least .
We note that to prove this, we only need to show with probability at least , every query uses returns only vertices that are not already in its knowledge-graph. The proof follows the exact same lines as in the one-sided case. Fix to be an integer larger than or equal to . To get the one-sided error lower bounds for freeness and freeness -admissible for graphs work by creating a new graph from the graph as follows:
-
For , for every vertex , where is as in the construction of , replace the edge between and with a path of length .
-
For , for every vertex , where is as in the construction of , if replace the edge with a path of length and otherwise replace the edge with a path of length .
Note that the graph created according to the first item is -admissible and has cycles of length where the graph had cycles of length . The graph created according to the second item is also -admissible and has cycles of length where the graph had cycles of length .
To obtain the lower two-sided error lower bound for freeness and freeness of admissible graphs, apply the same changes used for originally constructing these graphs, to construct the new and from with the following change: treat the paths that were added to as if they were edges. Thus, Theorem 28 holds.
References
- [1] Noga Alon, Tali Kaufman, Michael Krivelevich, and Dana Ron. Testing triangle-freeness in general graphs. SIAM Journal on Discrete Mathematics, 22(2):786–819, 2008. doi:10.1137/07067917X.
- [2] Noga Alon, Raphael Yuster, and Uri Zwick. Finding and counting given length cycles. Algorithmica, 17(3):209–223, 1997. doi:10.1007/BF02523189.
- [3] Christine Awofeso, Patrick Greaves, Oded Lachish, and Felix Reidl. H-freeness testing in graphs of bounded -admissibility. In 42nd International Symposium on Theoretical Aspects of Computer Science, STACS 2025, March 4–7, 2025, Jena, Germany, volume 327 of LIPIcs. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2025.
- [4] Artur Czumaj and Christian Sohler. A characterization of graph properties testable for general planar graphs with one-sided error (it’s all about forbidden subgraphs). In 2019 IEEE 60th Annual Symposium on Foundations of Computer Science (FOCS), pages 1525–1548. IEEE, 2019. doi:10.1109/FOCS.2019.00089.
- [5] Mina Dalirrooyfard, Thuy Duong Vuong, and Virginia Vassilevska Williams. Graph pattern detection: Hardness for all induced patterns and faster non-induced cycles. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing, pages 1167–1178, 2019. doi:10.1145/3313276.3316329.
- [6] Zdeněk Dvořák. Constant-factor approximation of the domination number in sparse graphs. European Journal of Combinatorics, 34(5):833–840, July 2013. doi:10.1016/j.ejc.2012.12.004.
- [7] Talya Eden, Reut Levi, and Dana Ron. Testing c_k-freeness in bounded-arboricity graphs. In Karl Bringmann, Martin Grohe, Gabriele Puppis, and Ola Svensson, editors, 51st International Colloquium on Automata, Languages, and Programming, ICALP 2024, July 8-12, 2024, Tallinn, Estonia, volume 297 of LIPIcs, pages 60:1–60:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.ICALP.2024.60.
- [8] Oded Goldreich and Dana Ron. Property testing in bounded degree graphs. In Proceedings of the twenty-ninth annual ACM symposium on Theory of computing, pages 406–415, 1997. doi:10.1145/258533.258627.
- [9] Donald B Johnson. Finding all the elementary circuits of a directed graph. SIAM Journal on Computing, 4(1):77–84, 1975. doi:10.1137/0204007.
- [10] Reut Levi. Testing triangle freeness in the general model in graphs with arboricity . In 48th International Colloquium on Automata, Languages, and Programming, ICALP 2021, July 12-16, 2021, Glasgow, Scotland (Virtual Conference), volume 198 of LIPIcs, pages 93:1–93:13. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2021. doi:10.4230/LIPICS.ICALP.2021.93.
- [11] Jaroslav Nešetřil and Patrice Ossona de Mendez. Sparsity: Graphs, Structures, and Algorithms, volume 28 of Algorithms and Combinatorics. Springer, 2012. doi:10.1007/978-3-642-27875-4.
- [12] Virginia Vassilevska and Ryan Williams. Finding, minimizing, and counting weighted subgraphs. In Proceedings of the forty-first annual ACM symposium on Theory of computing, pages 455–464, 2009. doi:10.1145/1536414.1536477.
- [13] Andrew Chi-Chin Yao. Probabilistic computations: Toward a unified measure of complexity. In 18th Annual Symposium on Foundations of Computer Science (sfcs 1977), pages 222–227. IEEE Computer Society, 1977.
- [14] Xuding Zhu. Colouring graphs with bounded generalized colouring number. Discrete Mathematics, 309(18):5562–5568, 2009. doi:10.1016/J.DISC.2008.03.024.