A better tester for bipartiteness?
ABSTRACT Alon and Krivelevich (SIAM J. Discrete Math. 15(2): 211-227 (2002)) show that if a graph is {\epsilon}-far from bipartite, then the subgraph induced by a random subset of O(1/{\epsilon}) vertices is bipartite with high probability. We conjecture that the induced subgraph is {\Omega}~({\epsilon})-far from bipartite with high probability. Gonen and Ron (RANDOM 2007) proved this conjecture in the case when the degrees of all vertices are at most O({\epsilon}n). We give a more general proof that works for any d-regular (or almost d-regular) graph for arbitrary degree d. Assuming this conjecture, we prove that bipartiteness is testable with one-sided error in time O(1/{\epsilon}^c), where c is a constant strictly smaller than two, improving upon the tester of Alon and Krivelevich. As it is known that non-adaptive testers for bipartiteness require {\Omega}(1/{\epsilon}^2) queries (Bogdanov and Trevisan, CCC 2004), our result shows, assuming the conjecture, that adaptivity helps in testing bipartiteness. Comment: 18 pages
-
Citations (0)
-
Cited In (0)
Page 1
arXiv:1011.0531v1 [cs.DS] 2 Nov 2010
A better tester for bipartiteness?
Andrej Bogdanov∗
Fan Li†
Abstract
Alon and Krivelevich (SIAM J. Discrete Math. 15(2): 211-227 (2002)) show that if a graph
is ε-far from bipartite, then the subgraph induced by a random subset of˜O(1/ε) vertices is
bipartite with high probability. We conjecture that the induced subgraph is˜Ω(ε)-far from
bipartite with high probability. Gonen and Ron (RANDOM 2007) proved this conjecture in
the case when the degrees of all vertices are at most O(εn). We give a more general proof that
works for any d-regular (or almost d-regular) graph for arbitrary degree d.
Assuming this conjecture, we prove that bipartiteness is testable with one-sided error in time
O(1/εc), where c is a constant strictly smaller than two, improving upon the tester of Alon and
Krivelevich. As it is known that non-adaptive testers for bipartiteness require Ω(1/ε2) queries
(Bogdanov and Trevisan, CCC 2004), our result shows, assuming the conjecture, that adaptivity
helps in testing bipartiteness.
1Introduction
A graph on n vertices is ε-far from bipartite if it cannot be made bipartite even after removing an
arbitrary set of ε?n
with distance parameter ε if, given oracle access to a graph G, the algorithm always accepts if G
is bipartite and rejects with probability at least 1/2 if G is ε-far from bipartite.
The problem of testing bipartiteness was among the first ones considered in the framework
of property testing. In their work which introduces combinatorial property testing, Goldreich,
Goldwasser and Ron [GGR98] give a tester for bipartiteness (of dense graphs) that runs in time
O(1/ε3).
Later works [AFKS99, AS05] gave many examples of graph properties that are testable in time
independent of the size of the graph. Alon et al. [AFNS06] gave a combinatorial characterization of
all such graph properties. However, although all these properties have testers whose running time
is independent of the graph size, the running time is very large in terms of the distance parameter
ε. Typically this dependence is a tower of exponentials of height polynomial in 1/ε, and sometimes
even worse. The super-exponential dependence on ε in these analyses owes to applications of
the regularity lemma. In contrast, there are relatively few properties that are testable in time
polynomial in 1/ε. Bipartiteness is perhaps the most natural example of such a property.
In most cases, the design of property testing algorithms for graphs is relatively straightforward;
it is the analysis that is difficult. This can be partially explained by a theorem of Goldreich and
2
?of its edges. A randomized algorithm is a (one-sided) tester for bipartiteness
∗andrejb@cse.cuhk.edu.hk.
Computer Science and Communications, Chinese University of Hong Kong.
†fli@cse.cuhk.edu.hk. Department of Computer Science and Engineering, Chinese University of Hong Kong.
Department of Computer Science and Engineering and Institute for Theoretical
1
Page 2
Trevisan [GT03] which says that any tester that makes at most q queries can be simulated by a
tester that chooses a subgraph on O(q) vertices, makes all queries between the vertices and accepts
if the induced subgraph satisfies a related property. Applying this canonical algorithm of Goldreich
and Trevisan deteriorates the query complexity by at most a quadratic factor. In the case of
superexponential bounds (typical in applications of the regularity lemma), a quadratic loss is not
terribly relevant.1
However, for bipartiteness testing, much sharper bounds on the query complexity are known.
Alon and Krivelevich [AK02] show that if a graph is ε-far from bipartite, then with high probability
a random sample of˜O(1/ε) vertices contains an odd-length cycle. This gives a bipartiteness tester
that makes˜O(1/ε2) queries, improving the query complexity of the original tester of Goldreich,
Goldwasser and Ron by a factor of about 1/ε.
The Alon-Krivelevich tester is non-adaptive in the sense that its query sequence is independent
of the graph in question (and only depends on the parameter ε). Bogdanov and Trevisan [BT04]
show that any non-adaptive tester for bipartiteness must make Ω(1/ε2) queries into the graph. For
general testers, they only prove a query complexity lower bound of Ω(1/ε3/2).
It is natural to ask whether the Alon-Krivelevich tester can be improved. Gonen and Ron [GR08]
observe that the known lower bounds apply even for the subclass of graphs where the degree of
every vertex is bounded by O(εn). For this special class of graphs, they give an improved algorithm
for testing bipartiteness that runs in time˜O(1/ε3/2).
Gonen and Ron also give a different type of algorithm that tests bipartiteness for any graph
where all vertices have degree at least kεn (1 ≤ k ≤ 1/ε) with running˜O(1/kε2). Although not
stated explicitly in their paper, when taken together their results imply that bipartiteness is testable
in time O(1/ε2−c) for some constant c < 2 for any d-regular graph, where d can be arbitrary. (We
explain this point below. In fact it is sufficient for the graph to be “almost d-regular” in the sense
that the degrees of most vertices are between d and Kd for some constant K.)
Recently Goldreich and Ron [GR09] gave the first examples of graph properties for which an
adaptive tester provably outperforms the best non-adaptive one by a polynomial factor.2They also
give a candidate collection of properties which is conjectured to approach the optimal quadratic
speedup for adaptive testers.
The question of testing bipartiteness has also been studied in the sparse graph model, where
Goldreich and Ron [GR98] give a tester whose running time on an n-vertex graph is˜O(√n) for any
fixed degree d and distance parameter ε. Although their discussion focuses on the case of constant
d and ε, their analysis in fact works even when d and 1/ε grow in terms of n (although the bounds
get worse). For a precise statement of this fact, see Theorem 3.
Kaufman, Krivelevich, and Ron [KKR04] gave upper and lower bounds for testing bipartiteness
for general-degree graphs in a model that combines features of the sparse graph and dense graph
models.
1The deterioration in running time could be somewhat worse, but again such losses are not very relevant when
using the regularity lemma.
2Although Gonen and Ron already show that adaptivity helps for testing bipartiteness of small-degree graphs,
their result does not translate into a graph property because their notion of “small degree” depends on the distance
parameter ε.
2
Page 3
1.1Our result
Recall that Alon and Krivelevich [AK02] prove that if a graph is ε-far from bipartite, then a
random sample of˜Ω(1/ε) vertices will contain an odd-length cycle with probability at least 1/2.
We conjecture the following generalization:
Conjecture 1. If a graph G is ε-far from bipartite, then with probability 1/2 the induced graph on
a random sample of˜O(1/ε) vertices is˜Ω(ε)-far from bipartite.
Gonen and Ron [GR08] prove this conjecture for graphs whose degrees are bounded by Kεn for
some constant K. We give a more general proof (Theorem 11) that works for the case where G is
d-regular (and even when all its vertex degrees are between d and Kd for a constant K).
Conjecture 1 is a purely combinatorial statement about graphs, which by itself does not yield
anything better than the original, nonadaptive tester of Alon and Krivelevich for testing bipartite-
ness in time˜O(1/ε2). Assuming this conjecture, we prove that there exists an adaptive tester for
bipartiteness that outperforms the best non-adaptive one:
Theorem 2. Assume Conjecture 1. Then bipartiteness is testable with one-sided error in time
O(1/εc), where c is a constant strictly less than 2.
On the conjecture
dence in favor of it comes from work of Fischer and Newman [FN07]. It follows from their work
that there exists a function f such that if G is ε-far from bipartite, thaen with high probability a
random subgraph on f(ε)-vertices will be˜Ω(ε)-far from bipartite. We know that f(ε) > 1/Kε for
some absolute constant K > 0 for instance from [BT04]. Conjecture 1 postulates that this bound
is nearly tight, namely f(ε) =˜O(1/ε).
We believe that Conjecture 1 is interesting in its own right. A similar phenomenon has been in-
vestigated in the context of probabilistically checkable proofs (PCPs) [BSGH+06, DR06]. Roughly,
a PCP is robust if a proof which is ε-far from a correct one must encode an assignment which is
Ω(ε)-far from a satisfying one. Conjecture 1 says, in some sense, that bipartiteness is robust under
takingrandom subgraphs on˜O(1/ε) vertices.
Even if the conjecture turns out to be false, we believe that coming up with a counterexample
to it would be enlightening in understanding the complexity of testing bipartiteness.
Besides our proof that the conjecture is true for regular graphs, more evi-
Comparison with the work of Gonen and Ron
testing bipartiteness that apply to two different classes of graphs. Their first algorithm runs in time
˜O(ε3/2), but only applies to graphs where all degrees are at most O(εn). Their second algorithm
runs in time˜O(1/kε2), but only applies to graphs where all degrees are at least kεn.
As we explain below, the two algorithms of Gonen and Ron are fundamentally different from
one another and there is no a priori reason why we should expect a single algorithm for testing
bipartiteness in time O(1/ε2−c) that works for all graphs, In this work we provide such an algorithm,
and we show that if Conjecture 1 is true, our algorithm is correct on all inputs.
Gonen and Ron give two algorithms for
1.2 The algorithms of Gonen and Ron
Our proof is inspired by the algorithms proposed by Gonen and Ron [GR08] for testing bipartiteness
in graphs with some restriction on the degrees of the vertices. Gonen and Ron propose two such
algorithms: One for “low-degree” graphs and another one for “high-degree” graphs.
3
Page 4
Before we explain the two algorithms, let us apply the conjectured generalization of the Alon-
Krivelevich result. This generalization allows us to replace a graph on n vertices by one on˜O(1/ε)
vertices, while roughly preserving the distance from bipartiteness.
Applying this conjecture comes at no loss in generality (if we disregard polylogarithmic factors in
1/ε): If testing bipartiteness requires q(ε) queries on graphs of size s =˜O(1/ε), then it requires the
same number of queries on graphs on n veritces whenever n is a multiple of s. The counterexample
of size s can be scaled up to size n by performing an εn-blowup of it.3It is not difficult to see that
this blowup operation preserves the distance to bipartiteness.4
After applying the conjecture, let us use n to denote the number of vertices in the induced
subgraph. Then (with high probability) this graph G will be˜Ω(1/n)-far from bipartite.
convenience, we will make a change in terminology: We say that a graph is m-removed from
bipartite if one cannot make it bipartite even after removing m arbitrary edges. Then the graph
G will be˜Ω(n)-removed from bipartite. We have now reduced the task to designing a tester for
bipartiteness in G that runs in time O(n2−c) for some constant c. This algorithm only needs to
outperform the trivial algorithm by a small factor in the running time. However, when G is far
from bipartite, it is only guaranteed to have˜Ω(n) violating edges – about one per vertex.
To explain the low-degree and high-degree algorithms, it is useful to keep in mind these two
example graphs on n vertices that are Ω(n)-far from bipartite:
For
• G1: A constant-degree expander – for example, a collection of d random matchings for some
constant d.
• G2: A√n-blowup of an odd length cycle of length about√n.
The low degree algorithm
can test bipartiteness by emulating the Goldreich-Ron algorithm for bounded degree graphs. In
the adjacency lists model with distance parameter δ, the Goldreich-Ron algorithm runs in time
˜O(√n) · 1/δK, where K is some constant. If a graph G of maximum degree d is˜Ω(n)-removed
from bipartite in the adjacency matrix model, then G is 1/d · polylog(n)-far from bipartite in the
adjacency list model, and we have the following consequence.
When the maximum degree d of G is much smaller than n, we
Theorem 3 (The Goldreich-Ron algorithm). Let G be a graph on n vertices maximum degree d.
Suppose we are given an adjacency list representation of G. Then there is an algorithm that runs
in time˜O(√n) · dKsuch that (1) if G is bipartite, the algorithm says “bipartite” and (2) if G is
˜Ω(n)-removed from bipartite, the algorithm outputs an odd-length cycle of G with probability 9/10.
For intuition, we briefly outline the Goldreich-Ron algorithm: This algorithm chooses O(1/δ)
random starting vertices v, then performs poly(log(n)/δ) ·√n random walks out of v of length
poly(log(n)/δ) and looks for pairs of random walks – one of even length, the other one of odd
length – that start and end at the same vertex, thus revealing an odd-length cycle. For a graph like
G1, this algorithm works well because the random walks mix within O(logn) steps and we expect
two of them to collide after about√n attempts. We expect the length of the walks to be about
3A k-blowup of a graph G is obtained by replacing every vertex of G by a group of k vertices and every edge of G
by a complete k by k bipartite graph between the corresponding groups of vertices.
4One shows that the optimal partitions always assign the same color to all vertices within a group. For general
graph properties, however, this is not always the case [GKNR08].
4
Page 5
evenly divided between even and odd, so in the first collision an odd-length cycle is likely to be
revealed.5
In the theorem, K is some universal constant which Goldreich and Ron do not attempt to
optimize. Since every query in the adjacency list model can be emulated by n queries in the
adjacency matrix model, this algorithm runs in time˜O(n3/2)/dKfor graphs given by adjacency
matrices. Notice that the Goldreich-Ron algorithm outperforms the trivial algorithm not only when
d is constant, but also when d is a sufficiently small power of n. However, when the degree becomes
very large – for example as in the graph G2– then it is not difficult to see that the running time
of the algorithm can easily become˜Ω(n2) in the adjacency matrix representation.
The high degree algorithm
algorithm chooses a random set S of vertices of size about O((n/d)log n), queries all their neighbors
for edges, makes another O((n2/d)log n) random pair queries, and looks for an odd-length cycle.
The running time of this algorithm is˜O(n2/d). Instead of explaining why this algorithm works in
general, let’s look at the representative graph G2. Here, even in the first phase of the algorithm,
we are likely to have sampled at least one vertex in every location of the cycle, so after querying
all their neighbors we see at least one copy of the odd-length cycle.
On the other hand, the high-degree algorithm is unlikely to work well on graphs like G1with
constant-degree vertices: After the first phase, the graph has seen many isolated vertices (and their
neighbors) in the graph, and it is quite unlikely that a cycle will be revealed in the second phase.
Now assume the degrees of all the vertices are at least d. This
1.3 Our proof
It follows from our discussion that there is some critical degree d = na, where a is a constant,
with the following property: If all vertices have degree less than d, then the low-degree algorithm
outperforms the trivial one; and if all vertices have degree greater than d, then the high-degree
algorithm outperforms the trivial one. So it is natural to try and combine both algorithms and get
a single one that works for all graphs.
Now consider a graph G that is m =˜Ω(n)-removed from bipartite and has both low-degree and
high-degree vertices. Intuitively, if G is m-removed from bipartite, it could be for three reasons:
Either there are many violating edges in the high-degree part of G, or there are many violating
edges in the low-degree part, or there are many violating edges between the two parts. (To illustrate
the third case, consider a graph that has n/2 vertices of degree about√n that are connected by a
blowup of a cycle of even length about√n, and n/2 vertices of constant degree that are randomly
connected to these high-degree vertices.)
The high-degree algorithm lets us take care of the first case: If we run the high-degree algorithm
on G and it detects no odd cycle, then we can be fairly confident that the high-degree part of G
is close to bipartite. But in fact we prove that the high-degree algorithm does more: In the case
the algorithm fails to detect an odd cycle, its queries reveal an approximate spanning forest of the
high-degree part of G: That is, after removing m/2 edges, we know exactly which vertices in the
high-degree part must be of the same color and which must be of different colors. We prove this in
Section 3.
5This crude explanation misses many important ideas of the Goldreich-Ron algorithm, and we refer the reader to
their paper [GR08] for a complete presentation.
5