arXiv:2610.24484math.COOct 2026

Manuscript Offprint

arXiv:2610.24484

Erdős-Gyárfás Balanced Five-Colorings

Hai Xia, Stefan Szeider

Abstract

A coloring of the edges of a complete graph with rr colors is balanced if the edges among any r+1r+1 vertices use all rr colors. Erdős and Gyárfás (1999) conjectured that for all r≥3r \geq 3 the complete graph Kr2+1K_{r^{2}+1} has no balanced rr-coloring. They proved the conjecture for r=3r = 3 and r=4r = 4. We prove the conjecture for r=5r = 5, the first new case settled in over two decades. There is no balanced 5-coloring of K26K_{26}, and since K25K_{25} has one, K25K_{25} is the largest complete graph admitting a balanced 5-coloring. We design a reduce-dispatch-enumerate workflow, where every machine step produces an artifact that can be independently checked. First, we use a machine-checked (Lean 4) proof to reduce the conjecture to a single extremal statement about the color class with the fewest edges: no graph on 26 vertices has between 55 and 65 edges while every 6 of its vertices span between 1 and 11 edges. We then search on the sparse class instead of its dense complement, which makes enumeration up to isomorphism feasible. With classical stability theorems for K6K_{6}-free graphs, we dispatch the five near-extremal edge counts analytically. For the exhaustive enumeration on the remaining six edge counts, we design efficient encodings with SAT modulo symmetries and parallel cube-and-conquer. We also certify all eleven edge counts: each of the 12,296 subproblems carries a clausal refutation checked by the independent verifier drat-trim, and all 273,503,938 symmetry-breaking clauses are also validated against the vertex permutations that justify them.

1 Introduction

For an integer r≥2r \geq 2, a balanced rr-coloring of the complete graph KnK_n on nn vertices is a map c:E(Kn)→{1,…,r}c: E(K_n) \to \{1, \ldots, r\} from its edges to colors such that every set of r+1r + 1 vertices spans edges of all rr colors, that is, the edges with both ends in the set use all rr colors. Balanced colorings were introduced in 1999 by Erdős and Gyárfás [11], who also gave a reformulation: a balanced rr-coloring of KnK_n exists if and only if E(Kn)E(K_n) can be partitioned into rr graphs G1,…,GrG_1, \ldots, G_r with α(Gi)≤r\alpha(G_i) \leq r for each ii. Here a set of vertices of a graph is independent if it spans no edge, and the independence number α(G)\alpha(G) of a graph GG is the largest size of an independent set. In detail, an rr-coloring and a partition of E(Kn)E(K_n) into rr graphs determine each other, with GiG_i the graph on all nn vertices whose edges are those of color ii. A set of r+1r + 1 vertices misses color ii, that is, none of the edges among them has color ii, exactly when it is an independent set of GiG_i. Hence the coloring is balanced exactly when no GiG_i has an independent set of r+1r + 1 vertices, which is the condition α(Gi)≤r\alpha(G_i) \leq r for every ii.

Erdős and Gyárfás [11] conjectured a sharp threshold for the existence of balanced colorings.

Conjecture (Erdős–Gyárfás). For every r≥3r \geq 3 there is no balanced rr-coloring of Kr2+1K_{r^2+1}.

The value r2+1r^2 + 1 is not an arbitrary threshold. When rr is a prime power (that is, r=pℓr = p^\ell for a prime pp and an integer ℓ≥1\ell \geq 1), the finite field with rr elements (for prime rr, the integers modulo rr) yields an affine plane of order rr, which gives a balanced rr-coloring of Kr2K_{r^2}. The plane has r2r^2 points and lines of rr points each. Every two points lie on exactly one line, and the lines fall into r+1r + 1 parallel classes of rr pairwise disjoint lines. Take the points as the vertices of Kr2K_{r^2} and put each edge into the parallel class of the line through its two ends. This splits the edges into r+1r + 1 classes, each consisting of rr disjoint cliques (sets of pairwise adjacent vertices) on rr vertices [11]. An independent set meets each clique in at most one vertex, so every class has independence number rr. Merging two classes into one color leaves rr colors, each still with independence number at most rr. Therefore, the coloring is balanced (Fig. 1, right). The construction is called the affine coloring of Kr2K_{r^2}. The Erdős–Gyárfás conjecture asserts that we cannot push past r2r^2. For r=2r = 2 it is false: coloring the five edges of a pentagon C5C_5 with one color and the other five edges of K5K_5 with the second gives a balanced 2-coloring of K5K_5 (Fig. 1, left). For r=3r = 3 and r=4r = 4, Erdős and Gyárfás [11] proved it: there is no balanced 3-coloring of K10K_{10} and no balanced 4-coloring of K17K_{17}. Their two proofs are case-specific. The r=3r = 3 argument relies on Brooks’ theorem [6] and a short case analysis; this case had in fact been settled already in 1978 by Chung and Liu [9] in the language of generalized Ramsey numbers (their Theorem 3.6): every 3-coloring of K10K_{10} contains a K4K_4 that uses at most two colors. The r=4r = 4 argument involves edge counting and the Ramsey number R(3,4)=9R(3, 4) = 9 [12]. The case r=5r = 5, the existence of a balanced 5-coloring of K26K_{26}, has remained open since 1999.

In this paper, our main result settles Erdős–Gyárfás balanced five-colorings as stated in Theorem 1.

Theorem 1. There is no balanced 5-coloring of K26K_{26}. Equivalently, every 5-coloring of the edges of K26K_{26} contains a copy of K6K_{6} that misses at least one color. The Erdős–Gyárfás conjecture holds for r = 5.

Corollary 1. The maximum n for which KnK_n admits a balanced 5-coloring is exactly 25=5225 = 5^2.

Proof. Restricting a balanced 5-coloring of KnK_n to any 26 of its vertices would give a balanced 5-coloring of K26K_{26}, since every set of 6 chosen vertices still spans all 5 colors. Theorem 1 therefore rules out every n≥26n \geq 26. The affine coloring of K25K_{25} described above attains 25.

A balanced 5-coloring of K26K_{26} can be written as one propositional formula: the Boolean variables indicate the colors of the edges, and the clauses require that each edge has exactly one color and that every set of 6 vertices contains an edge of each

Figure

balanced 2-coloring of K5K_{5}

Figure

balanced 3-coloring of K9K_{9}

Figure 1: Two balanced colorings. Left: K5K_5 colored by the pentagon C5C_5 (solid) and its complement (dashed); every 3 vertices span both colors, which is why the conjecture is stated for r≥3r \geq 3. Right: the affine coloring of K9K_9. The vertices are the 9 points of the affine plane of order 3, drawn as a 3×33 \times 3 grid, whose lines are the rows, the columns, and two classes of diagonals that wrap around the grid. Edges inside a row get the first color (solid), edges inside a column the second (dashed), and all remaining edges, which form the two diagonal classes, the third (dotted). Any 4 vertices include two in the same row, two in the same column, and two in neither, so every 4 vertices span all three colors.

color. However, such formulas are not solved in practice by state-of-the-art satisfiability (SAT) or constraint solving. Even the simpler formula for the known case r=4r = 4 on K17K_{17} was not decided in our tests within 3600 seconds by the SAT solver kissat [3], by the constraint solver CP-SAT [23], or by CP-SAT with added cardinality constraints. The obstacle is the huge search space with its symmetries: relabeling the 17 vertices and permuting the 4 colors turns every coloring into up to 17!⋅4!17! \cdot 4! equivalent copies (the group S17×S4S_{17} \times S_4, where SmS_m permutes mm objects). To overcome this obstacle, we design a reduce-dispatch-enumerate workflow: a reduction, an analytic dispatch of the near-extremal cases, and a computation. Furthermore, we design layers of certification to ensure that our results are trustworthy.

The reduction. We write e(G)e(G) for the number of edges of a graph GG. The smallest color class G0G_0 of a balanced 5-coloring of K26K_{26} has e(G0)≤325/5=65e(G_0) \leq 325/5 = 65, as the five classes partition the 325 edges. On the other hand, with α(G0)≤5\alpha(G_0) \leq 5 and the Caro–Wei inequality (a lower bound on the independence number in terms of the vertex degrees, see Section 3), we have e(G0)≥55e(G_0) \geq 55. These two bounds leave the 11 edge counts e∈[55,65]e \in [55, 65]. Furthermore, the definition of balance also forces a local-density property (L), and the conjecture can be further reduced to the following statement, by a proof formally verified in the proof assistant Lean 4 (Section 3):

Main Lemma. No graph on 26 vertices has independence number at most

5, the local-density property (L) that every 6 vertices span at most 11 edges, and between 55 and 65 edges.

We settle the five edge counts e∈[55,59]e \in [55, 59] analytically with two classical stability theorems [7, 16], as the complement of G0G_0 then has at least 266 of the at most 270 edges of a K6K_6-free graph on 26 vertices (Section 4).

The computation. The remaining 6 edge counts, e∈[60,65]e \in [60, 65], are settled by an exhaustive enumeration of the graphs for the smallest class G0G_0 rather than for its dense complement. We enumerate the graphs with SAT modulo symmetries (SMS) [20], using encodings designed for it, where a SAT solver prunes graphs that are not the lexicographically smallest copy in their isomorphism class (Section 2). We further parallelize the search by cube-and-conquer, choosing the variables to fix by their frequency (Section 5.3), so that the computational load is spread evenly over independent subproblems (cells). For e∈{63,64,65}e \in \{63, 64, 65\}, we split each formula into 4,096 cubes, and we obtain refutation proofs for all subproblems. To make the computation trustworthy, we not only checked the proofs with an independent checker, but also validated all symmetry-breaking clauses added during the search against their permutation witnesses, the relabelings of the vertices that justify them (Section 6). Fig. 2 summarizes the workflow.

Contributions. (i) Result. We settle the case r=5r = 5 of the Erdős–Gyárfás conjecture, the first new case since 1999 (Theorem 1, Corollary 1). (ii) A verified reduction chain. A reduction checked in Lean 4 turns the conjecture into the Main Lemma, a statement about one sparse graph with 11 possible edge counts. The formal main theorem has the Main Lemma as its only hypothesis. (iii) Efficient encodings and cube selection. We encode the sparse class, impose the local-density property only on one densest 6-set per enumerated graph, and choose the 12 cube variables by their frequency, so that the heaviest cube holds 8.3% of a test family, against 74 to 100% for structural choices and SMS's default cubing (Section 5). (iv) Layers of certification. Programs separate from the search check the encodings, the completeness of the enumeration, the refutations of all 12,296 cells (with drat-trim), and all 273,503,938 symmetry-breaking clauses against their permutation witnesses. As the certified search covers all 11 edge counts, the result depends on neither external theorem (Section 6, Table 4).