Testing bipartiteness in the dense graph model #
Bipartiteness is one-sided testable in the dense graph model with a number of queries polynomial in
1 / ε and independent of the number of vertices Goldreich, Goldwasser and
Ron; see also Goldreich, Chapter 8.
The tester bipartiteRun n' s m on Fin (n' + 1) samples s uniform vertices u and m
uniform pairs of vertices (x k, y k), all independent. It queries the m (2 s + 1) pairs
(x k, u i), (y k, u i) and (x k, y k) and accepts when there is a proper 2-colouring of the
sample positions (bipAccept): a colour for each index i of u and for each index k of x
and of y, with different colours at the two ends of every observed edge. A vertex that occurs at
several positions may receive different colours, so this is laxer than asking that the observed
subgraph be bipartite: with s = 0 and m = 3 on the triangle, the tester can observe all three
edges and still accept. A bipartite graph is always accepted, since a proper 2-colouring of the
graph induces one of the positions.
Source mapping #
The query pattern, with a vertex sample U and pairs each checked against U and against each
other, is that of Goldreich, Goldwasser and Ron, §6.1.1, p. 683. The
soundness argument follows their §6.1 (Theorem 6.1.2, Claims 6.1.4 and 6.1.6, pp. 679–683): a
2-partition of U forces a partition of the vertices with a neighbour in U, and a far graph
leaves many violating pairs under every such forced partition. Their factor-two distance
convention is §5.1, pp. 675–676. The open book draft of April 26, 2017 (§8.3.1, Algorithm 8.7 and
Lemma 8.8, pp. 174–177; the published book is Goldreich, Chapter 8) presents the
same high-degree coverage argument.
Adaptation in the coverage step. GGR take |U| = O(log (1 / (ε δ)) / ε) so that, with high
probability, U dominates all but few high-degree vertices. The result is
O(log² (1 / (ε δ)) / ε³) queries. Here the coverage step is replaced by an expectation bound. The
expected degree mass of the vertices with no neighbour in U is at most n² / (s + 1)
(sum_uncoveredDegree_le, from d (n - d) ^ s ≤ n ^ (s + 1) / (s + 1)). Markov's inequality then
suffices at constant confidence, so s = ⌈12 / ε⌉ works and the logarithmic factors disappear.
This refinement of the analysis is ours; we do not know of an exact source for it and claim no
novelty for it. It gives no asymptotic improvement over the Õ(ε⁻²) bound of
Alon and Krivelevich.
Proof outline #
A colouring χ of the sampled vertices forces a colour on every vertex with a sampled neighbour,
the colour opposite to that neighbour's.
If the tester accepts, some χ leaves every sampled pair (x k, y k) outside the set of bad
pairs: edges between two vertices with sampled neighbours that receive the same forced colour.
Extending the forced colouring arbitrarily, an ε-far graph has more than 2 ε n² ordered
monochromatic adjacent pairs, and those not bad have an endpoint without a sampled neighbour. The
expected degree mass of the vertices without a sampled neighbour is at most n² / (s + 1), so by
Markov's inequality it exceeds ε n² / 2 with probability at most 2 / (ε (s + 1)). Otherwise
every colouring of the sample has more than ε n² ordered bad pairs, and the m independent pairs
all avoid them with probability at most (1 - ε) ^ m. A union bound over the 2 ^ s colourings
gives
acceptProb ≤ 2 / (ε (s + 1)) + 2 ^ s (1 - ε) ^ m ≤ 1 / 6 + 1 / 8 < 1 / 3
when 12 ≤ ε s and s + 3 ≤ ε m. With s = ⌈12 / ε⌉ and m = ⌈(s + 3) / ε⌉ the tester asks
m (2 s + 1) ≤ 459 / ε³ queries for ε ≤ 1. Distances are those of IsFar, relative to n²
vertex pairs; Goldreich's distance ε is IsFar G P (ε / 2) here.
This file bounds queries only; it makes no claim about running time. The O(ε⁻³) bound is not
optimal: a uniform sample of Õ(1 / ε) vertices already induces a non-bipartite subgraph of an
ε-far graph with high probability, which gives Õ(ε⁻²) queries
Alon and Krivelevich.
Main definitions #
Cslib.DenseGraphTesting.bipAccept: accept when the sample positions admit a proper 2-colouring.Cslib.DenseGraphTesting.bipartiteRun,bipartiteTester: the bipartiteness tester.
Main results #
Cslib.DenseGraphTesting.IsFar.two_mul_lt_sum_monochromatic: a graphε-far from bipartite has more than2 ε n²ordered monochromatic adjacent pairs under every 2-colouring.Cslib.DenseGraphTesting.acceptProb_bipartiteTester_eq_one: perfect completeness.Cslib.DenseGraphTesting.acceptProb_bipartiteTester_le_one_third: soundness.Cslib.DenseGraphTesting.isOneSidedTester_bipartiteTester: the tester is a one-sided tester withm (2 s + 1)queries.Cslib.DenseGraphTesting.oneSidedTestable_isBipartite,bipartiteQueryBound_le: bipartiteness is one-sided testable withO(ε⁻³)queries.
References #
The decision rule #
The decision rule of the bipartiteness tester. The bits a k i, b k i and c k report
whether x k ~ u i, y k ~ u i and x k ~ y k; accept when the sample positions admit a proper
2-colouring: χ of the positions i, ξ and ζ of the positions k of x and of y. Colours
are attached to positions, not vertices, so a repeated vertex may receive two colours.
Monochromatic pairs #
A graph ε-far from bipartite has more than 2 ε n² ordered adjacent pairs of the same colour
under every 2-colouring f: deleting them leaves a bipartite graph.
Forced colourings #
Coverage #
Counting accepted samples #
The tester #
The bipartiteness tester with s sampled vertices and m sampled pairs. The graph on no
vertices is accepted without queries.
A run asks m (2 s + 1) queries.
The tester asks at most m (2 s + 1) queries.
The acceptance probability of a run is the fraction of accepted samples.
Completeness. A bipartite graph is accepted with probability one.
Soundness. If 12 ≤ ε s and s + 3 ≤ ε m, a graph ε-far from bipartite is accepted with
probability at most 1 / 3.
Bipartiteness is testable. If 12 ≤ ε s and s + 3 ≤ ε m, the tester with s sampled
vertices and m sampled pairs is a one-sided tester for bipartiteness with proximity ε and
m (2 s + 1) queries.
Bipartiteness is one-sided testable with a number of queries depending only on the
proximity: ⌈(⌈12 / ε⌉ + 3) / ε⌉ (2 ⌈12 / ε⌉ + 1) queries, which is at most 459 / ε³ for
ε ≤ 1 (bipartiteQueryBound_le).