betaFeedback

WorksComputer Science

Testing Implies Distance Estimation with Polynomial Loss

Abstract

A tester decides whether a graph has a property or is far from having it. A distance estimator asks for more: it must approximately determine how many edges need to be changed. A property is said to be testable if there is a tester with a number of queries bounded independently of the graph's order for each conceivable distance. Similarly, if a property admits an estimator with a number of queries bounded independently of the graph's order, it is said to be estimable. Fischer and Newman proved that, in the dense graph model, every testable property is also estimable. We show that the passage from testing to estimation requires only a polynomial increase in query complexity. This resolves a long-standing open problem in property testing, previously tackled by Fiat and Ron, by Hoppen, Kohayakawa, Lang, Lefmann, and Stagni, and by Gishboliner, Kushnir, and Shapira.

Introduction

Property testing in the dense graph model

Deciding whether a large object satisfies a given property can be very expensive, both in computation and in the amount of information that must be read. Property testing studies a relaxation of this task: distinguishing objects that satisfy the property from those that require a substantial proportion of their entries to be changed before they satisfy it. The aim is to make this distinction by inspecting only a (very) small part of the input. We refer the reader to Goldreich’s book [1] for a general introduction to the area.

We work in the dense graph model, also called the adjacency matrix model. A graph on a vertex set VV is a function G:(V2)→{0,1}G : \binom{V}{2} \to\{0,1\}, and we write GV\mathcal{G}_V for the set of such graphs. For n=∣V∣≥2n = |V| \ge2, the normalized edit distance between G,H∈GVG,H \in\mathcal{G}_V is

d(G,H)=∣E(G)△E(H)∣(n2).d(G,H)=\frac{|E(G)\mathbin{\triangle}E(H)|}{\binom{n}{2}}.

A graph property P\mathcal{P} is a collection of graphs closed under isomorphism. Let PV=P∩GV\mathcal{P}_V=\mathcal{P}\cap\mathcal{G}_V; we define

dist⁡(G,P)=min⁡H∈PVd(G,H)\operatorname{dist}(G,\mathcal{P})=\min_{H\in\mathcal{P}_V}d(G,H)

when PV≠∅\mathcal{P}_V\ne\varnothing, and set dist⁡(G,P)=1\operatorname{dist}(G,\mathcal{P})=1 otherwise. Thus, dist⁡(G,P)\operatorname{dist}(G,\mathcal{P}) is the smallest fraction of pairs whose adjacency status must be changed to obtain a graph in P\mathcal{P} on the same vertex set. We say that GG is ε\varepsilon-far from P\mathcal{P} if dist⁡(G,P)≥ε\operatorname{dist}(G,\mathcal{P})\ge\varepsilon. Graphs of size less than two can be handled separately.

An algorithm receives the order nn of the input graph and may query whether a given pair of vertices is an edge. An ε\varepsilon-tester for P\mathcal{P} accepts every graph in P\mathcal{P} with probability at least 23\frac{2}{3} and rejects every graph that is ε\varepsilon-far from P\mathcal{P} with probability at least 23\frac{2}{3}. No requirement is imposed on graphs whose distance lies strictly between 00 and ε\varepsilon. The property is testable if, for every ε>0\varepsilon> 0, such a tester exists with a number of queries bounded independently of nn.

Throughout the paper, q(ε)q(\varepsilon) denotes an upper bound on the number of edge queries, valid for every input size. We often use canonical testers, which sample a uniformly random set of vertices and inspect its induced subgraph. The canonization theorem of Goldreich and Trevisan [2] converts a tester making qq edge queries into a canonical tester sampling O(q)O(q) vertices. Conversely, inspecting the subgraph induced by ss vertices uses at most (s2)\binom{s}{2} edge queries. These polynomial conversions allow us to pass between the two models without changing whether a bound is polynomial. We nevertheless keep track of the distinction, using ss for the size of a canonical sample.

Goldreich, Goldwasser and Ron [3] introduced graph property testing in this model, and proved that a broad class of partition properties, including kk-colourability and properties prescribing a large cut, are testable. Subsequent work established general criteria for testability. In particular, Alon and Shapira [4] proved that every hereditary graph property, meaning one closed under taking induced subgraphs, is testable.

Regularity methods play a central role in these general results. They replace a large graph with a bounded description that preserves enough information to detect violations of the property. The quantitative cost of employing these methods can, however, be very large: Szemerédi’s regularity lemma has tower-type bounds, and Gowers [5] showed that such dependence is unavoidable for the lemma itself. This leaves open the possibility that a particular testing problem admits a much better bound through a more direct argument or a weaker approximation theorem. For example, the regularity-based argument of Rödl and Duke [6] for kk-colourability was followed by polynomial testing bounds obtained without the full regularity lemma [3, 8, 9].

Understanding when such improvements are possible is a central question in graph property testing. Related work of Carenini, Seth and Yoshida [7] gives a quantitative container characterization of one-sided testability, connecting prescribed testing complexity to container-like descriptions. This develops a different route to quantitative testing results, building on the hypergraph container method of Balogh, Morris and Samotij [10] and Saxton and Thomason [11]. Here, we study the quantitative relationship between testing and the stronger task of distance estimation.

Distance estimation and previous bounds

A tester distinguishes distance zero from distance at least ε\varepsilon. A distance estimator must approximate the distance on every input. More precisely, an ε\varepsilon-estimator for P\mathcal{P} outputs a number d^\widehat{d} satisfying

Pr⁡[∣d^−dist⁡(G,P)∣≤ε]≥23\Pr\left[\left|\widehat{d}-\operatorname{dist}(G,\mathcal{P})\right|\leq\varepsilon\right]\geq\frac{2}{3}

for every graph GG. We call P\mathcal{P} estimable if it admits such an algorithm with query complexity depending only on ε\varepsilon. Estimability implies testability, after changing the accuracy by a constant factor.

Parnas, Ron and Rubinfeld [12] initiated the systematic study of tolerant testing and distance approximation. Testing need not imply distance estimation in other models [13]. In the dense graph model, however, Fischer and Newman [14] proved that every testable property is estimable. Their proof uses regularity and incurs a tower-type loss in converting a tester into an estimator. The natural quantitative question is how much of this loss is necessary.

This question was first studied for hereditary properties by Hoppen, Kohayakawa, Lang, Lefmann and Stagni [15] and by Fiat and Ron [16]. In particular, can a hereditary property that is testable with polynomially many queries also be estimated with polynomially many queries? The following formulation asks for a quantitative conversion for arbitrary testing bounds.

Problem 1 (Testing versus estimation). Suppose that a graph property P\mathcal{P} has an ε\varepsilon-tester using q(ε)q(\varepsilon) queries. Can its distance be estimated to additive accuracy ε\varepsilon using poly⁡(max⁡{1,q(cε)},1/ε)\operatorname{poly}(\max\{1,q(c\varepsilon)\},1/\varepsilon) queries, for an absolute constant c>0c>0?

For hereditary properties, earlier bounds are most precisely expressed using induced-removal lemma parameters. At proximity η\eta, these are numbers M=M(η)M=M(\eta), δ=δ(η)>0\delta=\delta(\eta)>0 and n0=n0(η)n_0=n_0(\eta) such that every η\eta-far graph GG of order at least n0n_0 contains some F∉PF\notin\mathcal{P}, with ∣V(F)∣≤M|V(F)|\le M, for which a uniformly random injective map from V(F)V(F) to V(G)V(G) induces a copy of FF with probability at least δ\delta. Such parameters give a one-sided tester with vertex sample size O(max⁡{n0,M/δ})O(\max\{n_0,M/\delta\}). Hoppen, Kohayakawa, Lang, Lefmann and Stagni [15] obtained distance estimators with a doubly exponential bound in terms of these removal parameters. Gishboliner, Kushnir and Shapira [17] improved this to a singly exponential bound.

Theorem 1 (Gishboliner–Kushnir–Shapira [17]). Let P\mathcal{P} be hereditary. For an absolute constant c0>0c_0>0, let M,δ,n0M,\delta,n_0 be induced-removal parameters at proximity c0εc_0\varepsilon. Then, P\mathcal{P} has an ε\varepsilon-estimator with query complexity 2poly⁡(M/δ,log⁡n0)2^{\operatorname{poly}(M/\delta,\log n_0)}.

Using the same tools, Gishboliner, Kushnir and Shapira also obtained a doubly exponential conversion for general graph properties [17]. Thus, the remaining question was whether a polynomial loss suffices.

Our main result

We prove that every tester in the dense graph model can be converted into a distance estimator with polynomial loss.

Theorem 2 (Testing implies estimation with polynomial loss). There is an absolute constant c>0c>0 with the following property. If P\mathcal{P} has an ε\varepsilon-tester with edge-query complexity q(ε)q(\varepsilon) for every ε∈(0,1)\varepsilon\in(0,1), then it has an ε\varepsilon-estimator with edge-query complexity poly⁡(max⁡{1,q(cε)},1/ε)\operatorname{poly}(\max\{1,q(c\varepsilon)\},1/\varepsilon).

In particular, a graph property is testable with poly⁡(1/ε)\operatorname{poly}(1/\varepsilon) queries if and only if its distance can be estimated with poly⁡(1/ε)\operatorname{poly}(1/\varepsilon) queries. The theorem applies to general graph properties and allows the original tester to be adaptive and to have two-sided error.

For natural properties, the explicit dependence on 1/ε1/\varepsilon can be absorbed into the testing complexity. Following [17], call P\mathcal{P} unnatural if there exists ε0>0\varepsilon_0>0 such that, for every 0<η<ε00<\eta<\varepsilon_0 and all sufficiently large nn, either P[n]=∅\mathcal{P}_{[n]}=\varnothing or every nn-vertex graph has distance at most η\eta from P\mathcal{P}. A property is natural if it is not unnatural. A hereditary property is non-trivial if it contains graphs of arbitrarily large order and omits at least one graph.

Corollary 1. If P\mathcal{P} is natural, or is a non-trivial hereditary property, then the bound in Theorem 2 simplifies to poly⁡(q(cε))\operatorname{poly}(q(c\varepsilon)) for all sufficiently small ε\varepsilon.

Indeed, the query lower bounds in [17 Propositions 1.7 and 1.10] give q(ε)=Ω(1/ε)q(\varepsilon)=\Omega(1/\varepsilon) for the edge-query complexity in these cases. The factor 1/ε1/\varepsilon in Theorem 2 can therefore be absorbed into the polynomial.

Main technical contribution and comparison with previous approaches

Previous approaches: estimating through partitions

A sufficiently regular partition of a graph, together with the edge densities between its parts, approximately determines the densities of small induced subgraphs. For a hereditary property, induced removal lemma turns this information into a way of detecting graphs that are far from the property. This suggests estimating distance by searching over modifications of the partition’s density values. The search asks how cheaply those values can be changed so that they are compatible with a graph close to the property.

To justify this procedure, one must relate changes in the description to changes in the graph itself. Suppose that the prescribed densities change by γ\gamma on average, weighted by the sizes of the corresponding pairs of parts. One needs to realize the new densities with approximately γ2\frac{\gamma}{2} edge changes while retaining the regularity required for counting. This continuity between editing the description and editing the graph is a key ingredient in the Fischer–Newman argument [14]. The large number of parts required by regularity accounts for its tower-type bounds.

Hoppen et al. [15] used the weaker approximation supplied by the Frieze–Kannan lemma [18], whose partitions have size exponential in a polynomial of the inverse accuracy. Weak regularity still controls the density of each fixed induced graph, but transferring edits while preserving the required approximation is more delicate. Their method combines weakly regular partitions with partitions that have no regularity requirement, leading to a doubly exponential bound. Gishboliner, Kushnir and Shapira [17] established an appropriate continuity statement: a slightly stronger form of weak regularity before editing is enough to retain ordinary weak regularity afterwards. This underlies their improved bounds.

Our approach

Our proof begins by expressing the distance as the approximate minimum of a single objective function built from the tester. We then show that this minimum is attained approximately by a weighted graph described using short labels on its vertices. Optimizing over these labels is a dense constraint satisfaction problem, whose optimum can be estimated from a small random sample. We overview each of these steps below.

Replacing membership by a penalty. Fix a target accuracy ε\varepsilon and let τ=ε/100\tau= \varepsilon/100. After amplification and canonization, the tester samples s=O(max⁡{1,q(τ)}log⁡(1/τ))s = O\left(\max\{1,q(\tau)\}\log(1/\tau)\right) vertices and rejects according to a symmetric rule f:Gs→[0,1]f : \mathcal{G}_s \to[0,1]. For an nn-vertex graph JJ, consider the following rejection rule rej⁡(J)=Evf(J[v])\operatorname{rej}(J) = \mathbb{E}_{\mathbf{v}}f(J[\mathbf{v}]), where v\mathbf{v} is a uniformly random ordered tuple of ss distinct vertices. The rule ff may depend on nn; throughout the argument, nn and its associated rule are fixed. The tester satisfies

{J∈P⟹rej⁡(J)≤τ,dist⁡(J,P)≥τ⟹rej⁡(J)≥23.\begin{cases} J \in\mathcal{P} &\Longrightarrow\operatorname{rej}(J) \le\tau,\\ \operatorname{dist}(J,\mathcal{P}) \ge\tau&\Longrightarrow\operatorname{rej}(J) \ge\frac{2}{3}. \end{cases}

For the input graph GG on VV, consider M(G)=min⁡J∈GV{d(G,J)+2rej⁡(J)}M(G) = \min_{J \in\mathcal{G}_V}\{d(G,J) + 2\operatorname{rej}(J)\}. When PV≠∅\mathcal{P}_V \ne\varnothing, this minimum satisfies

dist⁡(G,P)−τ≤M(G)≤dist⁡(G,P)+2τ.(1)\operatorname{dist}(G,\mathcal{P}) - \tau\le M(G) \le\operatorname{dist}(G,\mathcal{P}) + 2\tau. \tag*{(1)}

For the upper bound, take a closest graph in P\mathcal{P}; its edit cost is exactly dist⁡(G,P)\operatorname{dist}(G,\mathcal{P}) and its penalty is at most 2τ2\tau. For the lower bound, a graph JJ within distance τ\tau of P\mathcal{P} has d(G,J)≥dist⁡(G,P)−τd(G,J) \ge\operatorname{dist}(G,\mathcal{P}) - \tau, by the triangle inequality. Every other JJ pays a penalty of at least 4/34/3, which already exceeds the maximum possible distance. Thus the tester supplies all the information about P\mathcal{P} needed by this objective.

We next allow the edges of a candidate graph to have weights in [0,1][0,1]. For a weighted graph WW, let G(W)\mathcal{G}(W) be the random graph obtained by rounding its edges independently, with edge probabilities given by WW. Extend the objective by setting

cost⁡G(W)=E d(G,G(W)),rej⁡(W)=E rej⁡(G(W)),EG(W)=cost⁡G(W)+2rej⁡(W).\operatorname{cost}_G(W) = \mathbb{E}\,d(G,\mathcal{G}(W)), \qquad\operatorname{rej}(W) = \mathbb{E}\,\operatorname{rej}(\mathcal{G}(W)), \qquad\mathcal{E}_G(W) = \operatorname{cost}_G(W) + 2\operatorname{rej}(W).

Then,

EG(W)=E[d(G,G(W))+2rej⁡(G(W))].\mathcal{E}_G(W)=\mathbb{E}\left[d(G,\mathcal{G}(W))+2\operatorname{rej}(\mathcal{G}(W))\right].

Consequently, allowing weights does not change the minimum: every weighted objective value is an average of ordinary graph objective values. This exact relaxation makes it possible to approximate candidate graphs by bounded real-valued functions.

Approximating a candidate using short vertex labels. The approximation only needs to preserve two quantities: the edit cost and the rejection probability of the fixed tester. The first is affine in the edge weights:

cost⁡G(W)=Euv[G(uv)+(1−2G(uv))W(uv)].\operatorname{cost}_G(W)=\mathbb{E}_{uv}\left[G(uv)+(1-2G(uv))W(uv)\right].

Thus, its change is measured by correlation with the single function 1−2G1-2G.

To control rejection probability, we compare two weighted graphs by changing the (s2)\binom{s}{2} edge probabilities in a sampled graph one at a time. Each change is an edge-weight difference multiplied by a discrete derivative of the tester’s rejection rule. The important point is how these changes can be described.

Suppose the changing edge occupies positions 1 and 2 in the sample. Call positions 3,…,s3,\ldots,s the anchors. After rounding the other edges, the change, which we call the derivative, is determined by the graph bb on the anchors and the two adjacency vectors x,yx,y from the endpoints to the anchors:

∂bf(x,y)=f(F1(b,x,y))−f(F0(b,x,y)).\partial_b f(x,y)=f(F_1(b,x,y))-f(F_0(b,x,y)).

where Ft(b,x,y)F_t(b,x,y) is the graph with these prescribed adjacencies and with the edge 12 set to tt. In the comparison between two weighted graphs, a vertex may need a different adjacency vector for each of the two endpoint roles. Recording both vectors, and symmetrizing in the endpoints, gives a bounded test of an unordered pair.

In this way we obtain a family T\mathcal{T} of functions on vertex pairs. Each derivative test is specified by O(s2)O(s^2) bits of common data and O(s)O(s) bits at each vertex; we also include the cost test 1−2G1-2G. With

∥R∥T=max⁡A∈T∣EuvR(uv)A(uv)∣,\lVert R\rVert_{\mathcal{T}}=\max_{A\in\mathcal{T}}\left|\mathbb{E}_{uv}R(uv)A(uv)\right|,

the edge-by-edge comparison gives, for sufficiently large nn,

∣EG(W)−EG(Z)∣≤(1+4(s2))∥W−Z∥T.(2)\left|\mathcal{E}_G(W)-\mathcal{E}_G(Z)\right|\leq\left(1+4\binom{s}{2}\right)\lVert W-Z\rVert_{\mathcal{T}}. \tag*{(2)}

This is the counting lemma needed by the proof.

The use of restrictions of the tester is inspired by Dwork and Tankala [19, Definition 3.1 and Lemma 3.2]. Here, the tester observes an induced graph, so its queried pairs share vertices. The endpoint labels retain these shared incidences and make the resulting tests compatible with sampling vertices.

A weak regularity argument now provides the required approximation. Starting from GG, maintain a sum of signed tests and use its clipped value as the current approximation. Whenever a test distinguishes this approximation from a target weighted graph HH, add a small signed multiple of that test to the sum. A bounded potential shows that fewer than γ−2\gamma^{-2} updates suffice to obtain

W=clip⁡(G+γ∑j=1tBj),t<γ−2,∥H−W∥T≤γ.W=\operatorname{clip}\left(G+\gamma\sum_{j=1}^{t}B_j\right),\qquad t<\gamma^{-2},\qquad\lVert H-W\rVert_{\mathcal{T}}\leq\gamma.

where Bj∈T∪(−T)B_j\in\mathcal{T}\cup(-\mathcal{T}) and clip⁡(a)=min⁡{1,max⁡{0,a}}\operatorname{clip}(a)=\min\{1,\max\{0,a\}\}. This is a form of weak regularity adapted to the tester, following the energy-increment principle of Frieze and Kannan [18] and the boosting perspective of Trevisan, Tulsiani and Vadhan [20].

Combining the descriptions of the tests gives a label zvz_v at each vertex, drawn from a finite set Λ\Lambda with log⁡∣Λ∣=O(s2γ−2)\log|\Lambda| = O(s^2\gamma^{-2}). The approximating weighted graph is recovered by a fixed symmetric function DD:

Wz(uv)=D(G(uv),zu,zv).(3)W_z(uv) = D\bigl(G(uv), z_u, z_v\bigr). \tag*{(3)}

Thus, the labels describe the approximation relative to the original graph GG. Common values are included in each label, and DD is defined for every pair of labels, including pairs whose common values disagree. Every labeling therefore specifies a valid weighted graph, while the boosting argument guarantees that some labeling approximates any given target HH. Taking γ\gamma to be a sufficiently small constant multiple of ε/s2\varepsilon/s^2, equation (2) gives

M(G)≤M~(G):=min⁡z∈ΛVEG(Wz)≤M(G)+O(ε),log⁡∣Λ∣=O(s6ε−2).M(G) \le\widetilde{M}(G) := \min_{z\in\Lambda^V} \mathcal{E}_G(W_z) \le M(G) + O(\varepsilon), \qquad\log|\Lambda| = O(s^6\varepsilon^{-2}).

The number of possible labels may be exponential, but their length is polynomial in ss and 1/ε1/\varepsilon.

Estimating the optimum by sampling vertices. For a fixed labeling, both terms of EG(Wz)\mathcal{E}_G(W_z) can be written as averages of losses on ordered ss-tuples of distinct vertices. The rejection term already has this form; for the edit term, average the edge-edit losses over the (s2)\binom{s}{2} pairs in the tuple. By equation (3), the loss on a tuple depends only on its induced subgraph in GG and the labels of its vertices.

It follows that minimizing EG(Wz)\mathcal{E}_G(W_z) is a dense ss-ary constraint satisfaction problem with alphabet Λ\Lambda. Each vertex is a variable, its possible labels are the alphabet, and each tuple contributes one bounded loss. Sampling a set UU of vertices restricts this same instance to UU; the decoder and the rejection rule fnf_n remain fixed. This is why labels on vertices are useful.

The subsampling theorem of Bernasconi, Castiglioni, Celli, Farina, and Malavolta [21 Theorem 3.3] approximates the optimum in expectation using a sample whose size is polynomial in the arity, the inverse accuracy, and the logarithm of the alphabet size. The theorem also requires a lower bound on the original instance size, polynomial in the same parameters. Both requirements are satisfied here. Small input graphs can be read in full; for larger graphs, averaging a polynomial number of independent sample optima gives the required success probability.

The sampled optimum can be computed by exhaustive search over labels, using only the edges inside the sampled vertex sets. Combining this estimate with the short-description approximation and equation (1) yields an estimate of dist⁡(G,P)\operatorname{dist}(G,\mathcal{P}) with query complexity

poly⁡(s,1/ε)=poly⁡(max⁡{1,q(cε)},1/ε).\operatorname{poly}(s,1/\varepsilon)=\operatorname{poly}\bigl(\max\{1,q(c\varepsilon)\},1/\varepsilon\bigr).

The polynomial dependence on the arity and the logarithmic dependence on the number of labels are both essential: the arity grows with the tester, and the label set is exponentially large. The boosting argument establishes the existence of a suitable description, and the estimator only computes optimum values on its samples.

Preliminaries

We first put the tester into a form that can be applied to weighted graphs. The weights let us describe gradual changes to a candidate repair. Independent rounding will then show that introducing weights does not change the optimum of the objective function introduced in Section 2.

For every integer k≥0k\ge0, let [k]={1,…,k}[k]=\{1,\ldots,k\}, with [0]=∅[0]=\varnothing. For integers a,ba,b, let [a,b]={j∈Z:a≤j≤b}[a,b]=\{j\in\mathbb{Z}:a\le j\le b\}; in particular, [3,2]=∅[3,2]=\varnothing. Given a set XX, write (Xk)\binom{X}{k} for its kk-element subsets and X↗kX_{\nearrow}^{k} for its ordered kk-tuples of pairwise distinct elements. The set X↗0X_{\nearrow}^{0} consists of the empty tuple. For 0≤k≤n0\le k\le n, write (n)k=n(n−1)⋯(n−k+1)(n)_k=n(n-1)\cdots(n-k+1), with (n)0=1(n)_0=1. For distinct u,v∈Xu,v\in X, write uv={u,v}uv = \{u,v\}. All logarithms have base 2. Unless stated otherwise, averages over a finite set are uniform. The empty-set conventions allow a tester with s=2s = 2 to have no anchors.

Let VV be a finite set. A graph on VV is a function G:(V2)→{0,1}G : \binom{V}{2} \to\{0,1\}. The set of these is GV\mathcal{G}_V. A weighted graph on VV is a function W:(V2)→[0,1]W : \binom{V}{2} \to[0,1]. The value W(uv)W(uv) represents the probability that uvuv is an edge. The set of these is WV\mathcal{W}_V. We have that GV⊆WV\mathcal{G}_V \subseteq\mathcal{W}_V, indeed unweighted graphs are a special case of weighted graphs. Note that when ∣V∣<2|V| < 2, (V2)=∅\binom{V}{2} = \varnothing, and GV=WV\mathcal{G}_V = \mathcal{W}_V consist of the unique empty function.

For V=[s]V = [s], we use the following shorthands Gs\mathcal{G}_s, Ws\mathcal{W}_s. For W∈WVW \in\mathcal{W}_V, G(W)\mathcal{G}(W) is the random graph in GV\mathcal{G}_V whose edges are sampled independently at random with Pr⁡[G(W)(e)=1]=W(e)\Pr[\mathcal{G}(W)(e) = 1] = W(e). If WW is a graph, G(W)=W\mathcal{G}(W) = W. For v=(v1,…,vs)∈V↗sv = (v_1,\ldots,v_s) \in V_{\nearrow}^{s}, the induced weighted graph W[v]∈WsW[v] \in\mathcal{W}_s is W[v](ab)=W(vavb)W[v](ab) = W(v_av_b).

Let n=∣V∣≥2n = |V| \ge2. For functions X,Y:(V2)→RX,Y : \binom{V}{2} \to\mathbb{R}, let Ee\mathbb{E}_e denote expectation over a uniformly random unordered pair e∈(V2)e \in\binom{V}{2}, and define ⟨X,Y⟩=Ee[X(e)Y(e)]\langle X,Y\rangle= \mathbb{E}_e[X(e)Y(e)], and ∥X∥2=⟨X,X⟩1/2\|X\|_2 = \langle X,X\rangle^{1/2}. Thus, inner products measure average correlation, independently of the order of the graph. Averages indexed by uvuv use the same unordered-pair convention; when ordered pairs are needed, we write them as (u,v)(u,v). We use 1\mathbf{1} to denote the constant function 11, and 1[B]\mathbf{1}[\mathcal{B}] for the indicator of a condition B\mathcal{B}. The distance between graphs G,H∈GVG,H \in\mathcal{G}_V is given by

d(G,H)=Ee∣G(e)−H(e)∣=∣E(G)△E(H)∣(n2)∈[0,1].d(G,H) = \mathbb{E}_e|G(e)-H(e)| = \frac{|E(G)\mathbin{\triangle}E(H)|}{\binom{n}{2}} \in[0,1].

A graph property P\mathcal{P} is a set of graphs closed under isomorphism, and PV=P∩GV\mathcal{P}_V = \mathcal{P} \cap\mathcal{G}_V. The distance to P\mathcal{P} is

dist⁡(G,P)={min⁡H∈PVd(G,H)PV≠∅, n≥2,1PV=∅,0PV≠∅, n<2.\operatorname{dist}(G,\mathcal{P}) = \begin{cases} \min_{H \in\mathcal{P}_V} d(G,H) & \mathcal{P}_V \ne\varnothing,\ n \ge2,\\ 1 & \mathcal{P}_V = \varnothing,\\ 0 & \mathcal{P}_V \ne\varnothing,\ n < 2. \end{cases}

GG is ε\varepsilon-far from P\mathcal{P} if dist⁡(G,P)≥ε\operatorname{dist}(G,\mathcal{P}) \ge\varepsilon. For graphs G,JG,J with PV≠∅\mathcal{P}_V \ne\varnothing, dist⁡(G,P)≤d(G,J)+dist⁡(J,P)\operatorname{dist}(G,\mathcal{P}) \le d(G,J) + \operatorname{dist}(J,\mathcal{P}).

The next proposition replaces the internal operation of the tester by a single rejection rule on a small induced graph. This is useful because we can then study how that rule changes when one sampled edge changes. Amplification makes rejection rare on graphs in the property; this will make the penalty small for a genuine repair. The original input order nn remains available to the tester, so its rule is allowed to depend on nn.

We use the canonization theorem of Goldreich and Trevisan [2] in the following functional form.

Proposition 1. Let P\mathcal{P} be a property. Fix τ∈(0,1/3]\tau\in(0,1/3] and a τ\tau-tester for P\mathcal{P} that requires at most q(τ)q(\tau) queries. Then, there exist an integer s=O(max⁡{1,q(τ)}log⁡(1/τ))≥2s = O(\max\{1,q(\tau)\}\log(1/\tau)) \ge2 and, for each n≥sn \ge s, a function f=fn:Gs→[0,1]∩Qf = f_n : \mathcal{G}_s \to[0,1] \cap\mathbb{Q}, where f(J)f(J) is the probability of rejecting when the induced graph on the ss sampled vertices is JJ, such that the following two conditions hold:

(N1) f(J∘σ)=f(J)f(J \circ\sigma) = f(J) for all J∈GsJ \in\mathcal{G}_s and σ∈Sym⁡([s])\sigma\in\operatorname{Sym}([s]), where (J∘σ)(ab)=J(σ(a)σ(b))(J \circ\sigma)(ab) = J(\sigma(a)\sigma(b));

(N2) for every VV with ∣V∣=n|V| = n and J∈GVJ \in\mathcal{G}_V, writing rej⁡(J)=Evf(J[v])\operatorname{rej}(J) = \mathbb{E}_v f(J[v]) with vv uniform in V↗sV_{\nearrow}^{s},

{J∈P⇒rej⁡(J)≤τ,dist⁡(J,P)≥τ⇒rej⁡(J)≥23.(4)\begin{cases} J \in\mathcal{P} & \Rightarrow\operatorname{rej}(J) \le\tau,\\ \operatorname{dist}(J,\mathcal{P}) \ge\tau& \Rightarrow\operatorname{rej}(J) \ge\frac{2}{3}. \tag*{(4)} \end{cases}

Proof. Amplify the tester by O(log⁡(1/τ))O(\log(1/\tau)) independent repetitions and a majority vote, so that its rejection probability is at most τ\tau on members and at least 2/32/3 on τ\tau-far graphs. Apply the canonization theorem [2] to obtain a tester inspecting s=O(max⁡{1,q(τ)}log⁡(1/τ))s = O(\max\{1,q(\tau)\}\log(1/\tau)) uniformly sampled vertices, padding to s≥2s \ge2 if necessary. Average its decision rule over all permutations of the sampled positions. This does not change the rejection probability on any input graph, and gives (N1). The function fnf_n is the resulting conditional rejection probability, giving (N2). With the usual finite-randomness convention for a randomized tester, these probabilities are rational.

From now on, nn and its associated rule f=fnf=f_n are fixed whenever we compare graphs on VV. In particular, restricting an optimization problem to a smaller vertex set later in the proof will not replace fnf_n by the tester for that smaller order.

Recall that a function g:WV→Rg:\mathcal{W}_V\to\mathbb{R} is multilinear if it is affine in each coordinate W(e)W(e) separately. Such a function treats an edge of weight pp exactly as an average of an absent edge and a present edge, with weights 1−p1-p and pp. The next fact applies this observation to all edges: a weighted input cannot have a value smaller than every ordinary graph obtained by rounding it.

Fact 1. If g:WV→Rg:\mathcal{W}_V\to\mathbb{R} is multilinear, then g(W)=E g(G(W))g(W)=\mathbb{E}\,g(G(W)) for every W∈WVW\in\mathcal{W}_V. Hence, min⁡WVg=min⁡GVg\min_{\mathcal{W}_V}g=\min_{\mathcal{G}_V}g.

Proof. We round one edge at a time. Affinity in the edge being rounded preserves the expected value at each step, and after all steps we have an ordinary graph. List the pairs e1,…,eNe_1,\ldots,e_N, N=(n2)N=\binom{n}{2}, and write Wi=W(ei)W_i=W(e_i). For 0≤k≤N0\le k\le N, let

gk(W)=∑x∈{0,1}kg(x,Wk+1,…,WN)∏i≤kWixi(1−Wi)1−xi.g_k(W)=\sum_{x\in\{0,1\}^k}g(x,W_{k+1},\ldots,W_N)\prod_{i\le k}W_i^{x_i}(1-W_i)^{1-x_i}.

Affinity in Wk+1W_{k+1} gives gk=gk+1g_k=g_{k+1}, and therefore g=g0=gN=E g(G(W))g=g_0=g_N=\mathbb{E}\,g(G(W)). This is a weighted average of values g(J)g(J), J∈GVJ\in\mathcal{G}_V, so it is at least their minimum. The minimum over WV\mathcal{W}_V exists by compactness.

We now extend the tester by interpreting each edge weight as an independent edge probability. The function ϕ\phi is the rejection probability on one weighted sample of size ss; the function rej⁡\operatorname{rej} averages this quantity over all samples in the full graph. Keeping these two levels separate will let us analyze one sampled edge before averaging over the input graph. Define ϕ:Ws→[0,1]\phi:\mathcal{W}_s\to[0,1] and rej⁡:WV→[0,1]\operatorname{rej}:\mathcal{W}_V\to[0,1] by

ϕ(Y)=E f(G(Y))=∑J∈Gsf(J)∏ab∈([s]2)Y(ab)J(ab)(1−Y(ab))1−J(ab),rej⁡(W)=Ev∈Vsϕ(W[v]).\begin{aligned} \phi(Y)&=\mathbb{E}\,f(G(Y))=\sum_{J\in\mathcal{G}_s}f(J)\prod_{ab\in\binom{[s]}{2}}Y(ab)^{J(ab)}(1-Y(ab))^{1-J(ab)},\\ \operatorname{rej}(W)&=\mathbb{E}_{v\in V^s}\phi(W[v]). \end{aligned}

The next fact says that the extension retains relabeling symmetry and is compatible with rounding. Thus we may either round the whole graph and run the tester, or sample first and then round the sampled edges.

Fact 2. The following properties hold:

(a) ϕ(Y∘σ)=ϕ(Y)\phi(Y\circ\sigma)=\phi(Y) for Y∈WsY\in\mathcal{W}_s, σ∈Sym⁡([s])\sigma\in\operatorname{Sym}([s]);

(b) ϕ\phi and rej⁡\operatorname{rej} are multilinear;

(c) rej⁡(W)=E rej⁡(G(W))\operatorname{rej}(W)=\mathbb{E}\,\operatorname{rej}(G(W)), and on graphs this rej⁡\operatorname{rej} agrees with that of (N2).

Proof. Each assertion follows because relabeling and taking an induced sample preserve the independent-edge model. More explicitly:

(a) G(Y∘σ)G(Y\circ\sigma) has the law of G(Y)∘σG(Y)\circ\sigma; use (N1).

(b) Each summand of ϕ\phi is a product of factors affine in distinct coordinates, and rej⁡\operatorname{rej} is an average of ϕ\phi composed with coordinate projections.

(c) Fact 1; on graphs ϕ(J[v])=f(J[v])\phi(J[v])=f(J[v]).

Proofs

Derivatives of the tester, tests, and the counting lemma

The first step is to identify which features of a candidate repair need to be preserved. There are only two relevant quantities: its expected edit cost and its rejection probability. We will construct a family of pair functions whose correlations control changes in both quantities.

Fix 0<τ≤1/30 < \tau\le1/3 and s,f=fns, f = f_n as in Proposition 1. Let G∈GVG \in\mathcal{G}_V with n≥sn \ge s, and put K=(s2)K = \binom{s}{2}, the number of pairs inspected in a canonical sample. Recall the definitions of cost⁡G:WV→[0,1]\operatorname{cost}_G : \mathcal{W}_V \to[0,1] and EG:WV→[0,3]\mathcal{E}_G : \mathcal{W}_V \to[0,3]:

cost⁡G(W)=E d(G,G(W)),EG(W)=cost⁡G(W)+2rej⁡(W),M(G)=min⁡W∈WVEG(W).\operatorname{cost}_G(W) = \mathbb{E}\,d(G,\mathcal{G}(W)), \qquad\mathcal{E}_G(W) = \operatorname{cost}_G(W)+2\operatorname{rej}(W), \qquad M(G) = \min_{W\in\mathcal{W}_V} \mathcal{E}_G(W).

The objective charges for editing the graph and for leaving a graph that the tester is likely to reject. We first observe that the edit part is particularly simple: on a non-edge of GG, increasing the weight increases the cost, while on an edge of GG it decreases the cost. The function 1−2G1-2G records exactly these two signs.

Fact 3. The function cost⁡G:WV→[0,1]\operatorname{cost}_G : \mathcal{W}_V \to[0,1] satisfies the equality cost⁡G(W)=⟨G,1⟩+⟨W,1−2G⟩\operatorname{cost}_G(W) = \langle G,1\rangle+\langle W,1-2G\rangle. In particular, cost⁡G\operatorname{cost}_G is affine and cost⁡G(J)=d(G,J)\operatorname{cost}_G(J) = d(G,J) for J∈GVJ \in\mathcal{G}_V.

Proof. Compute the cost for one pair, then average over pairs and over the rounding. For a,b∈{0,1}a,b \in\{0,1\}, ∣a−b∣=a+b−2ab|a-b| = a+b-2ab. So d(G,H)=⟨G,1⟩+⟨H,1−2G⟩d(G,H) = \langle G,1\rangle+\langle H,1-2G\rangle for graphs HH. Take expectations, using E G(W)(e)=W(e)\mathbb{E}\,\mathcal{G}(W)(e) = W(e).

The next lemma explains why we can minimize this objective instead of searching only over graphs in P\mathcal{P}. A genuine repair has a small penalty. A graph that remains far from P\mathcal{P} pays more than the largest possible edit distance, while a graph already close to P\mathcal{P} cannot save much on the cost of a genuine repair. Independent rounding also shows that fractional edge weights introduce no better minimum.

Lemma 1. The weighted and unweighted minima agree, i.e., M(G)=min⁡J∈GV{d(G,J)+2rej⁡(J)}M(G) = \min_{J\in\mathcal{G}_V}\{d(G,J)+2\operatorname{rej}(J)\}. Further, if PV≠∅\mathcal{P}_V \ne\varnothing, then dist⁡(G,P)−τ≤M(G)≤dist⁡(G,P)+2τ\operatorname{dist}(G,\mathcal{P})-\tau\le M(G) \le\operatorname{dist}(G,\mathcal{P})+2\tau.

Proof. We first remove the weights using rounding, then compare an arbitrary candidate with a closest genuine repair. By Facts 3 and 2, EG\mathcal{E}_G is multilinear, so Fact 1 gives the equality. For the distance bounds, assume PV≠∅\mathcal{P}_V \ne\varnothing. For the upper bound, take H∈PVH \in\mathcal{P}_V with d(G,H)=dist⁡(G,P)d(G,H) = \operatorname{dist}(G,\mathcal{P}). By (4), EG(H)≤dist⁡(G,P)+2τ\mathcal{E}_G(H) \le\operatorname{dist}(G,\mathcal{P})+2\tau. For the lower bound, let J∈GVJ \in\mathcal{G}_V. If dist⁡(J,P)<τ\operatorname{dist}(J,\mathcal{P}) < \tau, then d(G,J)≥dist⁡(G,P)−dist⁡(J,P)>dist⁡(G,P)−τd(G,J) \ge\operatorname{dist}(G,\mathcal{P})-\operatorname{dist}(J,\mathcal{P}) > \operatorname{dist}(G,\mathcal{P})-\tau. If dist⁡(J,P)≥τ\operatorname{dist}(J,\mathcal{P}) \ge\tau, then 2rej⁡(J)≥4/3>1≥dist⁡(G,P)2\operatorname{rej}(J) \ge4/3 > 1 \ge\operatorname{dist}(G,\mathcal{P}) by (4). Either way EG(J)≥dist⁡(G,P)−τ\mathcal{E}_G(J) \ge\operatorname{dist}(G,\mathcal{P})-\tau.

The coefficient 2 makes the lower-bound comparison work: a τ\tau-far graph has penalty at least 4/3>1≥dist⁡(G,P)4/3 > 1 \ge\operatorname{dist}(G,\mathcal{P}). With coefficient 1, the soundness guarantee would give a penalty of only 2/32/3, which could be too small to prevent such a graph from undercutting the true distance.

We next isolate the information needed to measure the effect of one sampled edge. Designate its endpoints as positions 1 and 2, and call positions 3,…,s3,\ldots,s the anchors. Once the graph on the anchors and the two endpoint-to-anchor adjacency vectors are fixed, the sampled graph is completely determined except for the edge 12. The gadget below simply records this decomposition; it adds no further graph structure.

Definition 1 (Gadget FtF_t). For a graph b∈G[3,s]b \in\mathcal{G}_{[3,s]}, vectors x,y∈{0,1}[s]x,y \in\{0,1\}^{[s]} and integer t∈{0,1}t \in\{0,1\}, let Ft(b,x,y):([s]2)→{0,1}F_t(b,x,y) : \binom{[s]}{2} \to\{0,1\} be the graph on [s][s] given by:

  • Ft(b,x,y)({1,2})=tF_t(b,x,y)(\{1,2\}) = t;

  • Ft(b,x,y)({1,a})=xaF_t(b,x,y)(\{1,a\})=x_a for every a∈[3,s]a\in[3,s];

  • Ft(b,x,y)({2,a})=yaF_t(b,x,y)(\{2,a\})=y_a for every a∈[3,s]a\in[3,s];

  • Ft(b,x,y)({a,c})=b({a,c})F_t(b,x,y)(\{a,c\})=b(\{a,c\}) for every a≠c∈[3,s]a\ne c\in[3,s].

So xax_a encodes whether position 1 is adjacent to anchor aa, yay_a does the same for position 2, bb is the graph induced on the anchors, and tt is the value of the edge {1,2}\{1,2\}.

The derivative below measures how much the tester notices a change to the remaining edge. It can be positive or negative, since adding an edge need not make rejection more likely. This discrete difference is also the coefficient of the edge probability when the other sampled edges have been fixed.

Definition 2 (Derivative of ff). The derivative of ff in the edge 12 at bb is ∂bf:{0,1}[3,s]×{0,1}[3,s]→[−1,1]\partial_b f:\{0,1\}^{[3,s]}\times\{0,1\}^{[3,s]}\to[-1,1]:

∂bf(x,y)=f(F1(b,x,y))−f(F0(b,x,y)).\partial_b f(x,y)=f(F_1(b,x,y))-f(F_0(b,x,y)).

To compare two weighted graphs, we will replace the KK sampled edge probabilities one at a time. At an intermediate stage, some positions use weights from the first graph and others from the second. A vertex can therefore need one adjacency vector when it occupies endpoint position 1 and another when it occupies position 2. We store both vectors in a single color. The extra color ⊥\perp marks the anchors themselves, so that a test ignores pairs meeting an anchor.

Let Ω={⊥}⊔({0,1}[3,s]×{0,1}[3,s])\Omega=\{\perp\}\sqcup\left(\{0,1\}^{[3,s]}\times\{0,1\}^{[3,s]}\right). For each b∈G[3,s]b\in\mathcal{G}_{[3,s]}, define the symmetric function κb:Ω×Ω→[−1,1]\kappa_b:\Omega\times\Omega\to[-1,1] by

κb((x,y),(x′,y′))=12(∂bf(x,y′)+∂bf(x′,y)),κb(⊥,ω)=κb(ω,⊥)=0.\begin{aligned} \kappa_b\left((x,y),(x',y')\right)&=\frac{1}{2}\left(\partial_b f(x,y')+\partial_b f(x',y)\right),\\ \kappa_b(\perp,\omega)&=\kappa_b(\omega,\perp)=0. \end{aligned}

By (N1), ∂bf(x,y)=∂bf(y,x)\partial_b f(x,y)=\partial_b f(y,x): exchanging positions 1 and 2 is a relabeling. The reason for averaging in κb\kappa_b is different. The role-dependent expression ∂bf(x,y′)\partial_b f(x,y') need not equal ∂bf(x′,y)\partial_b f(x',y) when the two vertices have different vectors for their two roles. Averaging these two orientations makes the test a well-defined function of an unordered pair.

A coloring χ:V→Ω\chi:V\to\Omega assigns this local information to every vertex. For each bb and χ\chi, define the test Ab,χ(uw)=κb(χ(u),χ(w))A_{b,\chi}(uw)=\kappa_b(\chi(u),\chi(w)). Thus a single coloring describes the response to every possible endpoint pair, with the same anchor graph bb. We allow all colorings; they need not come from actual neighborhoods in one graph. This larger family contains the random colorings used in the counting proof and is easy to encode by vertex labels.

Set

A={Ab,χ:b∈G[3,s], χ:V→Ω},T=T(G)={1−2G}∪A.\mathcal{A}=\{A_{b,\chi}:b\in\mathcal{G}_{[3,s]},\ \chi:V\to\Omega\},\qquad\mathcal{T}=\mathcal{T}(G)=\{1-2G\}\cup\mathcal{A}.

For R:(V2)→RR:\binom{V}{2}\to\mathbb{R}, define

∥R∥T=max⁡A∈T∣⟨R,A⟩∣.\lVert R\rVert_{\mathcal{T}}=\max_{A\in\mathcal{T}}|\langle R,A\rangle|.

This seminorm measures the largest average discrepancy visible to any of these tests. A small value of ∥W−Z∥T\lVert W-Z\rVert_{\mathcal{T}} means that the tests have little ability to distinguish WW from ZZ; it does not assert that every edge weight is close. The cost test 1−2G1-2G is included because its correlation is exactly the change in edit cost.

Every test takes values in [−1,1][-1,1]. A derivative test is specified by O(s2)O(s^2) common bits for bb and O(s)O(s) bits per vertex for χ(v)\chi(v). The cost test is instead recovered directly from the input edge G(uv)G(uv). This distinction will explain why the decoder later reads both endpoint labels and the original edge.

Example (s=3s=3, triangles). Consider the rejection rule f(J)=1[J is a triangle]f(J)=\mathbf{1}[J\text{ is a triangle}]. There is one anchor, so bb has no edges and ∂bf(x,y)=xy\partial_b f(x,y)=xy for x,y∈{0,1}x,y\in\{0,1\}. Fix an anchor vertex ww in an ordinary graph JJ, and write NJ(w)N_J(w) for its neighborhood. Give ww color ⊥\perp and every other vertex vv the color (1[v∈NJ(w)],1[v∈NJ(w)])(1[v \in N_J(w)],1[v \in N_J(w)]). Then

Ab,χ(uv)=1[u∈NJ(w)]1[v∈NJ(w)].A_{b,\chi}(uv)=1[u \in N_J(w)]1[v \in N_J(w)].

The test detects changes on pairs inside the neighborhood of ww. Summing these indicators over ww counts common neighbors of uu and vv: these are exactly the vertices that can complete the changing edge to a triangle. The general derivative tests play the same role for an arbitrary rejection rule. The counting lemma says that these tests capture everything needed to control the objective. For some intuition towards the proof of the counting lemma, we continue with the triangle example. Let WW and ZZ be two graphs that have a large difference in their rejection probabilities (and for simplicity assume the edge weights are from {0,1}\{0,1\}). In other words, taking a random sample SS of 3 vertices, the probability that the induced subgraph is a triangle is significantly different for WW compared to ZZ. We wish to show that there exists A∈TA \in\mathcal{T} for which ⟨W−Z,A⟩\langle W-Z,A\rangle is large.

To this end, consider a specific ordering e1,e2,e3e_1,e_2,e_3 of the edge locations between the 3 sampled vertices SS, and consider interpolating between W[S]W[S] and Z[S]Z[S] by starting with W[S]W[S] and changing one edge at a time, in the order e1,e2,e3e_1,e_2,e_3, until reaching Z[S]Z[S]. For the sets SS for which the rejection rule differs for WW and ZZ, there is some point in the interpolation for which the output of the rejection rule changes. By considering all such sets SS, there exists a step in the interpolation at which the rejection rule changes for a significant fraction of these sets.

After selecting an anchor graph bb on a single vertex ww, we construct Ab,χA_{b,\chi} using an interpolated version of WW and ZZ to define the labeling χ\chi. Roughly speaking, the entries in Ab,χA_{b,\chi} correspond to pairs of vertices u,vu,v for which the output of the rejection rule on the interpolated subgraph changes when flipping the edge u,vu,v. These entries in Ab,χA_{b,\chi} line up with non-zero entries in W−ZW-Z, resulting in ⟨W−Z,Ab,χ⟩\langle W-Z,A_{b,\chi}\rangle being large.

More generally, ss is the canonical sample size and K=(s2)K=\binom{s}{2}. There are KK possible edge changes in a sample; bounding each one by the seminorm and summing gives the dependence on KK.

Lemma 2 (Counting). If n≥4sn \geq4s then for all W,Z∈WVW,Z \in\mathcal{W}_V,

∣rej⁡(W)−rej⁡(Z)∣≤2K∥W−Z∥T,∣EG(W)−EG(Z)∣≤(1+4K)∥W−Z∥T.\begin{aligned} |\operatorname{rej}(W)-\operatorname{rej}(Z)| &\leq2K\lVert W-Z\rVert_{\mathcal{T}},\\ |\mathcal{E}_G(W)-\mathcal{E}_G(Z)| &\leq(1+4K)\lVert W-Z\rVert_{\mathcal{T}}. \end{aligned}

Proof. We interpolate between ZZ and WW on one sampled pair at a time. For each step, we express the tester’s response as an average of derivative tests. The only normalization loss comes from excluding the anchors as endpoints.

List the pairs of positions e1,…,eKe_1,\ldots,e_K of [s][s]. For 0≤i≤K0 \leq i \leq K and v∈Vsv \in V^s define Hi(v)∈WsH_i(v) \in\mathcal{W}_s by Hi(v)(ej)=W(vavb)H_i(v)(e_j)=W(v_av_b) if j≤ij \leq i and Z(vavb)Z(v_av_b) if j>ij>i, where ej=abe_j=ab. Let ρi=Evϕ(Hi(v))\rho_i=\mathbb{E}_{v}\phi(H_i(v)). Then ρ0=rej⁡(Z)\rho_0=\operatorname{rej}(Z) and ρK=rej⁡(W)\rho_K=\operatorname{rej}(W).

Fix i≥1i \geq1, ei=abe_i=ab. For Y∈WsY \in\mathcal{W}_s let Y[t]Y^{[t]} be YY with its value on abab replaced by t∈{0,1}t \in\{0,1\}, and Δ(Y)=ϕ(Y[1])−ϕ(Y[0])∈[−1,1]\Delta(Y)=\phi(Y^{[1]})-\phi(Y^{[0]}) \in[-1,1]. Since ϕ\phi is affine in Y(ab)Y(ab) and Hi(v),Hi−1(v)H_i(v),H_{i-1}(v) differ only on abab,

ρi−ρi−1=Ev[(W−Z)(vavb)Δ(Hi(v))].\rho_i-\rho_{i-1}=\mathbb{E}_v\left[(W-Z)(v_av_b)\Delta(H_i(v))\right].

By Fact 2(a), we may relabel both the changing pair and the sampled positions without changing the derivative value or the sampling law. Thus we may assume ei=12e_i=12; each other pair cdcd then carries a label mcd∈{W,Z}m_{cd}\in\{W,Z\} saying which function is used on it. Write v=(p,q,w)v=(p,q,w) with p=v1p=v_1, q=v2q=v_2, w=(vc)c∈[3,s]w=(v_c)_{c\in[3,s]}, and let Δ(p,q,w)=Δ(N)\Delta(p,q,w)=\Delta(N) where N(cd)=mcd(vcvd)N(cd)=m_{cd}(v_cv_d) for cd≠12cd\neq12 and, say, N(12)=0N(12)=0. The last value is immaterial because the derivative overwrites it. Then

ρi−ρi−1=E(p,q,w)[(W−Z)(pq)Δ(p,q,w)].(5)\rho_i-\rho_{i-1}=\mathbb{E}_{(p,q,w)}\left[(W-Z)(pq)\Delta(p,q,w)\right]. \tag*{(5)}

Fix w∈V≠s−2w \in V_{\ne}^{s-2}. To realize the derivative by our tests, round the anchor graph once and independently round the two role-dependent adjacency vectors of each non-anchor vertex. Different pairs may share these random bits; we only need the correct distribution for each individual pair.

Let bb be a random graph on [3,s][3,s] with independent edges, Pr⁡[b(cd)=1]=mcd(wcwd)\Pr[b(cd)=1] = m_{cd}(w_cw_d). For each u∉{wc}u \notin\{w_c\} let Xu,Yu∈{0,1}[3,s]X_u,Y_u \in\{0,1\}^{[3,s]} have independent coordinates with Pr⁡[Xu(c)=1]=m1c(uwc)\Pr[X_u(c)=1] = m_{1c}(uw_c) and Pr⁡[Yu(c)=1]=m2c(uwc)\Pr[Y_u(c)=1] = m_{2c}(uw_c), all variables independent. Let χ(u)=(Xu,Yu)\chi(u)=(X_u,Y_u) for u∉{wc}u \notin\{w_c\}, χ(wc)=⊥\chi(w_c)=\perp, and A=Ab,χA=A_{b,\chi}, a random element of A⊆T\mathcal{A} \subseteq\mathcal{T}. For distinct non-anchors p,qp,q, the graph Ft(b,Xp,Yq)F_t(b,X_p,Y_q) has independent edges with exactly the probabilities of N[t]N^{[t]}. Hence Ef(Ft(b,Xp,Yq))=ϕ(N[t])\mathbb{E}f(F_t(b,X_p,Y_q))=\phi(N^{[t]}), so E ∂bf(Xp,Yq)=Δ(p,q,w)\mathbb{E}\,\partial_bf(X_p,Y_q)=\Delta(p,q,w) and

EA(pq)=12(Δ(p,q,w)+Δ(q,p,w)).\mathbb{E}A(pq)=\frac{1}{2}\bigl(\Delta(p,q,w)+\Delta(q,p,w)\bigr).

while A(pq)=0A(pq)=0 if pp or qq is an anchor.

The color ⊥\perp makes all anchor-incident pairs contribute zero. Our inner product nevertheless averages over all pairs in VV, whereas the hybrid step averages only over pairs avoiding the anchors. We now account for this normalization explicitly. Summing over unordered pairs, and using that (W−Z)(pq)(W-Z)(pq) is a function of the unordered pair,

EA⟨W−Z,A⟩=1n(n−1)∑(p,q)(W−Z)(pq)Δ(p,q,w),\mathbb{E}_{A}\langle W-Z,A\rangle =\frac{1}{n(n-1)}\sum_{(p,q)}(W-Z)(pq)\Delta(p,q,w),

the sum over ordered pairs of distinct non-anchors. There are (n−s+2)(n−s+1)(n-s+2)(n-s+1) of them, and (n)s=(n)s−2(n−s+2)(n−s+1)(n)_s=(n)_{s-2}(n-s+2)(n-s+1). Averaging over uniform ww and comparing with (5),

E⟨W−Z,A⟩=α(ρi−ρi−1),α=(n−s+2)(n−s+1)n(n−1).\mathbb{E}\langle W-Z,A\rangle=\alpha(\rho_i-\rho_{i-1}), \qquad \alpha=\frac{(n-s+2)(n-s+1)}{n(n-1)}.

Here α\alpha is the proportion of ordered pairs avoiding the anchors. Since n≥4sn\ge4s,

α≥(n−s+1n)2>12.\alpha\ge\left(\frac{n-s+1}{n}\right)^2>\frac{1}{2}.

Every realization of AA lies in T\mathcal{T}, so ∣⟨W−Z,A⟩∣≤∥W−Z∥T|\langle W-Z,A\rangle|\le\|W-Z\|_{\mathcal{T}}, and therefore ∣ρi−ρi−1∣≤2∥W−Z∥T|\rho_i-\rho_{i-1}|\le2\|W-Z\|_{\mathcal{T}}. Summing over ii gives ∣rej⁡(W)−rej⁡(Z)∣≤2K∥W−Z∥T|\operatorname{rej}(W)-\operatorname{rej}(Z)|\le2K\|W-Z\|_{\mathcal{T}}. By Fact 3 and 1−2G∈T1-2G\in\mathcal{T}, ∣cost⁡G(W)−cost⁡G(Z)∣=∣⟨W−Z,1−2G⟩∣≤∥W−Z∥T|\operatorname{cost}_G(W)-\operatorname{cost}_G(Z)|=|\langle W-Z,1-2G\rangle|\le\|W-Z\|_{\mathcal{T}}. Add twice the first bound. □\square

Boosting

The counting lemma reduces the task to making every test correlation small. We do this by repeatedly correcting a correlation that is still too large. The sum of the corrections is allowed to be real-valued; clipping converts it into valid edge probabilities. Keeping the un-clipped sum is useful because it is described by a short list of tests.

Define clip⁡:R→[0,1]\operatorname{clip}:\mathbb{R}\to[0,1] by clip⁡(u)=min⁡{1,max⁡{0,u}}\operatorname{clip}(u)=\min\{1,\max\{0,u\}\}, and apply it pointwise to real-valued functions. To track progress, we use a function whose derivative is exactly this clipping operation. Define ψ:R→[0,∞)\psi:\mathbb{R}\to[0,\infty) by

ψ(u)={0u≤0,u2/20≤u≤1,u−12u≥1.\psi(u)= \begin{cases} 0 & u\le0,\\ u^2/2 & 0\le u\le1,\\ u-\frac{1}{2} & u\ge1. \end{cases}

By direct differentiation, ψ∈C1\psi\in C^1, and ψ′=clip⁡\psi'=\operatorname{clip} is 1-Lipschitz. The following two properties explain this choice. The first will make our potential nonnegative; the second bounds the cost of taking an update step:

ψ(u)=sup⁡0≤h≤1(uh−12h2),ψ(u+r)≤ψ(u)+rψ′(u)+12r2.(6)\psi(u)=\sup_{0\le h\le1}\left(uh-\frac{1}{2}h^2\right), \qquad \psi(u+r)\le\psi(u)+r\psi'(u)+\frac{1}{2}r^2. \tag*{(6)}

Indeed, the supremum is attained at h=clip⁡(u)h=\operatorname{clip}(u), and the inequality follows from

ψ(u+r)−ψ(u)−rψ′(u)=∫0r(ψ′(u+t)−ψ′(u)) dt.\psi(u+r)-\psi(u)-r\psi'(u)=\int_{0}^{r}\left(\psi'(u+t)-\psi'(u)\right)\,\mathrm{d}t.

For a target H∈WVH\in W_V, define the potential ΦH:R(V2)→[0,∞)\Phi_H:\mathbb{R}^{\binom{V}{2}}\to[0,\infty), where QQ is the un-clipped sum of the current corrections, by

ΦH(Q)=Ee[ψ(Q(e))−Q(e)H(e)+12H(e)2].\Phi_H(Q)=\mathbb{E}_e\left[\psi(Q(e))-Q(e)H(e)+\frac{1}{2}H(e)^2\right].

It is nonnegative by (6) with h=H(e)h=H(e).

When QQ already takes values in [0,1][0,1], this potential is 12∥Q−H∥22\frac{1}{2}\lVert Q-H\rVert_2^2. Outside that interval, it remains nonnegative and its derivative with respect to QQ is clip⁡(Q)−H\operatorname{clip}(Q)-H. This is the residual we can detect using tests. Thus the potential continues to track useful progress even when the un-clipped sum leaves the interval of valid weights.

The next lemma gives a short description of an approximation to any target HH: fewer than γ−2\gamma^{-2} signed tests suffice. The number of vertices and the number of available tests do not enter this bound.

Lemma 3. Let T\mathcal{T} be a finite nonempty family of functions (V2)→[−1,1]\binom{V}{2}\to[-1,1], let G,H∈WVG,H\in W_V and 0<γ<10<\gamma<1. There exist an integer 0≤t<γ−20\leq t<\gamma^{-2} and B1,…,Bt∈T∪(−T)B_1,\ldots,B_t\in\mathcal{T}\cup(-\mathcal{T}) such that W:=clip⁡(G+γ∑j=1tBj)∈WVW:=\operatorname{clip}\left(G+\gamma\sum_{j=1}^{t}B_j\right)\in W_V satisfies ∥H−W∥T≤γ\lVert H-W\rVert_{\mathcal{T}}\leq\gamma.

Proof. If a test sees an error larger than γ\gamma, move a distance γ\gamma in the sign of that test which reduces the error. The resulting decrease in the potential is at least γ2/2\gamma^2/2, so only a bounded number of such moves is possible.

Set Q0=GQ_0=G. Given QjQ_j, let Wj=clip⁡(Qj)W_j=\operatorname{clip}(Q_j). If ∥H−Wj∥T≤γ\lVert H-W_j\rVert_{\mathcal{T}}\leq\gamma, stop. Otherwise some A∈TA\in\mathcal{T} has ∣⟨H−Wj,A⟩∣>γ\lvert\langle H-W_j,A\rangle\rvert>\gamma; choose Bj+1∈{±A}B_{j+1}\in\{\pm A\} with ⟨H−Wj,Bj+1⟩>γ\langle H-W_j,B_{j+1}\rangle>\gamma and set Qj+1=Qj+γBj+1Q_{j+1}=Q_j+\gamma B_{j+1}. Applying (6) pointwise, with ψ′(Qj)=Wj\psi'(Q_j)=W_j and ∥Bj+1∥2≤1\lVert B_{j+1}\rVert_2\leq1,

ΦH(Qj+1)≤ΦH(Qj)−γ⟨H−Wj,Bj+1⟩+γ22∥Bj+1∥22<ΦH(Qj)−γ22.\Phi_H(Q_{j+1})\leq\Phi_H(Q_j)-\gamma\langle H-W_j,B_{j+1}\rangle+\frac{\gamma^2}{2}\lVert B_{j+1}\rVert_2^2<\Phi_H(Q_j)-\frac{\gamma^2}{2}.

Also ΦH(Q0)=12∥G−H∥22≤12\Phi_H(Q_0)=\frac{1}{2}\lVert G-H\rVert_2^2\leq\frac{1}{2} and ΦH≥0\Phi_H\geq0. After any positive number tt of updates,

0≤ΦH(Qt)<12−tγ22,0\leq\Phi_H(Q_t)<\frac{1}{2}-\frac{t\gamma^2}{2},

so t<γ−2t<\gamma^{-2}. The process must therefore stop within this bound. If no update is needed, t=0t=0 already has the required properties. □

This is gradient descent for the convex potential ΦH\Phi_H, restricted to test directions. The step count γ−2\gamma^{-2} is independent of nn.

We now turn the short list of corrections into information stored at vertices. In each step there is common information, i.e., the kind of test, its sign, and possibly its anchor graph, and, for a derivative test, a color for each vertex. We call the common information a symbol. A vertex label stores one symbol and one color for every possible step, padding unused steps by an empty symbol. This is why the label length depends on the number of boosting steps and on ss, but not on nn.

Here and below, fix 0<γ<10<\gamma<1, and use the family T(G)\mathcal{T}(G) constructed in the preceding subsection.

Let L=⌈γ−2⌉L=\lceil\gamma^{-2}\rceil. The set of symbols is C={∅}⊔({cost⁡}×{±1})⊔({der⁡}×{±1}×G[3,s]),\mathcal{C}=\{\varnothing\}\mathbin{\sqcup}(\{\operatorname{cost}\}\times\{\pm1\})\mathbin{\sqcup}(\{\operatorname{der}\}\times\{\pm1\}\times\mathcal{G}_{[3,s]}), and the label set is Λ=(C×Ω)L\Lambda=(\mathcal{C}\times\Omega)^L. A label z∈Λz\in\Lambda has LL components (cℓ(z),ωℓ(z))∈C×Ω(c_\ell(z),\omega_\ell(z))\in\mathcal{C}\times\Omega, and log⁡∣Λ∣=L(log⁡∣C∣+log⁡∣Ω∣)=O(s2γ−2)\log|\Lambda|=L(\log|\mathcal{C}|+\log|\Omega|)=O(s^2\gamma^{-2}).

The decoder must recover an edge weight from the two endpoint labels and the original edge. A genuine boosting description has matching common symbols at every vertex. We nevertheless define the decoder on arbitrary pairs of labels; the later CSP optimization must be allowed to choose any label at any vertex. If the common symbols disagree, keeping the original edge is a convenient way to return a valid weight.

Define the decoder D:{0,1}×Λ×Λ→[0,1]D : \{0,1\} \times\Lambda\times\Lambda\to[0,1] as follows. For g∈{0,1}g \in\{0,1\} and z,z′∈Λz,z' \in\Lambda:

  • if cℓ(z)≠cℓ(z′)c_{\ell}(z) \ne c_{\ell}(z') for some ℓ\ell, then D(g,z,z′)=gD(g,z,z') = g;

  • otherwise, let cℓ=cℓ(z)=cℓ(z′)c_{\ell} = c_{\ell}(z) = c_{\ell}(z') and set

μℓ={0cℓ=∅,σ(1−2g)cℓ=(cost,σ),σκb(ωℓ(z),ωℓ(z′))cℓ=(der,σ,b),D(g,z,z′)=clip⁡(g+γ∑ℓ=1Lμℓ).\mu_{\ell} = \begin{cases} 0 & c_{\ell} = \varnothing,\\ \sigma(1-2g) & c_{\ell} = (\mathop{\rm cost},\sigma),\\ \sigma\kappa_b\bigl(\omega_{\ell}(z),\omega_{\ell}(z')\bigr) & c_{\ell} = (\mathop{\rm der},\sigma,b), \end{cases} \qquad D(g,z,z') = \operatorname{clip}\left(g+\gamma\sum_{\ell=1}^{L}\mu_{\ell}\right).

The decoder DD is symmetric in (z,z′)(z,z'). For a labeling z:V→Λz : V \to\Lambda, write zv=z(v)z_v = z(v) and define Wz∈WVW_z \in\mathcal{W}_V by Wz(uv)=D(G(uv),zu,zv)W_z(uv) = D\bigl(G(uv),z_u,z_v\bigr).

In particular, every labeling defines a valid weighted graph, even if its symbols are inconsistent. Consistency is needed only for encoding the specific boosting approximation whose existence we have proved.

The next lemma connects the two descriptions: each boosting approximation can be reconstructed from vertex labels. Its final assertion is what makes sampling possible, since a sampled edge can be decoded without knowing any labels outside its endpoints.

Lemma 4. For every G∈GVG \in\mathcal{G}_V and H∈WVH \in\mathcal{W}_V there is z∈ΛVz \in\Lambda^V with ∥H−Wz∥T≤γ\lVert H-W_z\rVert_{\mathcal{T}} \le\gamma, where T=T(G)\mathcal{T}=\mathcal{T}(G). Moreover Wz(uv)W_z(uv) depends only on G(uv)G(uv), zuz_u, zvz_v.

Proof. Record the boosting sequence component by component, duplicating each step’s common symbol at every vertex and keeping its vertex-dependent color locally. Apply Lemma 3 to get Bj=σjAjB_j=\sigma_j A_j, j≤t≤Lj\le t\le L. In component jj, give every vertex the symbol (cost,σj)(\mathop{\rm cost},\sigma_j) and color ⊥\bot if Aj=1−2GA_j=1-2G. Otherwise Aj=Abj,χjA_j=A_{b_j,\chi_j}; give every vertex the symbol (der,σj,bj)(\mathop{\rm der},\sigma_j,b_j) and give vertex vv the color χj(v)\chi_j(v). Components j>tj>t get (∅,⊥)(\varnothing,\bot). All symbols agree across vertices, so DD is in its second case with μj=Bj(uv)\mu_j=B_j(uv) for every uvuv. Thus Wz=clip⁡(G+γ∑jBj)W_z=\operatorname{clip}(G+\gamma\sum_j B_j), the function of Lemma 3. The last claim is the definition of DD.

We can now restrict the search for a repair to weighted graphs specified by labels. Define

M~(G)=min⁡z∈ΛVEG(Wz).\widetilde{M}(G)=\min_{z\in\Lambda^V}\mathcal{E}_G(W_z).

The next proposition says that this restriction loses little: encode a true minimizer of M(G)M(G) and use the counting lemma to bound the change in its objective value. Arbitrary labelings cannot artificially improve on M(G)M(G), because they still decode to genuine weighted graphs.

Proposition 2. For n≥4sn\ge4s, M(G)≤M~(G)≤M(G)+(1+4K)γM(G)\le\widetilde{M}(G)\le M(G)+(1+4K)\gamma, and if PV≠∅\mathcal{P}_V\ne\varnothing,

dist⁡(G,P)−τ≤M~(G)≤dist⁡(G,P)+2τ+(1+4K)γ.\operatorname{dist}(G,\mathcal{P})-\tau \le\widetilde{M}(G) \le\operatorname{dist}(G,\mathcal{P})+2\tau+(1+4K)\gamma.

Proof. The lower bound is immediate from inclusion of the feasible sets; the upper bound follows by approximating one minimizing weighted graph. Since Wz∈WVW_z\in\mathcal{W}_V, we have M~(G)≥M(G)\widetilde{M}(G)\ge M(G). Let H∗H^* attain M(G)M(G) and take zz from Lemma 4 for H=H∗H=H^*. Lemma 2 gives M~(G)≤EG(Wz)≤M(G)+(1+4K)γ\widetilde{M}(G)\le\mathcal{E}_G(W_z)\le M(G)+(1+4K)\gamma. The distance bounds follow from Lemma 1.

Observe that the boosting sequence is never computed by the algorithm. It only proves that a short-description repair of nearly optimal energy exists.

Estimating the optimum from a sample

The labels have reduced our search to a finite optimization problem. To apply a sampling theorem, we must express its objective as an average of bounded functions of a few vertex labels. The tester term already depends on ss vertices. We write the edit term on the same tuples by averaging its pair costs over the KK pairs in each tuple.

A dense ss-ary constraint satisfaction problem (CSP) consists of variables VV, a label set Λ\Lambda, and for each v∈V≠s\mathbf{v} \in V_{\ne}^{s} a predicate Pv:Λs→[0,1]P_{\mathbf{v}} : \Lambda^{s} \to[0,1]. For U⊆VU \subseteq V with ∣U∣=m|U| = m set Val⁡(U)=max⁡z∈ΛUm−s∑v∈U≠sPv(zv1,…,zvs)\operatorname{Val}(U) = \max_{z \in\Lambda^{U}} m^{-s} \sum_{\mathbf{v} \in U_{\ne}^{s}} P_{\mathbf{v}}(z_{v_1},\ldots,z_{v_s}), and let OPT⁡=Val⁡(V)\operatorname{OPT} = \operatorname{Val}(V). Here a predicate is a score in [0,1][0,1], so the goal is to maximize the average score. We take m≥sm \ge s whenever using this value. The normalization is m−sm^{-s}, rather than 1/(m)s1/(m)_s: equivalently, tuples with a repeated vertex have score zero. This convention is responsible for the factor ana_n below.

For our graph GG, a tuple score will be one minus a rescaled local loss. The division by 3 is enough because the edit loss is at most 1 and the rejection penalty at most 2. For v∈V≠s\mathbf{v} \in V_{\ne}^{s} and ζ=(ζ1,…,ζs)∈Λs\zeta= (\zeta_1,\ldots,\zeta_s) \in\Lambda^s let Y∈WsY \in\mathcal{W}^s be Y(ab)=D(G(vavb),ζa,ζb)Y(ab) = D(G(v_av_b),\zeta_a,\zeta_b). Define the loss ℓv:Λs→[0,3]\ell_{\mathbf{v}} : \Lambda^s \to[0,3] and the predicate PvP_{\mathbf{v}} by Pv:=1−13ℓvP_{\mathbf{v}} := 1-\frac{1}{3}\ell_{\mathbf{v}}, with

ℓv(ζ)=1K∑ab∈([s]2)[G(vavb)(1−Y(ab))+(1−G(vavb))Y(ab)]+2ϕ(Y).\ell_{\mathbf{v}}(\zeta) = \frac{1}{K}\sum_{ab \in\binom{[s]}{2}} \left[G(v_av_b)(1-Y(ab))+(1-G(v_av_b))Y(ab)\right]+2\phi(Y).

The loss depends only on G[v]G[\mathbf{v}] and ζ\zeta. Denote this CSP by I(G)\mathcal{I}(G). In Val⁡(U)\operatorname{Val}(U) we always restrict this same instance to UU: the alphabet Λ\Lambda, decoder DD, and rejection rule fnf_n are kept fixed. This restriction need not be the instance one would construct by treating G[U]G[U] as a new input graph.

Let an=(n)s/nsa_n=(n)_s/n^s, the probability that ss independent uniformly chosen vertices of VV are all distinct. The next lemma verifies that the local losses average to the objective we want, with precisely this normalization factor when losses are converted to CSP scores.

Lemma 5. For every z∈ΛVz \in\Lambda^V, Evℓv(zv1,…,zvs)=EG(Wz)\mathbb{E}_{\mathbf{v}}\ell_{\mathbf{v}}(z_{v_1},\ldots,z_{v_s})=\mathbb{E}_G(W_z), with v\mathbf{v} uniform in V≠sV_{\ne}^{s}. Hence

OPT⁡(I(G))=an(1−M~(G)/3).\operatorname{OPT}(\mathcal{I}(G))=a_n(1-\widetilde{M}(G)/3).

Proof. A fixed pair of positions in a uniform injective tuple is a uniform pair of vertices. Consequently, distributing the edit loss over larger tuples does not change its mean; the rejection term agrees by definition. For uniform v\mathbf{v} and fixed abab, vavbv_av_b is a uniform pair, so the abab-term of the first part has expectation Ee[G(e)(1−Wz(e))+(1−G(e))Wz(e)]=cost⁡G(Wz)\mathbb{E}_{e}[G(e)(1-W_z(e))+(1-G(e))W_z(e)]=\operatorname{cost}_G(W_z) (Fact 3). Averaging over abab gives cost⁡G(Wz)\operatorname{cost}_G(W_z). Since Y=Wz[v]Y=W_z[\mathbf{v}] here, the second part has expectation 2rej⁡(Wz)2\operatorname{rej}(W_z). For OPT⁡\operatorname{OPT}: m=nm=n and ∣V≠s∣=anns|V_{\ne}^{s}|=a_nn^s, so n−s∑vPv=an(1−EG(Wz)/3)n^{-s}\sum_{\mathbf{v}}P_{\mathbf{v}}=a_n(1-\mathcal{E}_G(W_z)/3); maximize over zz.

We use the following external sampling theorem. It controls the optimum after optimizing the labels on the sample, not just the sampled value of a fixed labeling. This distinction matters: the best labeling of a sample can depend on the sample and need not extend to an equally good labeling of the whole graph. The guarantee is in expectation; independent repetition will turn it into the desired probability guarantee.

Theorem 3 ((Bernasconi–Castiglioni–Celli–Farina–Malavolta [21, Theorem 3.3])). There are absolute constants c∗,C∗>0c_*,C_* > 0 such that for every dense kk-ary CSP with label set of size Q0Q_0 and every 0<θ<10 < \theta< 1, if

m=⌈c∗k12θ−6log⁡2(Q0k2/θ)⌉,m=\left\lceil c_* k^{12}\theta^{-6}\log^2(Q_0k^2/\theta)\right\rceil,
n≥c∗2k24θ−13log⁡4(Q0k2/θ),n\ge c_*^2 k^{24}\theta^{-13}\log^4(Q_0k^2/\theta),

and U⊆VU\subseteq V is a uniformly random mm-subset, then ∣EVal⁡(U)−OPT⁡∣≤C∗θ\left|\mathbb{E}\operatorname{Val}(U)-\operatorname{OPT}\right|\le C_*\theta.

The dependence on the label set is only through log⁡Q0\log Q_0. This is essential, since ∣Λ∣|\Lambda| is exponential in poly⁡(s,1/ε)\operatorname{poly}(s,1/\varepsilon).

The penalty and label approximation account for a small deterministic error; the sampled CSP optima account for the remaining random error. The threshold N0N_0 ensures that all counting and sampling hypotheses hold. Graphs below that threshold can be read in full at a polynomial query cost.

Proof of Theorem 2. Let ε∈(0,1)\varepsilon\in(0,1), put τ=ε/100\tau=\varepsilon/100, and choose ss as in Proposition 1, so that

s=O(max⁡{1,q(ε/100)}log⁡(100/ε)).s=O\left(\max\{1,q(\varepsilon/100)\}\log(100/\varepsilon)\right).

Set K=(s2)K=\binom{s}{2} and γ0=ε/[100(1+4K)]\gamma_0=\varepsilon/[100(1+4K)]. Choose a rational γ∈[12γ0,γ0]\gamma\in[\frac{1}{2}\gamma_0,\gamma_0]. Then (1+4K)γ≤ε/100(1+4K)\gamma\leq\varepsilon/100 and

log⁡∣Λ∣=O(s2γ−2)=O(s6ε−2).(7)\log|\Lambda|=O(s^2\gamma^{-2})=O(s^6\varepsilon^{-2}). \tag*{(7)}

For n≥4sn\geq4s and PV≠∅\mathcal{P}_V\neq\varnothing, Proposition 2 gives

∣M^(G)−dist⁡(G,P)∣≤3ε100.(8)|\widehat{M}(G)-\operatorname{dist}(G,\mathcal{P})|\leq\frac{3\varepsilon}{100}. \tag*{(8)}

Apply Theorem 3 with k=sk=s, Q0=∣Λ∣Q_0=|\Lambda| and θ=c0ε\theta=c_0\varepsilon, where c0c_0 is an absolute constant with θ<1\theta<1 and C∗θ≤ε/24C^*\theta\leq\varepsilon/24. Let mm be the resulting sample size and N0N_0 the maximum of the theorem’s threshold on nn, of mm, of 4s4s and of 2s22s^2 (rounded up). By (7), both mm and N0N_0 are poly⁡(s,1/ε)\operatorname{poly}(s,1/\varepsilon) with absolute degrees. Let T=⌈432ε−2⌉T=\lceil432\varepsilon^{-2}\rceil be the number of independent samples.

We may identify the input vertex set with [n][n]. The rational choice of γ\gamma, together with the rational values of fnf_n, makes the finite sample objectives rational, so their optima can be computed by exhaustive search without an additional approximation error.

The algorithm

  1. By finite enumeration decide whether P[n]=∅\mathcal{P}_{[n]}=\varnothing; if so output 11. If n<2n<2 output 00.

  1. If 2≤n≤N02\leq n\leq N_0: query all pairs and output dist⁡(G,P)\operatorname{dist}(G,\mathcal{P}) exactly.

  1. If n>N0n>N_0: draw independent uniform mm-subsets U1,…,UT⊆[n]U_1,\ldots,U_T\subseteq[n] and query all pairs inside each. By exhaustive search compute Val⁡i=Val⁡(Ui)∈[0,1]\operatorname{Val}_i=\operatorname{Val}(U_i)\in[0,1] for the CSP I(G)\mathcal{I}(G) restricted to UiU_i (each predicate depends only on G[v]G[v], the function fnf_n and DD). With Val⁡‾=T−1∑i=1TVal⁡i\overline{\operatorname{Val}}=T^{-1}\sum_{i=1}^{T}\operatorname{Val}_i, output d^=clip⁡(3(1−Val⁡‾/an))\widehat d=\operatorname{clip}(3(1-\overline{\operatorname{Val}}/a_n)).

Correctness for $n>N_0. The sampling theorem bounds the bias of each sampled optimum. Averaging independent copies controls its fluctuation around that mean. We then invert the exact CSP identity from Lemma 5; the lower bound on ana_n ensures that this inversion enlarges the error by only a constant factor.

By Theorem 3 and Lemma 5, ∣EVal⁡i−OPT⁡(I(G))∣≤ε/24|\mathbb{E}\operatorname{Val}_i-\operatorname{OPT}(\mathcal{I}(G))|\leq\varepsilon/24. The Val⁡i\operatorname{Val}_i are independent with values in [0,1][0,1], so Var⁡(Val⁡i)≤1/4\operatorname{Var}(\operatorname{Val}_i)\leq1/4 and Var⁡(Val⁡‾)≤1/(4T)\operatorname{Var}(\overline{\operatorname{Val}})\leq1/(4T). Chebyshev’s inequality gives

Pr⁡[∣Val⁡‾−EVal⁡i∣>ε/24]≤144Tε2≤13.\Pr\left[|\overline{\operatorname{Val}}-\mathbb{E}\operatorname{Val}_i|>\varepsilon/24\right]\leq\frac{144}{T\varepsilon^2}\leq\frac{1}{3}.

So with probability at least 2/32/3, ∣Val⁡‾−OPT⁡(I(G))∣≤ε/12|\overline{\operatorname{Val}}-\operatorname{OPT}(\mathcal{I}(G))|\leq\varepsilon/12. Since n>2s2n>2s^2, an=∏j<s(1−j/n)≥1−(s2)/n≥1/2a_n=\prod_{j<s}(1-j/n)\geq1-\binom{s}{2}/n\geq1/2. By Lemma 5, M^(G)=3(1−OPT⁡(I(G))/an)\widehat{M}(G)=3(1-\operatorname{OPT}(\mathcal{I}(G))/a_n), so the quantity inside the clip differs from M^(G)\widehat{M}(G) by at most 3⋅ε12⋅2=ε23\cdot\frac{\varepsilon}{12}\cdot2=\frac{\varepsilon}{2}. With (8) the total error is below ε2+3ε100<ε\frac{\varepsilon}{2}+\frac{3\varepsilon}{100}<\varepsilon, and clipping to [0,1]⊇dist⁡(G,P)[0,1]\supseteq\operatorname{dist}(G,\mathcal{P}) cannot increase it. For n≤N0n\leq N_0 the output is exact.

Query complexity All graph queries are made inside the sampled vertex sets, or inside the whole graph when its order is at most N0N_0. Searching through labels and evaluating their predicates uses no further graph queries. Thus the number of queries is at most

max⁡{(N02),T(2)(m)}=poly⁡(s,1/ε),\max\left\{\binom{N_0}{2}, T^{(m)}_{(2)}\right\} = \operatorname{poly}(s, 1/\varepsilon),

and substituting s=O(max⁡{1,q(ε/100)}log⁡(100/ε))s = O(\max\{1, q(\varepsilon/100)\}\log(100/\varepsilon)) proves the theorem with c=1/100c = 1/100.

For the corollary, the point is that a natural property already requires many queries to test at small proximity. Thus the explicit accuracy parameter in the estimator’s bound can be paid for by the tester’s own query complexity. We use the definitions of natural and non-trivial hereditary properties from § 1.

Proof of Corollary 1. For natural properties, [17 Proposition 1.10] gives the edge-query lower bound q(η)=Ω(1/η)q(\eta) = \Omega(1/\eta). For non-trivial hereditary properties, [17 Proposition 1.7] gives this lower bound for the canonical vertex sample size. The Goldreich–Trevisan conversion [2] turns a tester with q(η)q(\eta) edge queries into one with O(q(η))O(q(\eta)) sampled vertices, so the same lower bound follows for our edge-query notation. Taking η=cε\eta= c\varepsilon, we obtain 1/ε=O(q(cε))1/\varepsilon= O(q(c\varepsilon)) for sufficiently small ε\varepsilon. This also absorbs the max⁡{1,⋅}\max\{1,\cdot\} in Theorem 2, proving the corollary.

AI disclosure

AI-assisted tools, specifically Quillbot, were utilized only to enhance the exposition’s clarity and language. The mathematical arguments were not produced using them. Additionally, the author made use of the optional AI feedback for STOC 2027. The system found a few typos and some formatting errors, which the author personally corrected.

Acknowledgments

This project started while the authors were participating in the 2025 NII International Internship Program. The authors are grateful to the program for its support. G.C. is supported by the CB European PhD Studentship funded by Trinity College, Cambridge, and would like to thank the Isaac Newton Institute for Mathematical Sciences, Cambridge, for support and hospitality during the programme Logical Foundations of Complexity Theory, where part of the work on this paper was undertaken. This work was supported by EPSRC grant EP/Z000580/1.

References

  1. [1]O. Goldreich, Introduction to Property Testing, Cambridge University Press, 2017.DOI
  2. [2]O. Goldreich and L. Trevisan, Three theorems regarding testing graph properties, Random Structures & Algorithms 23 (2003), 23–57.
  3. [3]O. Goldreich, S. Goldwasser and D. Ron, Property testing and its connection to learning and approximation, Journal of the ACM 45 (1998), 653–750.
  4. [4]N. Alon and A. Shapira, A characterization of the (natural) graph properties testable with one-sided error, SIAM Journal on Computing 37 (2008), 1703–1727.
  5. [5]W. T. Gowers, Lower bounds of tower type for Szemerédi’s uniformity lemma, Geometric and Functional Analysis 7 (1997), 322–337.DOI
  6. [6]V. Rödl and R. Duke, On graphs with small subgraphs of large chromatic number, Graphs and Combinatorics 1 (1985), 91–96.DOI
  7. [7]G. Carenini, C. Seth and Y. Yoshida, A quantitative container characterization of one-sided testability, 2026, arXiv:2608.01523.arxiv.org/abs/2608.01523
  8. [8]E. Blais and C. Seth, Testing graph properties with the container method, SIAM Journal on Computing 54 6 (2025), 1626–1642.
  9. [9]N. Kushnir and A. Shapira, Towards tight bounds for testing k-colorability, Proceedings of APPROX/RANDOM (2026), 35:1–35:13.
  10. [10]J. Balogh, R. Morris and W. Samotij, Independent sets in hypergraphs, Journal of the American Mathematical Society 28 (2015), 669–709.
  11. [11]D. Saxton and A. Thomason, Hypergraph containers, Inventiones Mathematicae 201 (2015), 925–992.DOI
  12. [12]M. Parnas, D. Ron and R. Rubinfeld, Tolerant property testing and distance approximation, Journal of Computer and System Sciences 72 (2006), 1012–1042.DOI
  13. [13]E. Fischer and L. Fortnow, Tolerant versus intolerant testing for Boolean properties, Theory of Computing 2 (2006), 173–183.
  14. [14]E. Fischer and I. Newman, Testing versus estimation of graph properties, SIAM Journal on Computing 37 (2007), 482–501.
  15. [15]C. Hoppen, Y. Kohayakawa, R. Lang, H. Lefmann and H. Stagni, On the query complexity of estimating the distance to hereditary graph properties, SIAM Journal on Discrete Mathematics 35 (2021), 1238–1251.arxiv.org/abs/1912.01081
  16. [16]N. Fiat and D. Ron, On efficient distance approximation for graph properties, Proceedings of SODA 2021, 1618–1637.arxiv.org/abs/2001.01452
  17. [17]L. Gishboliner, N. Kushnir and A. Shapira, Testing versus estimation of graph properties, revisited, Random Structures & Algorithms 65 (2024), 460–487.
  18. [18]A. Frieze and R. Kannan, Quick approximation to matrices and applications, Combinatorica 19 (1999), 175–220.DOI
  19. [20]L. Trevisan, M. Tulsiani and S. Vadhan, Regularity, boosting, and efficiently simulating every high-entropy distribution, Proceedings of IEEE CCC, 2009.DOI
  20. [21]M. Bernasconi, M. Castiglioni, A. Celli, G. Farina and G. Malavolta, A subsampling theorem for constraint satisfaction problems with large arity, 2026, arXiv:2608.00203.arxiv.org/abs/2608.00203

Paper details

vlnc:W_3xxjdf2g
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 12

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Quillbot

View statement
Looking for related papers…
Contents