Manuscript Offprint
arXiv:2610.35136Sharp Bounds for Graph-Codes Avoiding Complete Bipartite Differences
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Let be the largest fraction of all graphs on [n] in a family containing no two distinct members whose symmetric difference is a copy of . We determine this maximum density for every fixed pair of positive integers s, t. If both part sizes are odd, it is known that the density is exactly 1/2. Otherwise, let 2h be the largest even part size. We prove
For , this improves the general upper bound obtained from Alon's two-copy gluing theorem [1]. The sharp bounds for even stars were already proved by Alon and are recovered as special cases.
The upper bound uses the Frankl–Füredi forbidden-intersection theorem. For the lower bound, we construct binary linear codes using BCH codes. When exactly one part size is even, we assign to each edge the sum of the binary vectors assigned to its endpoints. When both part sizes are even, we identify these vectors with elements of a finite field and assign to each edge the product of its endpoint elements. In both cases, every copy of has a nonzero syndrome.
1 Introduction
In classical binary error-correcting codes, any two distinct codewords must differ in sufficiently many coordinates. In graph-codes, each coordinate represents a possible edge of a graph. Instead of requiring a minimum number of differences, we forbid certain graphs from appearing as the difference between two codewords. In this paper, we study families of graphs in which the symmetric difference of any two distinct members is not exactly a complete bipartite graph . Our goal is to determine the maximum possible size of such a family.
All graphs in this paper are finite, simple, and undirected. Write , and let be the set of all graphs with vertex set . There are such graphs. The symmetric difference is the graph whose edges belong to exactly one of and . For disjoint nonempty sets , write for the graph whose edge set consists of all pairs with one endpoint in and the other in . In particular, vertices outside are isolated in .
Fix positive integers . A -code is a family such that
for every two distinct and every pair of disjoint sets with and . We study the maximum density
This is Alon's graph-code density parameter [1], specialized to complete bipartite forbidden differences.
Identifying a graph with its binary edge-indicator vector identifies with the vector space . Vector addition is then symmetric difference. A graph-code is binary linear if it is a subspace of this vector space. Let denote the maximum density among binary linear -codes. Since every linear code is also a code without the linearity restriction,
Theorem 1.1 (Complete bipartite classification). Fix positive integers s, t. If both s and t are odd, then
If at least one of s, t is even, let 2h be the largest even integer among s, t. There are positive constants such that, for all sufficiently large n,
Equivalently, the classification for arbitrary graph-codes is
All asymptotic statements take with fixed. If , no copy of exists on , so both densities are one. We therefore focus on .
The theorem also determines the number of independent binary parity checks needed by an optimal linear code, up to an additive constant. The codimension of a subspace is . A subspace of codimension has density . Let be the minimum codimension of a binary linear -code.
Corollary 1.2 (Optimal linear codimension). Fix positive integers s, t. If both part sizes are odd, then . Otherwise, let 2h be the largest even part size. Then
and, as ,
The first bound in Corollary 1.2 holds for every . The lower bound implicit in the second statement follows from the upper bound for arbitrary codes in Theorem 1.1.
1.2 Previous work and our results
The study of graph-codes was developed by Alon, Gujgiczer, Körner, Milojević, and Simonyi [3]. They studied families of graphs whose pairwise symmetric differences satisfy prescribed properties. Alon [1] then considered the problem of forbidding a fixed graph H as the symmetric difference of two distinct members. He determined the maximum density, up to constant factors, when H is a star or a matching with an even number of edges. In particular, he proved
His proof uses the forbidden-intersection theorem of Frankl and Füredi [5] for the upper bound and BCH codes for the lower bound.
Alon’s Proposition 1.5 in [1] gives an upper bound for a larger class of graphs. To construct such a graph , start with two copies of a graph and choose an independent set of vertices in . Merge the two copies of each vertex in , leaving all other vertices distinct. Alon proved that the resulting graph satisfies
Every can be constructed in this way. Take two copies of and merge the corresponding vertices in their parts of size u. The resulting graph is . Consequently,
Conlon, Lee, and Versteegen [4, Theorem 1.7] extended this upper bound to a larger class of graphs, called positive graphs. Their theorem gives
for every positive graph . In particular, it applies to every with at least one even part. Thus, their theorem applies to more graphs than Alon's Proposition 1.5, but gives the same bound for the complete bipartite graphs considered here.
Versteegen [8] studied the corresponding problem for linear graph-codes. His Theorem 1.2 shows that every fixed graph H with an even number of edges satisfies
His Theorem 1.3 gives a polynomial bound for graphs that admit an even decomposition . In particular, every bipartite graph with an even number of edges belongs to this class. The theorem therefore implies
whenever st is even. For the complete bipartite graphs considered here, however, the upper bound for arbitrary codes is stronger. Janzer and Yip [7] subsequently strengthened the results on the proportion of graphs admitting an even decomposition. Their work does not improve the density bound for a fixed .
Table 1 summarizes the bounds.
An even decomposition of is a sequence such that, for each , the set is independent, and the number of edges between and is even.
| Forbidden graph | Earlier bounds and constructions | This paper |
|---|---|---|
| ; recovered | ||
| Upper: [1, 4]. | ||
| Upper: [1, 4]. |
Table 1: Comparison with earlier results and constructions. The upper bounds apply to arbitrary graph-codes. The lower bounds are achieved by linear codes.
1.3 Our contribution
Our main result determines the maximum density of -codes up to constant factors for every fixed pair of positive integers .
For the upper bound, we use essentially the same proof that Alon [1] used for even stars. In Alon's proof, one vertex is fixed, and the Frankl–Füredi theorem is applied to stars whose other endpoints form sets of size . We make the following modification: instead of fixing one vertex, we fix a set of vertices and consider complete bipartite graphs , where and . This gives
improving the previously known general bound when .
For the lower bound, we distinguish two cases. When exactly one part size is even, the matching lower bound follows directly from the BCH method used by Alon [1].
When both part sizes are even, the BCH construction based on vertex degrees does not work, since every vertex of the forbidden graph has even degree. We instead assign elements of a finite field to the vertices and assign to each edge the product of its endpoint elements. The vertex elements are chosen using BCH codes so that the sums over the two parts of every forbidden complete bipartite graph are nonzero. This gives
which matches our upper bound.
1.4 Proof overview
We first explain the idea of the upper bound. Suppose that at least one of is even. Write the forbidden graph as , where is an even part size and is the size of the other part. Fix a set of size . For every set of size , consider the complete bipartite graph , whose two parts are and .
The key observation is that if two such sets and satisfy , then their symmetric difference has exactly vertices. Consequently,
which is a copy of the forbidden graph . Therefore, a -code cannot contain both and .
We use the Frankl–Füredi theorem to bound how many graphs from this special family can belong to a code. We then show that this bound also gives an upper bound on the density of the entire code. The argument uses the fact that taking the symmetric difference of every graph in a code with the same fixed graph preserves the forbidden-difference condition. This gives . When both s and t are even, we choose 2h to be the larger part size to obtain the stronger bound.
For the lower bound, we construct a linear code by assigning a binary vector to each edge of the complete graph on . The vectors are chosen so that, for every copy of , the sum of the vectors assigned to its edges is nonzero. All vector additions are performed over .
Suppose first that the forbidden graph is , where is odd. We begin by assigning a binary vector where to each vertex . These vectors are constructed using BCH codes. They have the property that the sum of the vectors assigned to any positive even number of at most distinct vertices is nonzero.
We then assign the vector to edge . Consider a copy of with parts and , where and . When we sum the vectors assigned to its edges, each vertex vector appears as many times as the degree of that vertex. Since vertices in have even degree and vertices in have odd degree, the sum is . This sum is nonzero by the BCH property.
If both parts of are even, the preceding construction does not work because every vertex has even degree. We therefore use a different assignment of vectors to edges. We identify the binary vectors with elements of a finite field of characteristic two, preserving addition. We then assign the field element to edge .
For a complete bipartite graph with parts A and B, the sum of the elements assigned to its edges is
Both factors are nonzero by the BCH property. Their product is therefore nonzero.
In both cases, we obtain a linear map that assigns to each graph the sum of the vectors assigned to its edges. Every copy of has a nonzero sum. Consequently, the set of graphs whose sum is zero forms a linear -code.
2 Preliminaries
2.1 Translations and averaging
For and , define
This is called a translate of C. If C is a -code, every translate is also a -code, since
The following standard averaging lemma allows us to obtain an upper bound on the density of a code by bounding its intersection with a fixed family of graphs. It is the translation-averaging form of the vertex-transitivity argument used by Alon [1, Section 2.1]. We include a proof for completeness.
Lemma 2.1 (Translation averaging, [1]). Let be a nonempty subset of . Suppose that every -code satisfies . Then
Proof. Fix a -code , and choose uniformly from . For each fixed , the graph is uniform in . Thus
Summing these probabilities over gives
Every translate is a -code, so the hypothesis bounds the random variable inside the expectation by . Dividing by bounds the density of .
2.2 A forbidden-intersection theorem
In the proof of the upper bound, we need to bound the size of a family of sets, each containing exactly elements, such that no two distinct sets have exactly elements in common. We use the following special case of the Frankl–Füredi theorem [5, Theorem 2.1]. The same special case is used in Alon's star proof [1, Section 2.1].
For a finite set , the notation denotes the family of its -element subsets.
Theorem 2.2 (Frankl–Füredi, specialized form [5]). For each integer , there is a constant with the following property. Let be a set of size , and let . If
then
For h = 1, one may take .
We explain how this special case follows from the Frankl–Füredi theorem [5], using the formulation given in Alon [1, Theorem 2.2]. For , apply that theorem with the parameters and . The theorem applies to families of sets of size in which the intersection of any two distinct sets has size either at least or strictly less than .
With our choice of parameters, these conditions become or . Since the intersection size is an integer, this is equivalent to requiring that . The Frankl–Füredi theorem therefore gives
For , every set in has exactly one element. Any two distinct such sets have intersection size zero, which is forbidden because . Therefore, contains at most one set, as required.
2.3 Linear parity checks
The lower bounds will be obtained by assigning a fixed binary vector to each possible edge. The sum of the labels on the edges of a graph is its syndrome. Fix labels for , and define
Here is the edge set of , and the sum is over . An edge that occurs in both and contributes twice and cancels, so . In particular, is linear in the edge-indicator vector of .
The following lemma is the syndrome construction used by Alon [1, Section 2.2], specialized to complete bipartite graphs. We include a proof for completeness.
Lemma 2.3 (Syndrome construction [1]). Suppose the labels satisfy for every pair of disjoint sets with and . Then is a binary linear -code of codimension at most . Its density is at least .
Proof. The kernel is a subspace. If , linearity gives . The assumed nonzero syndrome of every therefore prevents from being a forbidden difference. By rank-nullity, the codimension of the kernel is rank . Its density is consequently .
We will also use Lemma 2.3 when the edge labels lie in . This causes no change: the additive group of is an -dimensional vector space over . Choosing a binary basis turns each field-valued syndrome into binary parity checks.
3 The upper bound for arbitrary graph-codes
In this section we prove the upper bounds.
3.1 At least one part is even
We now use Theorem 2.2 to prove an upper bound on the density of a -code. Lemma 2.1 will turn the resulting intersection bound into a density bound.
The following proves the upper bound of Theorem 1.1
Proposition 3.1 (An even part gives an upper bound). Fix integers . Then
More precisely, with the constant from Theorem 2.2, for ,
Proof. Fix a set of size , put , and let . Consider
Since is nonempty, distinct sets give distinct graphs , so .
For any -code D, the family
contains no pair with intersection size . Indeed, such a pair would satisfy , and hence
would be a forbidden . By Theorem 2.2,
Lemma 2.1 therefore gives
For fixed , the denominator has order . Since , this proves the stated asymptotic bound.
When both parts are even, we apply Proposition 3.1 with the larger part as the part of size 2h. This proves the upper bound in Theorem 1.1 whenever at least one part is even. We next construct linear codes with matching density.
3.2 Both parts odd
When both and are odd, the equality is already known; see Versteegen [8] and Alon [2]. We include a short proof for completeness.
Proposition 3.2 (Both parts odd). Let be odd integers. Then, for every ,
Proof. We first prove the upper bound.
Fix two disjoint sets with and , and let . The map partitions all graphs on into disjoint pairs . The two graphs in each pair are distinct, and their symmetric difference is . Therefore, a -code can contain at most one graph from each pair. Since there are such pairs, every -code satisfies . Consequently,
For the matching lower bound, consider the family of all graphs on having an even number of edges. Since s and t are odd, every copy of has an odd number st of edges. However, the symmetric difference of two graphs with an even number of edges always has an even number of edges. Thus, this family is a -code. Exactly half of all graphs on have an even number of edges. Therefore,
Combining the two bounds proves the proposition.
4 Linear constructions
We first assign a binary vector to each vertex . These vectors are chosen so that the sum of the vectors assigned to any positive even number of at most 2h distinct vertices is nonzero.
We then prove a lemma that allows us to view these binary vectors as elements of a finite field and multiply them. Finally, we use these results to construct linear -codes. We give one construction when exactly one part is even and another when both parts are even.
4.1 Vertex labels that detect even subsets
In our constructions, we only need binary vectors such that the sum of the vectors assigned to any positive even number of at most 2h distinct vertices is nonzero. We use a modification of the standard BCH construction [6, Chapter 5], which was also used by Alon [1, Section 2.2]. Since we only require nonzero sums for even-sized subsets, we can allow zero as one of the field elements. This reduces the number of binary coordinates from to .
Lemma 4.1 (Even-subset labels). Let and be integers, and put . There exist vectors such that
whenever has positive even size at most 2h.
Proof. Choose distinct elements of , allowing zero, and define
Suppose that an even set of size , where , has zero label sum. For , put . The assumed zero sum gives for every odd . The identity then gives for : write each such as a power of two times an odd integer and apply the identity repeatedly. Also, define . Since is even, in .
Writing , these equations say
The matrix is a Vandermonde matrix with determinant , because the are distinct. It cannot annihilate the nonzero all-one vector, a contradiction. Expanding the coordinates in a binary basis of gives the required vectors in and preserves all subset sums.
4.2 Constructing linear codes from vertex vectors
In this subsection, we prove that if binary vectors assigned to the vertices have nonzero sums over every subset of size s or t, then these vectors can be used to construct a binary linear -code.
Lemma 4.2 (Linear code construction). Let , and suppose that vectors satisfy
Then there is a binary linear -code of codimension at most r and density at least .
This refinement does not affect our main result. Both bounds give the same asymptotic density . The improvement only reduces the number of binary coordinates by h when n is a power of two.
Proof. Choose an -linear isomorphism and put . Label edge by , and let be the sum of these fixed edge labels. For disjoint with and , distributivity gives
Both factors are nonzero by the hypothesis. Their product is nonzero because it is taken in a field. Lemma 2.3 therefore shows that is the required code.
Only additivity is required of ; it need not preserve coordinatewise multiplication.
4.3 The linear construction
We now use Lemma 4.1 for the largest even part. Depending on the parity of the other part, we add or multiply endpoint labels.
The following proves the lower bound of Theorem 1.1.
Proposition 4.3 (Linear lower bound). Suppose that at least one of is even, and let be the largest even part size. For every , there is a binary linear -code of codimension at most .
In particular,
Proof. Write , put , and take the vectors from Lemma 4.1. Identify them additively with . This preserves the nonzero sums of even subsets of size at most 2h.
If is odd, label edge by . For disjoint sets with and , the vertices in have even degree and those in have odd degree. The syndrome of is therefore
where the inequality follows from Lemma 4.1. Lemma 2.3 gives the required code.
If is even, then . Lemma 4.1 guarantees nonzero subset sums of both sizes and . Applying Lemma 4.2 with , we obtain a binary linear -code of codimension at most and density at least .
References
[1] Noga Alon. Graph-codes. European Journal of Combinatorics, 116:103880, 2024. doi: 10.1016/j.ejc.2023.103880.
[2] Noga Alon. Graph-codes: questions, results and methods. Japanese Journal of Mathematics, 21(2): 145–164, 2026. doi: 10.1007/s11537-026-2536-1.
[3] Noga Alon, Anna Gujgiczer, János Körner, Aleksa Milojević, and Gábor Simonyi. Structured codes of graphs. SIAM Journal on Discrete Mathematics, 37(1):379–403, 2023. doi: 10.1137/22M1487989.
[4] David Conlon, Joonkyung Lee, and Leo Versteegen. Around the positive graph conjecture. To appear in Combinatorics, Probability and Computing. Preprint, arXiv:2404.17467, 2024. URL https://arxiv.org/abs/2404.17467.
[5] Peter Frankl and Zoltán Füredi. Forbidding just one intersection. Journal of Combinatorial Theory, Series A, 39(2):160–176, 1985. doi: 10.1016/0097-3165(85)90035-4.
[6] W. Cary Huffman and Vera Pless. Fundamentals of Error-Correcting Codes. Cambridge University Press, Cambridge, 2003. doi: 10.1017/CBO9780511807077.
[7] Oliver Janzer and Fredy Yip. The probability that a random graph is even-decomposable. Random Structures & Algorithms, 67(3):e70034, 2025. doi: 10.1002/rsa.70034.
[8] Leo Versteegen. Upper bounds for linear graph codes. Random Structures & Algorithms, 66(1):e21263, 2025. doi: 10.1002/rsa.21263.