Abstract 1 Introduction 2 Preliminaries 3 Proof of Theorem 3: Dense Case 4 Proof of Theorem 3: Sparse Case 5 Proof of Theorem 4: Dense Case 6 Proof of Theorem 4: Sparse Case References

Canonical Labelling of Random Regular Graphs

Mikhail Isaev ORCID School of Mathematics and Statistics, UNSW Sydney, Australia    Tamás Makai ORCID Institute of Mathematics, LMU Munich, Germany    Brendan D. McKay ORCID School of Computing, Australian National University, Canberra, Australia    Paweł Prałat ORCID Department of Mathematics, Toronto Metropolitan University, Canada    Jane Tan ORCID Mathematical Institute, University of Oxford, UK    Maksim Zhukovskii ORCID School of Computer Science, The University of Sheffield, UK
Abstract

We prove that whenever d=d(n) and nd as n, then with high probability for any non-trivial initial colouring, the colour refinement algorithm distinguishes all vertices of the random regular graph 𝒢n,d. This, in particular, implies that with high probability 𝒢n,d admits a canonical labelling computable in time O(min{nω,nd2+ndlogn}), where ω<2.372 is the matrix multiplication exponent.

Keywords and phrases:
random graphs, regular graphs, colour refinement, canonical labelling, graph isomorphism
Category:
Track A: Algorithms, Complexity and Games
Funding:
Brendan D. McKay: Supported by Australian Research Council grant DP190100977.
Copyright and License:
[Uncaptioned image] © Mikhail Isaev, Tamás Makai, Brendan D. McKay, Paweł Prałat, Jane Tan, and
Maksim Zhukovskii; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Mathematics of computing Random graphs
; Mathematics of computing Graph algorithms
Related Version:
Full Version: https://arxiv.org/abs/2602.17567 [29]
Editors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele Puppis

1 Introduction

Given an input graph G, a canonical labelling algorithm computes a bijection πG:V(G){1,,n} with the following property: if a graph G is isomorphic to G, then the relabelled versions of G and G, under the actions of πG and πG, are identical. There is a linear time reduction from the graph isomorphism problem to canonical labelling: once the labellings πG,πG have been computed for two input graphs G,G, it takes time O(|E(G)|) to check whether G,G are isomorphic. The best known (in the worst case) algorithm for the graph isomorphism problem is due to Babai [6, 27]: it runs in time exp(O(log3n)) for n-vertex graphs. A quasi-polynomial bound exp(O(logcn)) is also known for the canonical labelling problem [7]. Nevertheless, for graphs with bounded degree, both problems can be solved in polynomial time [9, 40]. In particular, this is the case for d-regular graphs when d=const. In this paper, we show that there exists a polynomial-time canonical labelling algorithm for almost all d-regular graphs for all 0dn1.

Colour refinement (CR) is a simple algorithmic routine that operates on vertex-coloured graphs. For an input graph G with initial colouring C0, CR iteratively computes new colourings. At round t, Ct(v) is a pair (Ct1(v),Ct1(N(v))), where Ct1(N(v)) is the multiset of Ct1-colours of neighbours of v. That is, the process refines the initial partition C0 and halts once the partition stabilises. Let us call a colouring discrete if every pair of vertices is coloured differently. If CR runs on an uncoloured graph (i.e., there is only one initial colour) and outputs a discrete colouring, then, since the vertex colours are isomorphism-invariant, this yields a canonical labelling by numbering the colour names in the lexicographic order. In [8, 18, 25], it was proved that CR run on a binomial random graph 𝒢(n,p)111The vertex set of 𝒢(n,p) is {1,,n}, and each pair of vertices is adjacent with probability p=p(n), independently of the other pairs. outputs a discrete colouring with high probability (whp, in what follows)222A sequence of events n holds with high probability if (n)1 as n. whenever (1+ε)lnnn<p12, which implies a near linear time algorithm for canonical labelling of G(n,p) [12].

We stress that for regular uncoloured graphs G, CR terminates immediately with a trivial colouring, and is therefore unsuitable for canonical labelling. For a positive integer n, we denote [n]:={1,,n}. Let dn1 be a non-negative integer such that dn is even. Let 𝒢n,d be a uniform distribution over all d-regular graphs on [n]. We write 𝐆n𝒢n,d for a graph sampled from this distribution, i.e. 𝐆n is a uniformly random d-regular graph on [n]. Since, for constant d, efficient canonical labelling algorithms are known, we focus on the case d=ω(1). Moreover, since the edge complement of a d-regular graph is (n1d)-regular, the edge complement of 𝒢n,n1d is distributed as 𝒢n,d. Therefore, we may restrict ourselves to dn/2. Our main result shows that the triviality of the initial colouring is the only obstacle for a complete refinement: once a non-trivial initial colouring is produced, whp CR run on 𝐆n𝒢n,d outputs a discrete colouring which is suitable for canonical labelling.

Before we state the main result of this paper, we need one more definition. For a connected graph G, we denote by diam(G) its diameter.

Theorem 1.

Let d0 be large enough, let d=d(n) be such that d0dn/2, and let 𝐆n𝒢n,d. Then, the following holds whp: for every non-trivial partition [n]=V1V2 of the vertex set of 𝐆n, CR runs at most 2diam(𝐆n)+3 steps on 𝐆n and outputs a discrete colouring.

We note that we did not try to optimise the bound on the number of rounds, and we believe that 2diam(𝐆n)+3 is suboptimal. In particular, for dn1/2+ε, we show that 2diam(𝐆n)+1=5 rounds is enough. Actually, it is natural to suspect that the total number of rounds needed is (1+odiam(𝐆n)(1))diam(𝐆n) whp.

We now describe a possible approach to canonical labelling of 𝐆n𝒢n,d based on our main result. Since the output of CR can be computed in time O((n+|E(G)|)logn) on an n-vertex graph G [12], Theorem 1 reduces the problem to efficiently finding an isomorphism-preserving partition of [n]. To this end, recall that, for any d=ω(1), whp 𝐆n contains a triangle [32]. Let ti be the number of triangles that contain the vertex i[n] in 𝐆n, and let t=max{t1,,tn}. Using fast square matrix multiplication, it is possible to compute the vector (t1,,tn) in time nω, where ω<2.372 [1]. Alternatively, this vector can be computed in time O(nd2) using the standard triangle-listing algorithm [16], which is faster when d<n0.685, assuming the best known upper bound on the matrix multiplication exponent ω (and yields the bound o(n2) for d=o(n), which is faster than any algorithm based on square matrix multiplication since ω2). Then, we can partition [n] into sets V1,V2 where V1 contains all vertices i for which ti=t and V2 contains the rest.

Since whp 𝐆n contains a triangle, V1 is non-empty. When d=o(n1/3), the number of triangles is sublinear whp (by Claim 9 below), which immediately implies that there are vertices that do not belong to a triangle, and so the set V2 is non-empty as well. In order to show that V2 is non-empty (i.e., that there are two vertices u,v with tutv) whp when d=ω(n1/3), fix two vertices u,v and expose their neighbourhoods N(u),N(v). Then expose the edges inside N(u). Assuming tu=tv, the set of exposed edges identifies the number of edges that have both endpoints in N(v) but not in N(u) (that is, in E(𝐆n[N(v)])E(𝐆n[N(u)])). By standard counting arguments (or using switchings), it follows directly that, for any fixed x=x(n)0, the probability that the latter set contains exactly x edges tends to zero. Finally, when d=Θ(n1/3), it is known that the number of triangles Xn in 𝐆n satisfies a central limit theorem: Xn𝔼XnVarXn converges in distribution to a standard normal random variable as n [21]. In particular, if (iti=t)>ε, then (3Xn/n)>ε, contradicting the central limit theorem. Therefore, we get the following.

Corollary 2.

Let d=d(n) be such that d and nd, and let 𝐆n𝒢n,d. There exists an algorithm that runs in time O(min{nω,nd2+ndlogn}) on d-regular n-vertex graphs and whp outputs a canonical labelling of 𝐆n.

1.1 Related work

In [13, 37], it is proved that, when dnε, for a sufficiently small ε, then with high probability 𝐆n𝒢n,d admits a canonical labelling via the 2-dimensional Weisfeiler-Leman algorithm (2-WL) [49], which is a generalisation of CR where the colouring is applied to pairs of vertices, and whose running time is O(n3logn) [28]. The weaker version of 2-WL suggested by Bollobás [13] canonically labels 𝐆n in time O(n3/2+ε) whp. Moreover, Kučera [37] claimed that his version of the algorithm runs in average time O(nd) for d=O(1) which we failed to verify333The paper does not provide a proof of this fact. However, the algorithm computes the vertices on shortest cycles as a subroutine and uses the following assertion [37, Theorem 3.1]: All cycles of the length k in d-regular graph can be found in time O(nmin{n,(d1)k/2}). First, we believe that the factor (d1)k/2 should instead read (d1)k/2 (for instance, it is unclear how all triangles could be found in time nd1.5, say in a union of (d+1)-cliques, there are Θ(nd2) triangles, which gives the lower bound Ω(nd2) on time needed to list them). Second, this bound (even with the fractional power) is not enough to get the expected time O(nd). Indeed, 𝐆n has a triangle with asymptotic probability 1exp((d1)3/6). So we get the bound on the expected time to be at least (1exp((d1)3/6)on(1))nd1.5nd1.5 as d.. We therefore conclude this paragraph by asking whether there exists a linear-time algorithm – running in time O(nd) on d-regular n-vertex graphs – that canonically labels 𝐆n whp, at least for some 3dn/2.

For binomial random graphs 𝒢(n,p), the study of canonical labelling algorithms has been more extensive. Babai, Erdős, and Selkow [8] proved that CR outputs a canonical labelling of 𝒢(n,1/2) in linear time whp since it performs only a bounded number of refinement steps. The argument of [8] can be extended to show [14, Theorem 3.17] that the CR colouring of 𝒢(n,p) is whp discrete for all n1/5lnnp1/2. Bollobás [13] showed a polynomial time canonical labelling algorithm for c1lnnnpc2n11/12 for some positive constants c1 and c2, which is a weaker version of 2-WL. The next improvement was obtained by Czajka and Pandurangan [18]: they extended the range of applicability of CR to ln4nnlnlnnp12, which was finally extended to (1+ε)lnnnp12 by Gaudio, Rácz, and Sridhar [25]. Linial and Mosheiff [39] showed that 2-WL outputs canonical labelling of 𝒢(n,p) whp when 1np12. Finally, a polynomial time algorithm that labels canonically 𝒢(n,p) whp for all 0p=p(n)1 was independently established in [5, 47], with CR as the main ingredient.

A partition [n]=V1Vt of the vertex set of a graph G is called equitable if, for any 1i,jt, any two vertices in Vi have exactly the same number of neighbours in Vj. Clearly, if a graph G admits a non-trivial equitable partition V1Vt, then CR does not refine it. The opposite statement is also true – if there is a partition that CR does not refine, then this partition is equitable. Clearly, Theorem 1 implies that whp CR refines any non-trivial partition of Gn,d with any number of parts. Therefore, it implies that whp 𝐆n𝒢n,d does not have an equitable partition other than those with 1 part or n parts. If a graph G has a non-trivial automorphism group Aut(G), then for any non-trivial automorphism σAut(G), its cycle decomposition identifies an equitable partition of G. Since no graph with three or more vertices has a cyclic automorphism group acting without fixed points, the absence of a non-trivial equitable partition implies the absence of non-trivial automorphisms. As a result, Theorem 1 implies that 𝐆n is asymmetric whp for all d such that d and nd. This is a known result for the entire range 3nd4, having been first established for d=o(n) in [42] and then for dlogn in [31].

1.2 Proof strategy

The key step to obtain Theorem 1 is to show that after some number of rounds of CR, one can coarsen the partition associated with colours to get a partition with k parts of comparable size (for any desired arbitrarily large constant k). The following statement makes this precise. Note that we may coarsen a partition at any stage of the CR algorithm if it is convenient for the argument that follows. Clearly, one may couple the original process with the modified one so that the partitions in the original process are refinements of the corresponding partitions in the modified one. In particular, if the modified process reaches discrete colouring, then so does the original one.

Theorem 3.

Let d0 be large enough, let d0d=d(n)n/2, and let 𝐆n𝒢n,d. Let k be an arbitrary constant. Then, the following holds whp: for every non-trivial partition [n]=V10V20 of the vertex set of 𝐆n, after diam(𝐆n)+2 rounds of CR, there exists a partition [n]=V1Vk such that for any i[k], n/3k|Vi|3n/k and Vi is a union of some colour classes (in other words, V1Vk is a coarsening of the partition associated with resulting colour classes).

Once there are many parts of linear and comparable sizes, CR distinguishes all vertices after some additional number of rounds.

Theorem 4.

Let d0 be large enough, let d0d=d(n)n/2, and let 𝐆n𝒢n,d. There exists some universal large constant k such that the following holds whp: for every initial partition [n]=V1Vk such that for any i[k], n/3k|Vi|3n/k, CR terminates on 𝐆n after at most diam(𝐆n)+1 rounds and outputs a discrete colouring.

Theorem 1 follows immediately from Theorem 3 and Theorem 4. To prove each of these two theorems, we address two regimes for d separately: the dense case of dn1/2+ε, and the sparse case with d0dn10/17. The corresponding statements are reiterated in Sections 3, 4, 5, and 6. Theorem 3 for dn1/2+ε is proved in Section 3. Its proof consists of two parts. First, we show that whp after one refinement round there exists a coarsening [n]=U1U2 of the CR-partition such that |U1|,|U2|n/d, see Claim 16. One more round is needed to get all colour classes of size at most δn, for an arbitrary constant δ>0, see Claim 17. The latter claim follows from the fact that there is no large set with all vertices having the same degree profile with respect to (U1,U2). This is the main technical complication in the proof of Section 3 in the dense case: although this fact is easy to show in 𝒢(n,p), in random regular graphs we cannot rely on local limit theorems. Instead we use asymptotic estimations of the number of graphs with a given degree sequence as well as anti-concentration properties of hypergeometric distribution. The sparse case d=o(n) is addressed in Section 4. Here, we show that, for every initial colouring V1V2, where |V1|<cn, for a sufficiently small constant c>0, after a few rounds of colour refinement, we will get a union of colour classes U of size |U|[cn/d,cn] (Lemma 14). One more round is needed to get a set U of size |U|[n/d,0.999n], for an arbitrarily large constant (Lemma 22). Then, similarly to the dense case, we show that there is no set of size more than δn such that all its vertices have same number of neighbours in U, that gives us the desired partition (Lemma 20). All three lemmas rely on switching arguments. In particular, the last two lemmas use switchings to establish an analogue of Erdős–Littlewood–Offord theorem in the context of uniformly random graphs with a fixed degree sequence.

Theorem 4 is proved in Sections 5 and 6. The dense case is significantly easier. For instance, when d=Θ(n), two refinement rounds are enough to obtain a discrete colouring whp. Indeed, let u,v be two fixed vertices. Expose the neighbourhoods N(u),N(v), and all the edges that touch N(v). The exposed edges identify degree profiles of vertices in N(u)N(v) with respect to the fixed partition. Since the latter set has size Θ(n), it is extremely unlikely that all the degrees are equal to the fixed values. Clearly, the probability of this event is (1/n/k)Θ(kn) in 𝒢(n,p), which is enough to overcome the union bound, with room to spare. In order to transfer this bound to random regular graphs, we use asymptotic enumeration of graphs with a given degree sequence and anti-concentration inequalities for hypergeometric distribution, as for the dense case in Theorem 3. For n1/2+εd=o(n), we need one additional refinement round in order to reach a set of vertices at distance at most 2 from {u,v} of size Θ(n). The sparse case dn10/17, addressed in Section 6, requires a more delicate switching argument and constitutes the most technical part of the paper. Here, in order to reach a set of size Θ(n), from fixed vertices u,v, we need diam(𝐆n) rounds. Then, in contrast to the sparse case in Theorem 3, we need a multidimensional analogue of Erdős–Littlewood–Offord theorem (Claim 29), since the degree profiles are considered with respect to k sets of the partition. Nevertheless, the claim can still be established by applying a similar switching argument Θ(k) times.

1.3 Organisation

We start by presenting some preliminary results on properties of random graphs and concentration inequalities in Section 2. The rest of the paper is devoted to the proof of Theorems 3 and 4 which immediately imply our main Theorem 1. Theorem 3 is proved across Sections 3 and 4 where the dense and sparse cases are treated respectively. Sections 5 and 6 are devoted to the dense and sparse cases of Theorem 4.

1.4 Notation

For a graph G, a set of vertices UV(G), and a non-negative integer r, we denote by Sr(U) the sphere of radius r around U in the graph metric, omitting the dependency on G since the underlying graph is always clear from the context. That is, Sr(U) consists of vertices v such that the length of a shortest path from v to U equals r. In particular, S0(U)=U. We also denote Br(U)=0irSi(U) the ball of radius r around U. We sometimes denote S1(U) by N(U) and refer to it as the neighbourhood of U. For a set of vertices X and a vertex xX, we denote by NX(x) the number of neighbours of x in X. We also use the standard notation G[U] for the subgraph of G induced by a set UV(G), and G[U×V] for the bipartite subgraph with (disjoint) parts U and V, consisting of all edges of G with one endpoint in U and the other in V. We often write AB to denote the union of two disjoint sets A and B. Finally, for a random variable X with distribution Q, we write XQ. In particular, XBin(n,p) is a binomial random variable with n trials and success probability p.

2 Preliminaries

In this section, we collect some probabilistic tools as well as properties of random regular graphs that we will use in the main proofs to follow. Proofs of Lemma 5, Corollary 6, Lemma 8, and Lemma 14 appear in the extended version of the paper [29].

2.1 Concentration Inequalities

We will use the following specific instances of Chernoff’s bound. Let XBin(n,p). Then, a consequence of Chernoff’s bound (see [30, Theorem 2.1]) is that for any t0 we have

(X𝔼X+t) exp(t22(𝔼X+t/3)) (1)
(X𝔼Xt) exp(t22𝔼X). (2)

The same bounds hold for a random variable with the hypergeometric distribution with parameters N, n, and m (see [30, Theorem 2.10]).

2.2 Properties of Binomials

Let us start with a few auxiliary observations.

Lemma 5.

For all positive integers b1<a1, b2<a2,

aabb(ab)aba1a1a2a2b1b1(a1b1)a1b1b2b2(a2b2)a2b2,

where a=a1+a2 and b=b1+b2.

The preceding lemma has a useful corollary, which we record as follows.

Corollary 6 (Anti-concentration of hypergeometric distribution).

For integers 0<b1<a1, 0<b2<a2,

(a1b1)(a2b2)(ab), (3)

and

(a1b1)(a2b2)23b(ab)a1a2ab1(a1b1)b2(a2b2)(ab), (4)

where a=a1+a2 and b=b1+b2. In particular, for all integers 0<b<a and positive integers k,

(ab)k(ab(ab))(k1)/2(kakb). (5)

Moreover, for all integers 0<b<a,

(2a2b)4b(ab)a(ab)22a(ab)2. (6)

2.3 Counting Graphs

For a given degree sequence 𝐝=(d1,,dn), we will use g(𝐝) to denote the number of graphs on the vertex set [n] with the degree sequence 𝐝. The following result gives precise (asymptotic) bounds on g(𝐝) (up to a multiplicative constant) for any degree sequence satisfying some mild condition. Dense graphs were investigated in [43] but the result was generalised to sparser graphs in [38].

Theorem 7 ([38, 43, 44]).

Let 𝐝=(d1,,dn) be any degree sequence such that i=1ndi is even and for all i[n], |did|d1/2+ε for some ε>0, where d is the average degree. Let m be the number of edges, and η=1ni=1n(did)2. Suppose that 1d(1ε0)n for some ε0>0. Then,

g(𝐝)=i=1n(n1di)m1/2((n2)m)exp(O(1)Θ(η2/d2)).

We say that a sequence 𝐝=(d1,,dn) is balanced if |didj|1 for any 1i<jn. The next observation is that g(𝐝) is maximized (over all sequences with a fixed even sum) when 𝐝 is balanced.

Lemma 8.

Fix m[(n2)]. The number of graphs on n vertices and m edges with a specified degree sequence 𝐝=(d1,,dn) (in particular, di=2m) is maximized when the degree sequence is as even as possible. In other words,

max{g(𝐝):di=2m}=g(𝐝^),

where 𝐝^ is the degree sequence, unique up to order, with only di/n and di/n.

We also recall the probability bound on the event that a uniformly random graph with a given degree sequence contains a specified set of edges.

Claim 9 ([41]).

Let 𝐆n be a uniformly random graph on the vertex set [n] with a fixed degree sequence (d1,,dn). Let H be a graph on [n] with degree sequence (d1,,dn) such that didi for all i[n]. Let m=12di and m=12di be the number of edges in 𝐆n and H, respectively. Let d=max{d1,,dn}=o(m1/2) and let mm/2. Then,

(H𝐆n)i=1ndi(di1)(didi+1)2m(m2d2)(m2d21)(m2d2m+1).

We note that Claim 9 immediately implies the following.

Claim 10.

Under the assumptions of Claim 9, for all n large enough when the degree sequence is regular,

(H𝐆n)(2d/n)|E(H)|.

2.4 Sandwiching Graphs

Consider the binomial random graph 𝒢(n,p) which has vertex set [n] and each potential edge is included independently at random with probability p; p=p(n) could be, and usually is, a function of n that tends to zero as n. Since the independence of the edges allows the use of a wide variety of techniques, 𝒢(n,p) is typically much easier to study compared to 𝒢n,d. As a result, it is tempting to hope for a general purpose “black box” theorem that is able to translate results between 𝒢(n,p) and 𝒢n,d. In 2004, Kim and Vu [33] formalized this desire in their famous “sandwich conjecture”. After more than 20 years and a number of important contributions [19, 22, 23, 34, 24], the conjecture was finally proved [11].

Theorem 11 (Theorem 1.1 [11]).

For each ϵ>0 there is some C>0 such that the following holds for each dClogn. There is a coupling (𝐆,𝐆,𝐆) of random graphs such that 𝐆𝒢(n,(1ϵ)d/n), 𝐆𝒢n,d, 𝐆𝒢(n,(1+ϵ)d/n), and whp 𝐆𝐆𝐆.

2.5 Expansion Properties

We will use the expansion properties of random d-regular graphs that follow from their eigenvalues. The adjacency matrix A=A(G) of a given d-regular graph G on n vertices, is an n×n real symmetric matrix. Thus, the matrix A has n real eigenvalues which we denote by d=λ1λ2λn. It is known that several structural properties of a d-regular graph are reflected in its spectrum. Since we focus on expansion properties, we are particularly interested in the following quantity: λ=λ(G):=max{|λ2|,|λn|}.

The number of edges e(A,B) between two sets A and B in a random d-regular graph on n vertices is expected to be close to d|A||B|/n. (Note that AB does not have to be empty; in general, e(A,B) is defined to be the number of edges between AB to B plus twice the number of edges that contain only vertices of AB.) A small λ (that is, a large spectral gap) implies that the deviation is small. The following bound is very convenient.

Theorem 12 ([3, 35]).

Let G be a d-regular graph. Then for any two sets of vertices A,BV(G), the number e(A,B) of edges of G with one endpoint in A and another endpoint in B satisfies

|e(A,B)d|A||B|n|λ|A||B|.

We will apply the Expander Mixing Lemma (Theorem 12) together with an asymptotic bound on λ for random regular graphs. It was first established by Friedman [20] for constant d3, confirming the conjecture of Alon [2]. The case of d was then conjectured by Vu [48]. After a series of important contributions [4, 15, 17, 36, 46], it was resolved for all d=o(n) by Bauerschmidt, Huang, Knowles, and Yau [10] and Sarid [45], and then for d=Θ(n) by He [26].

Theorem 13 ([10, 26, 45]).

Let 3dn/2 and 𝐆n𝒢n,d. Then, whp λ(𝐆n)(2+o(1))d(1d/n).

We will also require a finer expansion result ensuring that, for every set, its size remains concentrated after several rounds of expansion.

Lemma 14.

Let c>0 be small enough and d0 be large enough (independent of c). Let d0dn/2 and 𝐆n𝒢n,d. Then, the following holds whp: for every set U of size u=|U|cnd and for every positive integer r such that ud(d1)r1cn,

|Sr(U)|(1100c4lnd/d)ud(d1)r1.

3 Proof of Theorem 3: Dense Case

Here we prove the following.

Theorem 15.

Let ε(0,1/2), n1/2+εd=d(n)n/2, and let 𝐆n𝒢n,d. Let k be an arbitrary constant. Then, the following holds whp: for every non-trivial partition [n]=V10V20 of the vertex set of 𝐆n, after two rounds of CR, there exists a partition [n]=V1Vk such that for any i[k], n/3k|Vi|3n/k and Vi is a union of some colour classes.

Theorem 15 follows easily from the following two claims.

Claim 16.

Let ε(0,1/2), n1/2+εd=d(n)n/2, and let 𝐆n𝒢n,d. For every C>1, the following property holds whp: for every non-trivial partition [n]=V1V2 with min{|V1|,|V2|}<Cn/d, after one round of CR, there exists a partition [n]=U1U2 with min{|U1|,|U2|}Cn/d such that U1 and U2 are unions of some colour classes (in other words, U1U2 is a coarsening of the partition associated with resulting colour classes).

Claim 17.

Let ε(0,1/2), n1/2+εd=d(n)n/2, and let 𝐆n𝒢n,d. For any δ(0,1], there exists C=C(δ)>0 such that the following property holds whp: for every non-trivial partition [n]=V1V2 with min{|V1|,|V2|}Cn/d, there is no colour class of size more than δn after one round of CR.

The proof of the first claim is fairly straightforward and relies on the “sandwich theorem” (Theorem 11); it appears in the extended version of the paper [29]. Before we prove the second claim, let us show how they imply Theorem 15.

Proof of Theorem 15.

Since we aim for the statement that holds whp, we may assume that the statements in Claim 16 and in Claim 17 hold deterministically. Fix any k, and let δ=1/3k. Let C=C(δ) be the large enough constant implied by Claim 17.

Consider any non-trivial partition [n]=V10V20. If min{|V10|,|V20|}<Cn/d, then after one round of CR (and coarsening), we get a partition into two colour classes where both of the colour classes have size at least Cn/d (by Claim 16). After another round of CR, all colour classes have size at most δn=n/3k (by Claim 17). If min{|V10|,|V20|}Cn/d, then we get the above property after a single round of CR.

To get the desired partition into k parts, each of size at least n/3k, one can iteratively merge any two colour classes of size at most δn until there is at most one such class remaining. After possibly merging this last class (if it exists) with any other arbitrarily chosen class, we get at least k=1/3δ classes (but at most 3k of them), each of size at least δn=n/3k but at most 3δn. Finally, if there are more than k classes, one can arbitrarily merge some triples of them (and, perhaps, one pair) to get exactly k classes, each of size at most 9δn=3n/k. This finishes the proof of the theorem.

In order to prove Claim 17, we will make use of the following simple observation (see its proof in the extended version of the paper [29]).

Lemma 18.

Let ε(0,1/2), n1/2+εd=d(n)n/2, and let 𝐆n𝒢n,d. For any δ>0, the following property holds whp: for any U[n] of size u=|U|>δn and any V[n]U of size v=|V|500n/(dδ), the number of edges e(U,V) between U and V satisfies the following bounds

0.8uvdn1e(U,V)1.2uvdn1.

Proof of Claim 17.

Fix any δ(0,1] and let C=C(δ) be a large enough constant that will be specified later. In particular, we will assume that C500/δ so that we may apply Lemma 18.

Suppose that there exists a partition [n]=V([n]V) with Cn/d|V|n/2 such that after one round of CR there exists a colour class U of size more than δn. Note that this implies that every vertex in U has the same number of neighbours in V (hence every vertex in U also has the same number of neighbours in [n]V). If UV, then it will be convenient to concentrate on the number of neighbours in [n]V[n]U but if U[n]V, then we will concentrate on the number of neighbours in V[n]U. Our goal is to estimate the probability of the weaker but necessary property that there exists a pair of sets (U,V) such that V[n]U, |V|Cn/d, |U|>δn, and every vertex in U has the same number of neighbours in V.

Fix V[n] and U[n]V such that v:=|V|Cn/d and u:=|U|>δn. Note that, in particular, v<(1δ)n. For each non-negative integer kv, define k(U,V) to be the event that every vertex in U has exactly k neighbours in V. By Lemma 18, since we aim for a statement that holds whp, we may assume that the number of edges between U and V is at least 0.8uvd/(n1) and at most 1.2uvd/(n1). Hence, we may restrict to considering k such that

0.8vdn1k 1.2vdn1. (7)

First, note that the expected number of edges induced by [n]V is (nv2)dn1. We will show that it is highly unlikely that the actual number deviates substantially from it. Let

m=0.9(nv2)dn1 and m+=1.1(nv2)dn1.

By Theorem 7 and the Stirling’s formula (s!=(1+o(1))2πs(s/e)s), letting 𝐝:=(d,,d)n, the number of d-regular graphs on [n] can be estimated as follows:

g(𝐝) =Θ((n1d)ndn((n2)dn/2)) (8)
=(n2πd(nd)(1+o(1))(n1e)n1(de)d(n1de)n1d)n((dn/2e)dn/2(n(n1d)/2e)n(n1d)/2Θ(1)(n(n1)/2e)n(n1)/2)
=Θ(1)((n2)dn/2)((1+o(1))n2πd(nd))n=((n2)dn/2)dΘ(n).

Hence, the probability that the number of edges induced by [n]V is at most m or at least m+ can be upper bounded by

mmmm+((nv2)m)((n2)(nv2)dn/2m)g(𝐝) =nΘ(n)mmmm+((nv2)m)((n2)(nv2)dn/2m)((n2)dn/2)
=nΘ(n)(ηm or ηm+),

where η is the hypergeometric random variable with parameters (n2), (nv2), and dn/2. Clearly,

𝔼η=dn2(nv2)(n2)=(nv2)dn1=Θ(dn).

By Chernoff’s bound for hypergeometric distribution (see the comment right after (1), (2)),

(ηm or ηm+)=(|η𝔼η|0.1𝔼η)=exp(Ω(𝔼η))=exp(Ω(dn)).

Similarly, if |V|n3/4, then the expected number of edges induced by V is (v2)dn1=Θ(v2d/n) and we get that with probability exp(Ω(dv2/n))=exp(Ω(dn1/2)), the number of edges induced by V is at most 0.9(v2)dn1 or at least 1.1(v2)dn1.

It remains to concentrate on the case when the number of edges induced by [n]V is between m and m+, that is, when the average degree of the graph induced by [n]V is at least 0.9(n1v)dn1 but at most 1.1(n1v)dn1. Let us first deal with the case when |V|n3/4 so we may additionally assume that the average degree of the graph induced by V is at least 0.9(v1)dn1 but at most 1.1(v1)dn1. By Theorem 7 and Lemma 8,

(k(U,V))=eΩ(dn)+eΩ(dn1/2)+O(Dh(k,u,v,D)),

where D denotes the number of edges between V and [n](VU), and

h(k,u,v,D):=(vk)u((nvu)vD)(v1d(D+ku)/v)v(n1vd(D+ku)/(nv))nv((v2)(dvkuD)/2)((nv2)(d(nv)kuD)/2)g(𝐝).

Indeed, there are at most (vk)u ways to place edges between U and V, and at most ((nvu)vD) ways to place edges between V and [n](VU). (Note that these values are trivial upper bounds but not the exact ones as some choices create vertices of degree more than d.) It remains to estimate the number of graphs induced by the set [n]V and the number of graphs induced by the set V. Importantly, once other edges are fixed, these graphs have a fixed degree distribution. In particular, the average degree of the graphs induced by [n]V is precisely f(D):=d(D+ku)/(nv). Similarly, the average degree of the graphs induced by V is f~(D):=d(D+ku)/v. Hence, we may use Theorem 7 and Lemma 8 to get upper bounds for the number of such graphs. (Let us point out that f(D) and f~(D) are not necessarily integers. However, to keep the notation simple, we write (n1vf(D))nv instead of the product of nv terms, each of them being (n1vf(D)) or (n1vf(D)).) Finally, since the average degree of the graph induced by [n]V and the one induced by V are restricted, D satisfies the requirements

0.9(n1v)dn1 f(D) 1.1(n1v)dn1 (9)
0.9(v1)dn1 f~(D) 1.1(v1)dn1. (10)

There are three binomials in the numerator of h(k,u,v,D) that are raised to powers that are functions of n. We need to take advantage of them using Corollary 6 (see (5)). By (9),

(n1vf(D))nv ((1+o(1))(n1v)f(D)(n1vf(D)))(nv1)/2((nv)(nv1)d(nv)kuD) (11)
(1+o(1)0.9δd(11.10.5))(nv1)/2((nv)(nv1)d(nv)kuD)
(3δd)(nv1)/2((nv)(nv1)d(nv)kuD).

Similarly, by (10),

(v1f~(D))v ((1+o(1))(v1)f~(D)(v1f~(D)))(v1)/2(v(v1)dvkuD) (12)
(1+o(1)0.9(vd/n)(11.10.5))(v1)/2(v(v1)dvkuD)
(3nvd)(v1)/2(v(v1)dvkuD).

Finally, by (7),

(vk)u (vk(vk))(u1)/2(vuku)(1+o(1)0.8vd/n(11.20.5))(u1)/2(vuku) (13)
(4ndv)(u1)/2(vuku).

For future reference, let us highlight that (12) only holds when vn3/4, whilst the other two bounds (11) and (13) hold in general. Substituting in these three bounds, we get

h(k,u,v,D)=O(n32(4ndv)u2(vuku)((nvu)vD)(3nvd)v2(v(v1)dvkuD)(3δd)nv2((nv)(nv1)d(nv)kuD)((v2)(dvkuD)/2)((nv2)(d(nv)kuD)/2)g(𝐝)).

Now, by Corollary 6 (see (6)), the latter quantity equals

O(n7/2(4ndv)u/2(vuku)((nvu)vD)(3nvd)v/2((v2)(dvkuD)/2)(3δd)(nv)/2((nv2)(d(nv)kuD)/2)g(𝐝)).

By Corollary 6 (see (3)), we can collect all binomial coefficients together to get

h(k,u,v,D) = O(n72(4ndv)u2(vu+(nvu)v+(v2)+(nv2)ku+D+(dvkuD)/2+(d(nv)kuD)/2)(3nvd)v2(3δd)nv2g(𝐝))
= O(n7/2(4ndv)u/2((n2)dn/2)(3nvd)v/2(3δd)(nv)/2g(𝐝)).

Using (8) we get that

g(𝐝)Ω(1)((n2)dn/2)((2+o(1))πd)n/2((n2)dn/2)(7d)n/2,

and so

h(k,u,v,D) = O(n7/2(4ndv)u/2(3nvd)v/2(3δd)(nv)/2(7d)n/2)
= O(n7/2(4ndv)u/2(δnv)v/2(21δ)n/2).

Now, let h(v):=(δn/v)v/2 and note that h(v)=12(δn/v)v/2(log(δn/v)1). Hence, h(v) is maximized for v=δn/e and we get that for any positive integer v,

(δnv)v/2maxvh(v)=exp(δn2e)2n/2,

since exp(δ/e)exp(1/e)1.4452. It follows that

h(k,u,v,D)=O(n7/2(4ndv)u/2(42δ)n/2)=O(n7/2((4C)δ42δ)n/2)=O(5n),

provided that C is large enough so that (4C)δ42δ<1/52. Since δ is fixed, this condition can be easily satisfied and we may now finally define the constant C:

C=C(δ):=max{4(δ/1200)1/δ,500δ}.

We conclude that if |V|n3/4, then

(k(U,V))=eΩ(dn)+eΩ(dn1/2)+O(Dh(k,u,v,D))=O(n2 5n).

If v<n3/4 then, as mentioned earlier, we do not get the term (3nvd)(v1)/2 in the estimation of h(k,u,v,D) (see (12)). However, for v<n3/4, this term does not help us much anyway: (3nvd)(v1)/2=exp(Θ(vlogv))exp(n4/5). Hence, regardless of the size of V,

(k(U,V))=O(n2exp(n4/5) 5n).

Finally, by the union bound,

(k,U,Vk(U,V))n2n2nO(n2exp(n4/5) 5n)=o(1),

which finishes the proof of the theorem.

4 Proof of Theorem 3: Sparse Case

Sparser graphs clearly require more rounds of CR. Consider any d-regular graph with diameter D and let u and v be any two vertices at distance D from each other. CR run on the initial partition V1={v} and V2=[n]{v} requires at least D2 rounds to converge. Indeed, after D2 rounds there are at least two vertices at distance at least D1 from v that are still of the same colour.

Theorem 19.

Let d0 be large enough, let d0d=o(n), and let 𝐆n𝒢n,d. Let k be an arbitrary constant. Then, the following holds whp: for every non-trivial partition [n]=V10V20 of the vertex set of 𝐆n, after at most diam(𝐆n)+2 rounds of CR, there exists a partition [n]=V1Vk such that for any i[k], n/3k|Vi|3n/k and Vi is a union of some colour classes.

4.1 Anti-concentration Results

Lemma 20.

Let be a large enough constant, and let d0=d0() be another large enough constant. Let d0d=o(n) and 𝐆n𝒢n,d. Then, the following property holds whp: for every set U of size |U|[nd,n2] and every non-negative integer s, the number of vertices in [n]U that have exactly s neighbours in U is at most 10n/ln.

Proof.

Due to Claim 10, the probability that there exists a set U of size m[n/d,n/2] and a set V[n]U of size t=10n/ln such that the number of edges between U and V is more than dm/4 is at most

m=n/dn/2(nm)(nt)(mtdm/4)(2dn)dm/4 m=n/dn/2(ent)t(enm(4etd2dn)d/4)m
(ln)tm=n/dn/2(ed(300ln)d/4)m
n(ln)10n/ln(1/2)(n/d)d/5=o(1).

Therefore, it suffices to prove the lemma for s such that 10sn/ln<dm/4. So, we may assume that s<dmln/(40n). On the other hand, by the Expander Mixing Lemma and Theorem 13, whp the number of edges between any set U of size m/2 and any set V[n]U of size t is at most 3td/4. So, we may also assume that s<3d/4.

Next, by the Expander Mixing Lemma and Theorem 13, whp, for every set U of size m[n/d,n/2] and every set V[n]U of size t, there are at least md/3 edges between U and [n](UV), and at most 2d(nmt)/3 edges between [n](UV) and UV.

Fix a set U of size m[nd,n2] and a set V[n]U of size t. Fix a non-negative integer smin{3d4,dmln40n}. Let us estimate the probability that every vertex from V has exactly s neighbours in U. Let us order the vertices in V arbitrarily: x1,x2,,xt, where t=|V|=10n/ln. Let be the event that every xi has s neighbours in U. Let hind(nmt)/6 and houtmd/3 be integers such that

({|E(𝐆n[[n](VU)]|=hin,|E(𝐆n[U×([n](UV))]|=hout}) is maximum.

Let Σ0 be the set of all d-regular graphs G on [n] satisfying and such that G[[n](VU)] and G[U×([n](UV))] have exactly hin and hout edges, respectively. The following claim completes the proof of Lemma 20, see the proof in the extended version of the paper [29].

Claim 21.

(𝐆nΣ0)t/5.

Indeed, by the union bound over U,V and the number of edges outside of V (hin,hout), we get that probability that there exist sets V,U such that holds is at most

o(1)+(nd)2 m=n/dn/2(nm)(nt)t/5o(1)+n42n(ent1/5)t
o(1)+n42n(ln1/5)10n/lno(1)+n42nen=o(1).

Lemma 22.

Let be large enough constant, and let d0=d0() be another large enough constant. Let d0d=o(n) and 𝐆n𝒢n,d. Then, the following property holds whp: for every set U of size |U|[n2d,nd] and every integer s such that 1s, there are at most 0.999n vertices that have exactly s neighbours in U.

Proof.

By the Expander Mixing Lemma and Theorem 13, whp every set V of size n/4 induces at most dn/15 edges. Let be the event that there exists a set V of size n/4 with more than dn/15 edges.

Let ε=0.001. Fix a set U of size m[n2d,nd] and a set V={x1,,xt}[n]U of size n(1ε). Divide V=VV′′, where V consists of the first n/4 vertices. Expose edges inside V and assume that E:=E(V) has size at most dn/15. Let V~V be the set of vertices that have at most d/2 neighbours in V. Clearly, |V~|n/12. Without loss of generality, we assume V~={x1,,xt}, where tn/12.

Let Σ0 be the set of d-regular graphs G on [n] such that G[V]=E and each vertex in V has exactly s neighbours in U. Let Σ1 be the set of d-regular graphs G on [n] such that G[V]=E and

  • x1 has s+1 neighbours in U,

  • each vertex x2,,xt has exactly s neighbours in U, except for some xiV′′, whereas xi has s1 neighbours in U,

We shall prove that |Σ1||Σ0|/3. Take GΣ0 and consider a tuple of vertices (y,u,v) such that

  • yV′′, uU, vV′′,

  • and {x1,y},{u,v}E(G), {x1,u},{y,v}E(G).

If we switch

{x1,y},{u,v}{x1,u},{y,v}, (14)

we get a graph from Σ1. For every GΣ0 the number of forward switchings is at least (d/2s)(((3/4ε)nd)ssd). On the other hand, for every graph GΣ1, the number of backward switchings is at most (s+1)(3n/4)d. We get

|Σ0|(d/2s)(((3/4ε)nd)ssd)|Σ1|(s+1)(3n/4)d

implying |Σ1||Σ0|/3, as desired.

We now let Σ2 be the set of d-regular graphs G on [n] such that

  • |NU(x1)|[s,s+1],

  • x2 has s+1 neighbours in U,

  • each vertex x3,,xt has exactly s neighbours in U, except for xi1V′′ (when |NU(x1)|=s) and xi1,xi2V′′ (when |NU(x1)|=s+1) that have s1 neighbours in U.

Take GΣ0Σ1 and consider a tuple of vertices (y,u,v) such that

  • yV′′, uU, vV′′, and |NU(v)|=s,

  • and {x2,y},{u,v}E(G), {x2,u},{y,v}E(G).

If we switch as in (14), then we get a graph from Σ1. For every GΣ0Σ1 the number of forward switchings is at least (d/2s)(((3/4ε)nd1)ssd). On the other hand, for every GΣ1, the number of backward switchings is at most (s+1)(3n/4)d, as before. Thus

|Σ0Σ1|(d/2s)(((3/4ε)nd1)ssd)|Σ2|(s+1)(3n/4)d

implying |Σ2||Σ0Σ1|/3, as well.

Similarly, we define Σ3,,Σn/12. For the i-th set Σi, we get that

|Σ0Σi1|(d/2s)(((3/4ε)nd(i1))ssd)|Σi|(s+1)(3n/4)d,

implying |Σi||Σ0Σi1|/3 for all i. In particular, we get

|Σ7| |Σ0|+|Σ1|++|Σ6|3
|Σ0|+|Σ0|/3+(|Σ0|+|Σ1|)/3++(|Σ0|++|Σ5|)/33
>|Σ0|+|Σ0|/3+5(|Σ0|+|Σ0|/3)/33>76|Σ0|.

In a similar way, for every i, |Σ7i+7||Σ7i|++|Σ7i+6|3>76|Σ7i|. Thus, we get |Σn/12|>(7/6)n/84|Σ0|, implying (𝐆nΣ0E(𝐆n[V])=E)<(7/6)n/84. The union bound over U and V gives us that

(¬)+(nεn)(nn/d)E:|E|dn/15(𝐆nΣ0E(𝐆n[V])=E)(E(𝐆n[V])=E)=o(1)+e(εln(e/ε)+o(1))n(7/6)n/84=o(1),

which completes the proof of the lemma.

4.2 Proof of Theorem 19

With Lemmas 14, 20, and 22 at hand, we can easily prove Theorem 19.

Proof of Theorem 19.

Fix any k, and let =e30k. Let c>0 be a small enough constant as in Lemma 14. Let d0=d0() be a large enough constant as in Lemmas 14, 20, and 22. Moreover, we will adjust constants c or d, if needed, for some of the claims below to hold. Since we aim for the statement that holds whp, we may assume that the statements in Lemmas 14, 20, and 22 hold deterministically.

Consider any non-trivial partition [n]=V10V20. Our goal is to show that after at most diam(𝐆n)+3 many rounds of CR, we get a partition into colour classes that have sizes at most n/3k. To get the desired partition into k parts, each of size at least n/3k but at most 3n/k, one can iteratively merge colour classes as we did in the proof of Theorem 15.

Let u=min{|V10|,|V20|} and let U be a colour class of size u. Suppose first that u<cn/d. Let r be the largest integer such that ud(d1)r1cn. We may adjust c and d, if needed, to make sure that 1100c4lnd/d1/2, which, in particular, implies that c1/200. It follows from Lemma 14 that

|Sr(U)|(1100c4lnd/d)ud(d1)r1>cn2d,

and clearly |Sr(U)|ud(d1)r1cnn/2. After rdiam(𝐆n)1 rounds of CR, Sr(U) is a union of some colour classes. We may merge them together at this point and continue the process from there.

Suppose now that U is a colour class of size u=|U|[cn2d,n2d]. Let U be an arbitrary subset of U of size cn2d. On the one hand, trivially, |S1(U)|d|U|n/2. On the other hand, it follows from Lemma 14 that |S1(U)||U|d/2=cn/4 which implies that |S1(U)||S1(U)||U|cn/4n/2dn/d, when d is large enough. Since S1(U) is a union of some colour classes, we may merge them into one large class and continue from there.

Suppose this time that U is a colour class of size u=|U|[n2d,nd]. We may adjust d, if needed, to make sure undn2(+1). After one round of CR, [n]U is partitioned into sets Wi (i{0}); set Wi consists of vertices with exactly i neighbours in U. Let A=iWi and let B=i+1Wi. Clearly, |U|+|A|+|B|=n. Note that, on the one hand, the number of edges between U and its complement is at least |B|(+1). On the other hand, it is trivially at most |U|dn. We conclude that |B|+1n=(11+1)n, and so

|A|=n|B||U|n+1un2(+1).

Our goal is to show that one can always merge some sets Wi together to get a colour class of size at most n/2 but at least n2(+1), which is at least nd, provided that d is large enough. To that end, we will consider a few cases. If |A|n/2, then we can simply take the entire set A for the desired colour class. If |A|>n/2 but |A|(11/(+1))n, then we may take the entire set B since |B|=n|A||U|n/(+1)un/2(+1) and, trivially, |B|=n|A||U|<n/2.

It remains to concentrate on the case when |A|(11/(+1))n. Suppose first that |Wi|n/2 for some 0i. It follows from Lemma 22 that |Wi|0.999n. Then, we can take AWi for the desired colour class since, trivially, |AWi|n|Wi|n/2 and

|AWi||A||Wi|0.001nn+1nd,

provided that d is large enough. If n/4|Wi|<n/2 for some 0i, then we may simply take Wi as our colour class. Suppose then that |Wi|<n/4 for all 0i. Then, we may start with set A and remove Wi’s, one by one, and at some point we get a set of size at most n/2 but at least n/4.

Finally, suppose that U is a colour class of size u=|U|[nd,n2]. It follows immediately from Lemma 20 that after one round of CR, the complement of U is partitioned into sets of size at most 10n/ln=n/3k. We can group some of them together to get a colour class of size at least n/3kn/d but at most 2n/3kn/2 to make sure that after one more round U is also partitioned into sets of size at most n/3k. This completes the proof.

5 Proof of Theorem 4: Dense Case

Here, we prove the following.

Theorem 23.

Let ε>0, let n1/2+εdn/2, and let 𝐆n𝒢n,d. There exists some universal large constant k such that the following holds whp: for every partition [n]=V1Vk of the vertex set of 𝐆n such that for any i[k], n/3k|Vi|3n/k, after three rounds of CR, there are only singleton colour classes.

We start from a simple auxiliary lemma, the proof of which is in the extended version of the paper [29].

Lemma 24.

Let ε>0, n1/2+εd=d(n)n/2, and let 𝐆n𝒢n,d. For every pair of vertices u,v[n], let Mu,vN(u) and Mu,vN(v)N(u) be sets of size n/(20d) chosen uniformly at random. Then the following events hold whp for any pair of vertices u,v in 𝐆n:

  1. 1.

    |N(u)N(v)|<2d/3;

  2. 2.

    |N(u)N(v){u,v}|<4n/5;

  3. 3.

    |N(Mu,v)(N({u,v})N(Mu,v))|>n/25 whenever dn/20.

Proof of Theorem 23.

Due to the Expander Mixing Lemma and Theorem 13, whp between any set N of size Ω(d) and any set W of size Ω(n), there are (1±o(1))|N||W|dn edges. We denote the intersection of this event with the event from the assertion of Lemma 24 by .

Suppose that k is as large as needed, and fix any partition [n]=V1Vk such that each part has size in the range [n/3k,3n/k] as in the statement of the theorem. For each i[k], define di:[n] so that di(w)=|ViN(w)|. Finally, for each vertex u[n], we interpret ci(u) as the colour of u after i rounds of CR. For our goal, it suffices to show that whp no two vertices have the same value of c3().

We proceed as follows. Fix a pair of vertices u,v[n] and expose the neighbourhoods of u and v. Note that c3(u)=c3(v) if and only if there exists a bijection b:N(v)N(u) such that for any wN(v) we have c2(b(w))=c2(w). Fix such a bijection (in d! ways). Define N:=N(v)(N(u){u}). Choose arbitrarily a set MN of n/(20d) vertices from N, and let M=b(M)N(u). Expose all edges that touch MN. Let

M′′=NN(M)(N(u)N(M){u,v}).

Due to symmetry we may assume |N(v)N(M)||N(u)N(M)| and we extend the bijection b to an injection b:N(v)N(M)N(u)N(M) such that, for every wM and every wN(w), we get c1(b(w))=c1(w) and b(w)N(b(w)). The number of ways to define such an extension is at most (d!)n/20d.

Let W:=[n]({u,v}N(u)N(v)N(M)N(M)), and Wi:=WVi. After exposing every edge except those between M′′ and W, we can determine the values of di(w) for every wN(M) (as every neighbour of every vertex in N(M) has been exposed). Therefore, the injection b also identifies di(w) for every i[k] and every wM′′. Let S denote the number of pairs (i,w) with 1ik and wM′′ such that |Wi|n/(30k) and |Wi|d/(2n)|N(w)Wi|3|Wi|d/(2n). The number of ways to choose the remaining neighbours of the vertices in M′′ is

i=1kwM′′(|Wi|di(w))(960kd)S/2(|W||M′′|dn/2m),

where m is the number of exposed edges. Indeed for any positive integers a1,a2,b1,b2 with b1b2 and bi3ai/4 for i=1,2 we have by Corollary 6 that

(a1b1)(a2b2) 23(b1+b2)(a1+a2)a1a2(a1+a2)b1(a1b1)b2(a2b2)(a1+a2b1+b2)
83b1+b2b1b2(a1+a2b1+b2)4b2(a1+a2b1+b2).

Let us show that the event implies Skn/1100. Indeed, this event implies that |W|n/5 (if d>n/20, then W=[n](N({u,v}){u,v}) and has size at least n/5 by the second assertion of Lemma 24; if dn/20, then |W|n2d2(n/(20d))d>n/5). Therefore, there are at least n/6 vertices in the union of Wi such that |Wi|n/(30k). Thus, there are at least (n/6)/(3n/k)=k/18 such Wi. Fix such a Wi. Since holds, any subset N~M′′ of size Ω(n) sends (1±o(1))|N~||Wi| edges to Wi. Moreover, |M′′|n/60. Indeed, if d>n/20, then M′′=N which has size at least d/3>n/60 by the first assertion of Lemma 24; if dn/20, then |M′′|>n/25 by the third assertion. The event also implies that number of vertices in M′′ that have less than |Wi|d2n or more than |Wi|3d2n edges in Wi, is o(n). So, indeed S>(1o(1))(k/18)(n/60)>kn/1100.

Using (8) and letting g(𝐝)=(d,,d)n, the probability that there exists u,v[n] and a partition V1Vk such that c(u)=c(v) is then at most

(¬)+1g(𝐝)n22knd!N[n]W[n]Nm=0dn/2((n2)|N||W|m)(960kd)S/2(|W||N|dn/2m)=o(1)+dΘ(n)(960kd)kn/2200=o(1),

when k is sufficiently large. This completes the proof of Theorem 23.

6 Proof of Theorem 4: Sparse Case

Here we prove the following.

Theorem 25.

There exists a universal constant k such that the following holds. Let d0=d0(k) be large enough, let d0dn10/17, and let 𝐆n𝒢n,d. Then whp: for every partition [n]=V1Vk of the vertex set of 𝐆n such that for any i[k], n/3k|Vi|3n/k, after diam(𝐆n)+1 rounds of CR, there are only singleton colour classes.

We will use two direct corollaries of Lemma 14 from Section 4 in this proof. We first state these in Section 6.1, and then prove Theorem 25 in Section 6.2.

6.1 Sizes of Balls

As in Lemma 14, let c>0 be small enough and d0 be large enough. Let d0d=o(n) and let 𝐆n𝒢n,d. The following two lemmas are direct corollaries of Lemma 14.

Lemma 26.

Whp, for every r such that d(d1)r1cn, the following holds

  • for every vertex u,

    |Sr(u)|(1100c4lndd)d(d1)r1;
  • for every pair of vertices uv,

    |Sr(v)Br(u)||Sr({u,v})||Br(u)|(1200c8lndd1d2)d(d1)r1.

Proof.

The first assertion is just Lemma 14 applied with U={u}. The second follows from |U|=2 in Lemma 14 together with the basic bound |Br(u)|ir1d(d1)i.

Lemma 27.

Whp

  • for every set U of size cnd, there are at least (14lnd/d100c)cn vertices that have a neighbour in U;

  • for any two disjoint sets U,V of size cn/d, the number of vertices that have neighbours both in U and in V is at most |N(U)|/10.

Proof.

The first assertion follows immediately from Lemma 14 applied with r=1. The second assertion follows as well since whp for any two disjoint sets U and V, the number of vertices that have neighbours in both sets is at most

|N(U)|+|N(V)| |N(UV)|2d(cn/d)(14lnd/d100c)2cn
=(4lnd/d+100c)2cn110(14lnd/d100c)cn|N(U)|/10.

6.2 Colour Refinement Run on a Vertex-coloured Random Graph

Let d be large enough. In what follows we assume that properties from Lemma 26 and Lemma 27 hold in 𝐆n deterministically.

Fix a partition [n]=V1Vk as in the statement of the theorem. Assign to every vertex x the colour C0(x) that equals the index of the set Vi to which x belongs. Let 𝐃 be the diameter of 𝐆n. Consider the output Ct of t:=𝐃+1 rounds of CR at the coloured graph. We want to prove that C(u)C(v) for any two different vertices u,v[n].

Fix two vertices uv. Assume Ct(u)=Ct(v). Then, for every neighbour x of v, there exists a neighbour y of u such that Ct1(x)=Ct1(y). More generally, we have the following.

Claim 28.

Let r[t]. For every vertex a and every vertex b such that Ctr(a)=Ctr(b), and every neighbour x of a, there exists a neighbour y of b such that Ctr1(x)=Ctr1(y).

Let r=logd1(εn), where ε>0 is a small enough constant. By Lemma 26, we have that

|Sr(u)Br(v)| (1200c8lndd1d2)d(d1)r1
>d(d1)2εn(1200c8lndd1d2)>ε2dn.

Due to Claim 28, for every vertex xS1(u)B1(v), there exists a vertex f(x)B1(v) such that Ct1(x)=Ct1(f(x)). Next, for every vertex xS2(u)B2(v), let π(x)S1(u)B1(v) be one of its “parents”. We have that Ct1(π(x))=Ct1(f(π(x)). Therefore, by Claim 28, there exists f(x)N(f(π(x)))B2(v) such that Ct2(x)=Ct2(f(x)). We then define f:Br(u)Br(v)Br(v) by induction: for every 2ir, assuming that f has been defined on Bi1(u)Bi1(v), and for every xSi(u)Bi(v), find its “parent” π(x)Si1(u)Bi1(v) and take f(x)N(f(π(x)) such that Cti(x)=Cti(f(x)).

Take USr(u)Br(v) of size εn2d and let U:=f(U)Br(v). We have |U||U|. Without loss of generality, we assume |U|=|U| (otherwise, we can extend U arbitrarily to keep the two sets disjoint, and the argument below will still work). Note that Br(u)=Br1(u)N(Sr1(u)), that |Sr1(u)|d(d1)r2d(d1)2εn<1.1εnd, and that U and Sr1(u) are disjoint. The same facts hold for Br(v). In particular, |Sr1(u)Sr1(v)|<3εnd. Therefore, by the conclusion of Lemma 27, we have that

|N(U)(N(U)Br(u)Br(v))| >|N(U)|710|N(U)||Br1(u)||Br1(v)|
>310(14lnd/d100c)12εn2dd2(d1)r1
>0.14εn2dεn(d2)(d1)>0.1εn.

Let 𝒩 be a subset of N(U)(N(U)Br(u)Br(v)) of size εn/10.

We then extend f to 𝒩: Each vertex x𝒩 has f(x)N(U). Note that the set X:=[n](Br(u)Br(v)𝒩f(𝒩)) has size at least

n2dd2(d1)rεn2d(2d)>n2dd2εnεnn(14ε).

The set X is partitioned into k sets X=V1Vk so that n(13k4ε)|Vi|n3k.

Due to Claim 10, whp any set of size at most 3εn induces at most 1100εdn edges:

(n3εn)(9ε2n2/21100εdn)(2dn)1100εdn((e3ε)300(900eε)d)1100εn=o(1),

since d is large and ε is small enough. In particular, we may assume that there are at most 1100εdn edges between 𝒩 and 𝒩f(𝒩)Br(u)Br(v). We get that there exists a subset 𝒩0𝒩 of size εn50 such that each vertex in this set sends at least 34d edges to X.

Note that, for any vertex x𝒩0, the equality Ctr1(x)=Ctr1(f(x)) implies C1(x)=C1(f(x)). Therefore, as soon as the sets Br(u),Br(v) are exposed, the set U is chosen, the sets N(U),N(U),N(N(U)) are exposed, and the set 𝒩0 is chosen, there should exist a function f defined as above, that identifies the values of |NVj(x)| for every x𝒩0 and j[k].

Therefore, we run the following exploration process of the random graph. First, we expose Br(u),Br(v) and then choose USr(u)Br(v) of size εn2d arbitrarily. We then expose N(U), N(U), and N(N(U)). We choose f on (Br(u)Br(v))𝒩 in at most d2εn ways, since

|(Br(u)Br(v))𝒩||Br(u)|+|N(U)|dd2(d1)r+εn2dd2εn+εn2<2εn.

Finally, we choose any set 𝒩0𝒩 of size εn50 such that each vertex in this set sends at least 34d edges to X.

By the Expander Mixing Lemma and Theorem 13, whp between any two disjoint sets of size at least n/(4k) and n/2, there are at least dn/(10k) edges, and every set of size at least n/2 induces at least dn/10 edges.

Recall that every x𝒩0 has a prescribed number of neighbours gj(x) in the set Vj. By the Expander Mixing Lemma and Theorem 13, whp the number of edges between any two disjoint sets U and V of sizes Θ(n) equals |U||V|d(1±ε)/n. Therefore, for every set Vj, there exists a subset 𝒩j𝒩0 of size εn/100 such that every x𝒩j has gj(x)[d/(10k),10d/k].

Let us estimate the probability that for every j[k], every vertex from 𝒩j has gj(x) neighbours in Vj. For every j, we order arbitrarily the vertices in 𝒩j: x1j,,xtj, where t=εn/100. Let be the event that, for every j[k], every xij has gj(xij) neighbours in Vj. Let hinjdn/10 and houtjdn/(10k) be integers such that

(j=1k{|E(𝐆n[XVj]|=hinj,|E(𝐆n[Vj×(XVj)]|=houtj}) is maximum.

Let Σ0 be the set of all d-regular graphs G on [n] satisfying and such that, for all j[k], G[XVj] and G[Vj×(XVj)] have exactly hinj and houtj edges, respectively444Sets X and Vj depend on G: given a graph G, we expose the balls around u and v, which identify these sets. In what follows, we will perform switching operations on G that preserve the exposed balls and, therefore, sets X and Vj.. The following claim completes the proof of Lemma 20 (its proof appears in the extended version of the paper [29]).

Claim 29.

(𝐆nΣ0)(k/d)εnk/500.

Indeed, Claim 29 implies that ()(dn)2k(k/d)εnk/500. Therefore, by the union bound

(Ct(u)=Ct(v))d2εn(dn)2k(k/d)εnk/500=eΩ(kn)

when k is large enough and dk. The union bound over the choice of partition V1Vk and over all pairs of distinct vertices u,v completes the proof of Theorem 25.

References

  • [1] J. Alman, R. Duan, V. Vassilevska Williams, Y. Xu, Z. Xu, and R. Zhou. More asymmetry yields faster matrix multiplication. In Proceedings of the 2025 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA’25), pages 2005–2039, 2025.
  • [2] N. Alon. Eigenvalues and expanders. Combinatorica, 6(2):83–96, 1986. doi:10.1007/BF02579166.
  • [3] N. Alon and F. R. K. Chung. Explicit construction of linear sized tolerant networks. Discrete Mathematics, 72:15–19, 1988. doi:10.1016/0012-365X(88)90189-6.
  • [4] N. Alon, M. Krivelevich, and V. H. Vu. On the concentration of eigenvalues of random symmetric matrices. Israel Journal of Mathematics, 131:259–267, 2002.
  • [5] M. Anastos, M. Kwan, and B. Moore. Smoothed analysis for graph isomorphism. In Proceedings of the 57th Annual ACM Symposium on Theory of Computing (STOC’25), pages 2098–2106, 2025.
  • [6] L. Babai. Graph isomorphism in quasipolynomial time. In Proceedings of the 48th Annual ACM Symposium on Theory of Computing (STOC’16), pages 684–697, 2016.
  • [7] L. Babai. Canonical form for graphs in quasipolynomial time: preliminary report. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing (STOC’19), pages 1237–1246, 2019.
  • [8] L. Babai, P. Erdős, and S. M. Selkow. Random graph isomorphism. SIAM Journal on Computing, 9(3):628–635, 1980. doi:10.1137/0209047.
  • [9] L. Babai and E. M. Luks. Canonical labeling of graphs. In Proceedings of the 15th Annual ACM Symposium on Theory of Computing (STOC’83), pages 171–183, 1983.
  • [10] R. Bauerschmidt, J. Huang, A. Knowles, and H.-T. Yau. Edge rigidity and universality of random regular graphs of intermediate degree. Geometric and Functional Analysis, 30:693–769, 2020.
  • [11] N. Behague, D. Il’ković, and R. Montgomery. A proof of the Kim-Vu sandwich conjecture. arXiv preprint, 2025. arXiv:2510.20765.
  • [12] C. Berkholz, P. Bonsma, and M. Grohe. Tight lower and upper bounds for the complexity of canonical colour refinement. Theory of Computing Systems, 60:581–614, 2017. doi:10.1007/S00224-016-9686-0.
  • [13] B. Bollobás. Distinguishing vertices of random graphs. Annals of Discrete Mathematics, 13:33–50, 1982.
  • [14] B. Bollobás. Random Graphs. Cambridge University Press, 2 edition, 2001.
  • [15] A. Z. Broder, A. M. Frieze, S. Suen, and E. Upfal. Optimal construction of edge-disjoint paths in random graphs. SIAM Journal on Computing, 28(2):541–573, 1999. doi:10.1137/S0097539795290805.
  • [16] N. Chiba and T. Nishizeki. Arboricity and subgraph listing algorithms. SIAM Journal on Computing, 14(1):210–223, 1985. doi:10.1137/0214017.
  • [17] N. A. Cook, L. Goldstein, and T. Johnson. Size biased couplings and the spectral gap for random regular graphs. Annals of Probability, 46(1):72–125, 2018.
  • [18] T. Czajka and G. Pandurangan. Improved random graph isomorphism. Journal of Discrete Algorithms, 6:85–92, 2008. doi:10.1016/J.JDA.2007.01.002.
  • [19] A. Dudek, A. Frieze, A. Ruciński, and M. Šileikis. Embedding the Erdős–Rényi hypergraph into the random regular hypergraph and hamiltonicity. Journal of Combinatorial Theory, Series B, 122:719–740, 2017. doi:10.1016/J.JCTB.2016.09.003.
  • [20] J. Friedman. A proof of Alon’s second eigenvalue conjecture and related problems. Memoirs of the American Mathematical Society, 195(910), 2008.
  • [21] P. Gao. Triangles and subgraph probabilities in random regular graphs. Electronic Journal of Combinatorics, 31(1):P1.2, 2024. doi:10.37236/10281.
  • [22] P. Gao, M. Isaev, and B. D. McKay. Sandwiching random regular graphs between binomial random graphs. In Proceedings of the Fourteenth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA’20), pages 690–701, 2020.
  • [23] P. Gao, M. Isaev, and B. D. McKay. Sandwiching dense random regular graphs between binomial random graphs. Probability Theory and Related Fields, 184(1–2):115–158, 2022.
  • [24] P. Gao, M. Isaev, and B. D. McKay. Kim-Vu’s sandwich conjecture is true for dlog4n. arXiv preprint, 2023. arXiv:2011.09449.
  • [25] J. Gaudio, M. Z. Rácz, and A. Sridhar. Average-case and smoothed analysis of graph isomorphism. Annals of Applied Probability, 35(2):1373–1406, 2025.
  • [26] Y. He. Spectral gap and edge universality of dense random regular graphs. Communications in Mathematical Physics, 405(181):1–40, 2024.
  • [27] H. A. Helfgott, J. Bajpai, and D. Dona. Graph isomorphisms in quasi-polynomial time. arXiv preprint, 2017. arXiv:1710.04574.
  • [28] N. Immerman and E. S. Lander. Describing graphs: A first-order approach to graph canonization. In Complexity Theory Retrospective, pages 59–81. Springer, New York, 1990.
  • [29] M. Isaev, T. Makai, B. D. McKay, P. Prałat, J. Tan, and M. Zhukovskii. Canonical labelling of random regular graphs. arXiv preprint, 2026. arXiv:2602.17567.
  • [30] S. Janson, T. Łuczak, and A. Ruciński. Random Graphs. Wiley, 2000.
  • [31] J. H. Kim, B. Sudakov, and V. Vu. On the asymmetry of random regular graphs and random graphs. Random Structures & Algorithms, 21(3–4):216–224, 2002. doi:10.1002/RSA.10054.
  • [32] J. H. Kim, B. Sudakov, and V. Vu. Small subgraphs of random regular graphs. Discrete Mathematics, 307:1961–1967, 2007. doi:10.1016/J.DISC.2006.09.032.
  • [33] J. H. Kim and V. H. Vu. Sandwiching random graphs: universality between random graph models. Advances in Mathematics, 188(2):444–469, 2004.
  • [34] T. Klimošová, C. Reiher, A. Ruciński, and M. Šileikis. Sandwiching biregular random graphs. Combinatorics, Probability and Computing, 32(1):1–44, 2023. doi:10.1017/S0963548322000049.
  • [35] M. Krivelevich and B. Sudakov. Pseudo-random graphs. In More Sets, Graphs and Numbers, volume 15 of Bolyai Society Mathematical Studies, pages 199–262. Springer, 2006.
  • [36] M. Krivelevich, B. Sudakov, V. Vu, and N. Wormald. Random regular graphs of high degree. Random Structures & Algorithms, 18:346–363, 2001. doi:10.1002/RSA.1013.
  • [37] L. Kučera. Canonical labeling of regular graphs in linear average time. In 28th Annual Symposium on Foundations of Computer Science (SFCS’87), pages 271–279, 1987.
  • [38] A. Liebenau and N. Wormald. Asymptotic enumeration of graphs by degree sequence, and the degree sequence of a random graph. Journal of the European Mathematical Society, 26:1–40, 2024.
  • [39] N. Linial and J. Mosheiff. On the rigidity of sparse random graphs. Journal of Graph Theory, 85(2):466–480, 2017. doi:10.1002/JGT.22073.
  • [40] E. Luks. Isomorphism of graphs of bounded valence can be tested in polynomial time. Journal of Computer and System Sciences, 25:42–65, 1982. doi:10.1016/0022-0000(82)90009-5.
  • [41] B. D. McKay. Subgraphs of random graphs with specified degrees. Congressus Numerantium, 33:213–223, 1981.
  • [42] B. D. McKay and N. C. Wormald. Automorphisms of random graphs with specified degrees. Combinatorica, 4:325–338, 1984.
  • [43] B. D. McKay and N. C. Wormald. Asymptotic enumeration by degree sequence of graphs of high degree. European Journal of Combinatorics, 11:565–580, 1990. doi:10.1016/S0195-6698(13)80042-X.
  • [44] B. D. McKay and N. C. Wormald. Asymptotic enumeration by degree sequence of graphs with degrees o(n). Combinatorica, 11:369–382, 1991.
  • [45] A. Sarid. The spectral gap of random regular graphs. Random Structures & Algorithms, 63(2):557–587, 2023. doi:10.1002/RSA.21150.
  • [46] K. Tikhomirov and P. Youssef. The spectral gap of dense random regular graphs. Annals of Probability, 41(1):362–419, 2019.
  • [47] O. Verbitsky and M. Zhukovskii. Canonical labeling of sparse random graphs. In 42nd International Symposium on Theoretical Aspects of Computer Science (STACS’25), pages 75:1–75:20, 2025.
  • [48] V. Vu. Random discrete matrices. In Horizon of Combinatorics, volume 17 of Bolyai Society Mathematical Studies, pages 257–280. Springer, 2008. doi:10.1007/978-3-540-77200-2.
  • [49] B. Weisfeiler and A. Leman. The reduction of a graph to canonical form and the algebra which appears therein. Nauchno-Technicheskaya Informatsia, 9(2):12–16, 1968.