A Curious Bound on the Complexity of Graphs With No 4-Cycles
I encountered this rather bizarre looking fact in my undergraduate graph theory class:
Let be a connected graph with vertices and edges. If does not contain a -cycle, then .
This struck me as odd. For an unrestricted graph, the number of edges can be as large as (e.g. the complete graph). This fact implies that the complexity drops to if we simply stipulate that there are no cycles of length .
Let’s dive into a proof. We begin by defining some special subsets of :
Where represents the distance (i.e. length of shortest path) from to . For example, gives all pairs of adjacent vertices and gives all pairs of (non-adjacent) vertices that have a mutual friend. Since the ‘s partition the set of all pairs of vertices, we have
Now, let and consider the quantity , which counts the pairs of vertices in the neighborhood of . Either the vertices in these pairs are of distance 1 (if they are adjacent) or they are of distance 2 (since they are both adjacent to ). Observe that they cannot both be in the neighborhood of any other vertex – otherwise this would form a 4-cycle. Thus, summing over we count each pair of vertices exactly once:
We now have:
(1)
Here we made use of the so-called handshake lemma, which states .
Applying the Cauchy-Schwarz inequality:
combining with (1):
we get a quadratic in which we solve directly to get the desired result:
There is a neat construction (due, I think originally, to Erdös) for a family of graphs that achieve this asymptotic upper bound, showing that it is in fact a tight bound. For any prime number , we construct a graph of order by taking our vertices to be
Here, is the finite field of order . Our edge relation is given by
Recall that all arithmetic in this field is done . It is easy to see that every vertex in the resulting graph will have degree . Thus, . We do not necessarily have equality here since there may be self-adjacent vertices. If we decide to exclude these loops for the sake of the construction, the asymptotic complexity does not change.
It remains to show that we have not created any 4-cycles. Indeed, for any two vertices and , their neighborhoods have at most 1 vertex in common. This follows from the fact that the system
has a unique solution when and no solution otherwise.
For example, when the above construction yields the following graph: