Crossing Number of Complete Graphs: How OpenAI Proved Hill’s Drawing Is Optimal

Seven dots, twenty-one connections, nine unavoidable crossings. That is the answer for the complete graph K7K_7, even when every connection may bend. The difficult question was whether the same classical formula remained optimal for every graph size, however cleverly its edges were routed.

OpenAI’s September 23, 2026 paper presents a proof that the crossing number of complete graphs equals the Harary–Hill floor-product formula. Its argument supplies the missing universal lower bound, then matches it with a two-page drawing. OpenAI also reports a Lean formalization with both components in its stated scope. Here is how the proof turns intersections into polynomial information, and that information into an exact minimum.

1. What Is the Crossing Number of a Complete Graph?

A complete graph KnK_n connects every pair of its nn vertices, giving (n2)=n(n−1)/2\binom{n}{2}=n(n-1)/2 edges. Vertices are distinct points. Edges are simple continuous arcs whose interiors avoid vertices. Different edge interiors meet only at finitely many proper double crossings, with no overlaps, tangencies, or triple intersections.

For a drawing DD, let c(D)c(D) count its crossing points. The ordinary crossing number cr(Kn)\operatorname{cr}(K_n) is the smallest such count over all admissible plane drawings. If two edges cross three times, that contributes three, rather than one. Shared endpoints are vertices, not crossings.

1.1. Crossing Number of Complete Graphs: Key Facts

QuestionAnswer
Graph familyKnK_n has nn vertices and one edge for every vertex pair.
What is minimized?The total number of interior crossing points across all ordinary plane drawings.
Are curved edges allowed?Yes. Edges are simple continuous arcs. Repeated crossings between two edges count separately.
What does the paper prove?The Harary–Hill floor product is the exact minimum, with a matching two-page construction.
What is the formal scope?OpenAI reports both the lower bound and the matching construction in Lean.

The crossing number of a complete graph concerns the best drawing, rather than the first picture generated by a layout tool. K5K_5 is the first complete graph that cannot be drawn without a crossing. Its ten edges exceed the nine-edge maximum for a planar graph on five vertices, while a one-crossing drawing exists.

5 Crossings
3 Crossings
1 Crossing
The same graph, K5K_5, in three drawings. Orange dots mark crossings, while teal dots mark vertices. The one-crossing drawing reaches the minimum.

2. The Harary–Hill Formula: Exact Crossings for Every Kₙ

Theorem 1.1 of the complete-graph crossing paper states, for every integer n≥3n\geq3:

cr⁡(𝑲𝒏)=𝒁(𝒏)=14⌊𝒏2⌋⌊𝒏−12⌋×⌊𝒏−22⌋⌊𝒏−32⌋.\boldsymbol{\begin{aligned}\operatorname{cr}(K_n)=Z(n)&=\frac14\left\lfloor\frac n2\right\rfloor\left\lfloor\frac{n-1}{2}\right\rfloor\\&\quad\times\left\lfloor\frac{n-2}{2}\right\rfloor\left\lfloor\frac{n-3}{2}\right\rfloor.\end{aligned}}

The floor function ⌊x⌋\lfloor x\rfloor means the greatest integer no larger than xx. Thus ⌊3.5⌋=3\lfloor3.5\rfloor=3. The complete graph crossing number formula multiplies four such integers and divides by four. The result is an exact minimum because the paper proves both that every drawing needs at least this many crossings and that a drawing attains it.

Our bin packing explainer similarly separates a feasible construction from proof of the true optimum.

2.1. Minimum Crossings for Small Complete Graphs

Complete GraphMinimum Crossings
K5K_51
K6K_63
K7K_79
K8K_818
K9K_936

For the crossing number of K6K_6, the calculation is (3·2·2·1)/4=3(3\cdot2\cdot2\cdot1)/4=3. For the crossing number of K7K_7, it is (3·3·2·2)/4=9(3\cdot3\cdot2\cdot2)/4=9. Adding a vertex can increase the minimum sharply because it introduces an edge to every existing vertex.

3. Why the Harary–Hill Conjecture Resisted Proof for Decades

Hill’s construction was known long before this manuscript. Guy published an upper bound in 1960, and Harary and Hill discussed the construction and conjecture in 1963. But an attractive drawing answers an existence question: can this count be achieved? Optimality asks whether every conceivable drawing must do at least as badly.

Earlier work established exact small cases. The paper cites computer-assisted results giving 100 crossings for K11K_{11}, 150 for K12K_{12}, 225 for K13K_{13}, and 315 for K14K_{14}. The earlier two-page crossing theorem also established the formula within that restricted drawing class. Shellability extended the lower bound to additional families, without covering arbitrary drawings.

Balogh, Lidický, and Salazar’s asymptotic lower-bound research pushed the limiting ratio to the conjectured value above 0.98559895, or 98.559895 percent. An asymptotic percentage cannot establish exact equality at every size. As with Boolean-circuit lower bounds, every permitted representation must be covered. A Harary–Hill conjecture proof needed unrestricted reach. OpenAI extracts algebraic constraints that every drawing must obey.

4. Hill’s Two-Page Drawing: A Construction That Achieves the Formula

	Crossing number of complete graphs: a K7 drawing has two upper and seven lower crossings.
Crossing number of complete graphs: a K7 drawing has two upper and seven lower crossings.

Section 5 uses an endpoint-sum book construction attaining Hill’s classical bound. Number the vertices from 0 to n−1n-1 and place them left to right on a horizontal spine. Set m=⌊n/2⌋m=\lfloor n/2\rfloor. Assign residues 0 through m−1m-1 to the upper page and the remaining residues to the lower page.

For an edge joining ii and jj, reduce i+ji+j modulo nn and choose the corresponding page. Draw it as a semicircle there. Edges on opposite pages cannot cross. On the same page, two edges cross exactly once when their four endpoints alternate along the spine. Nested endpoint intervals do not produce crossings.

0123456Upper Page: 2 Crossings
0123456Lower Page: 7 Crossings
The two pages of K7K_7, shown separately on identical spines. Teal arcs belong above the spine and magenta arcs below it. Together the pages contain all 21 edges and nine crossings.

For K7K_7, residues 0, 1, and 2 go above the spine. This gives two crossings above and seven below. For example, edges 02 and 16 belong above and cross because 0<1<2<60<1<2<6. Choose vertex positions generically to prevent triple intersections. The paper’s enumeration, including a parity check for even orders, gives exactly Z(n)Z(n). This proves cr(Kn)≤Z(n)\operatorname{cr}(K_n)\leq Z(n).

5. Why the Proof Can Start With Normalized Drawings

Curved edges need careful handling before tangent signs and local orders become useful. Appendix A proves that a minimum drawing can be chosen polygonal, straight near vertices and crossings, and free of crossings between adjacent edges. Adjacent edges share a vertex.

The argument isolates vertices and crossing points inside disjoint small disks. Between disks, retained edge pieces sit inside separate neighborhoods. Each continuous piece can be replaced by a polygonal path within its neighborhood, so replacements cannot accidentally collide. Inside crossing disks, straight chords introduce at most one crossing. Inside vertex disks, straight spokes meet only at the vertex.

Crucially, the construction cuts away passages using first and last visits to the disks. It does not assume a continuous arc visits a circular boundary only finitely often. This closes a subtle gap that an informal “straighten everything” instruction would leave.

If adjacent edges crossed in a minimum drawing, swapping their initial tracks and removing loops would eliminate a crossing without adding another. That contradicts minimality. Independent edges may still cross repeatedly. Normalization therefore prepares the geometry without silently changing the objective to counting intersecting pairs.

Before: Curved Strands
After: Straight Chords
An isolated crossing disk, schematically. Replacing the two strands by chords retains this crossing. Separate exterior neighborhoods prevent new intersections elsewhere.

6. Signed Intersections and the Cycle-Pairing Identity

Orient each edge. A crossing receives sign +1 or −1 according to whether the ordered tangent directions agree with the plane’s positive orientation. Write I(e,f)I(e,f) for the sum of these signs. Unlike the ordinary crossing count, this sum permits cancellation.

At a vertex ww, list incident edges counterclockwise from a chosen gap. Let Tw(e,f)T_w(e,f) be +1 when ee precedes ff, −1 for the reverse order, and zero when they coincide. Let σwe\sigma_{we} be +1 for an edge pointing outward and −1 for one pointing inward. The corrected pairing is:

𝑱(𝒆,𝒇)=𝑰(𝒆,𝒇)+12∑𝒘 commonendpoint𝝈𝒘𝒆𝝈𝒘𝒇𝑻𝒘(𝒆,𝒇).\boldsymbol{\begin{aligned}J(e,f)&=I(e,f)\\&\quad+\frac12\sum_{\substack{w\text{ common}\\\text{endpoint}}}\sigma_{we}\sigma_{wf}T_w(e,f).\end{aligned}}

A cycle is an edge combination with zero boundary: incoming and outgoing coefficients balance at each vertex. Lemma 2.1 proves that J(z,z′)=0J(z,z^{\prime})=0 for any two cycles. Geometrically, closed walks have total signed intersection zero in the plane. When cycles share vertices or tracks, averaging two slight displacements produces the half-weight correction. The local term makes the geometric cancellation valid even with shared edges. This pairing is skew-symmetric: exchanging its arguments reverses its sign.

7. Lagrange Interpolation and the Even-Node Order Detector

Crossing number of complete graphs proof: two zero rows reduce eight interpolation nodes to six.
Crossing number of complete graphs proof: two zero rows reduce eight interpolation nodes to six.

Give vertices distinct real labels, separate from their positions in the drawing. For distinct nodes u1,…,uNu_1,\ldots,u_N, define G(t)=∏p=1N(t−up)G(t)=\prod_{p=1}^{N}(t-u_p). Lagrange interpolation supplies the weighted identity:

∑𝒑=1𝑵𝑨(𝒖𝒑)𝑮′(𝒖𝒑)=0(deg⁡𝑨≤𝑵−2).\boldsymbol{\sum_{p=1}^{N}\frac{A(u_p)}{G^{\prime}(u_p)}=0\qquad(\deg A\leq N-2).}

It follows by comparing the highest-degree coefficient in the interpolation formula. The denominators are nonzero because the nodes are distinct. These weights later make suitable polynomially weighted edge combinations into cycles.

For 2s2s nodes, Lemma 3.2 samples a two-variable polynomial on two triangular patterns of index pairs. In the first half, select q<pq<p; in the second, select p<qp<q. Together the patterns contain s(s−1)s(s-1) points. They determine polynomials of separate degrees at most s−1,s−2s-1,s-2, or the swapped limits.

11223344556677881. Eliminate Rows 4 and 5
1122336677882. Six Nodes Remain
Indices describe the prescribed order, not numerical label size. Each orange row contains three samples. Factor out (u−u4)(u−u5)(u-u_4)(u-u_5) and delete those indices to obtain the smaller two-triangle pattern.

For eight nodes, rows 4 and 5 each contain three samples. A polynomial of degree at most two in its second variable must vanish along both rows if those samples vanish. Dividing out (u−u4)(u−u5)(u-u_4)(u-u_5) leaves the smaller six-node problem with the degree limits swapped.

Lemma 3.3 combines this interpolation with the prescribed local order. Its pairing MM includes order signs, node differences, and Lagrange weights. Weighted cancellation removes allowable row and column terms, leaving nonzero diagonal weights on the two triangles. Thus the detector is nonsingular for any prescribed order, even when that order differs from the numerical order of the labels.

“Nonsingular” means that a polynomial cannot hide from every test polynomial unless it is zero. The geometry chooses the local order, while the labels can be arbitrary distinct real numbers. Requiring those two orders to agree would impose an unjustified restriction on the drawings. The detector avoids that restriction, which is why this interpolation lemma can serve a universal lower bound.

8. Why the Crossing Evaluations Determine the Polynomial

Now take n=2s+1n=2s+1, with s≥2s\geq2. Let SS contain four-variable polynomials P(x,u,y,v)P(x,u,y,v) of degree at most s−2s-2 in each variable. Require symmetry within (x,u)(x,u) and within (y,v)(y,v), but not under exchanging the two edge pairs.

A symmetric polynomial in one pair has a basis indexed by exponent pairs 0≤a≤b≤s−20\leq a\leq b\leq s-2. There are (s2)\binom{s}{2} choices. Choosing a basis element independently for each endpoint pair gives:

dim⁡𝑺=(𝒔2)2.\boldsymbol{\dim S=\binom{s}{2}^{2}.}

Let TT be the ordered pairs of independent undirected edges with nonzero signed crossing count. Evaluate each polynomial at the four vertex labels of every pair in TT. This defines E:S⟶ℝTE:S\longrightarrow\mathbb{R}^{T}. Injectivity means that zero evaluations force the entire polynomial to be zero.

Lemma 4.2 assumes all those evaluations vanish. Polynomial cycle tests eliminate independent-edge terms. Additional factors eliminate all but one shared-endpoint pattern, while interpolation isolates individual vertices. The order detector then forces vanishing whenever endpoints from different edges coincide.

Consequently, all four cross-edge difference factors divide the polynomial:

𝑷=(𝒙−𝒚)(𝒙−𝒗)(𝒖−𝒚)(𝒖−𝒗)𝑹.\boldsymbol{P=(x-y)(x-v)(u-y)(u-v)R.}

Their product is nonzero on independent-edge evaluations. The quotient RR retains both symmetries, remains in SS, and still has zero evaluations, but its separate degrees are two smaller. Choosing a nonzero kernel polynomial of minimum degree makes this impossible. Therefore EE is injective: crossing evaluations retain all the polynomial information the argument needs.

9. The Dimension Argument That Forces Unavoidable Crossings

	Crossing number of complete graphs: nine polynomial dimensions force at least nine K7 crossings.
Crossing number of complete graphs: nine polynomial dimensions force at least nine K7 crossings.

Injectivity alone does not count crossings. Proposition 4.3 applies the cycle tests again, now multiplying two polynomials by all six endpoint differences:

𝚫=(𝒙−𝒖)(𝒚−𝒗)(𝒙−𝒚)×(𝒙−𝒗)(𝒖−𝒚)(𝒖−𝒗).\boldsymbol{\begin{aligned}\Delta&=(x-u)(y-v)(x-y)\\&\quad\times(x-v)(u-y)(u-v).\end{aligned}}

For P,Q∈SP,Q\in S, each variable in PQΔPQ\Delta has degree at most 2(s−2)+3=2s−1=n−22(s-2)+3=2s-1=n-2, exactly within the cycle-test limit. A shared endpoint makes Δ\Delta zero. Only supported independent-edge coordinates remain.

The resulting identity defines a nondegenerate symmetric diagonal bilinear form on ℝT\mathbb{R}^{T}. This is different from the earlier skew-symmetric pairing JJ. Each diagonal coefficient is nonzero. Reversing the order of the two edges gives a separate coordinate with the opposite coefficient, allowing cancellation without degeneracy.

The image W=E(S)W=E(S) is totally isotropic: every pair of its vectors has pairing zero, including a vector paired with itself. Hence W⊆W⟂W\subseteq W^{\perp}. Nondegeneracy gives dimW⟂=|T|−dimW\dim W^{\perp}=|T|-\dim W, so:

2dim⁡𝑬(𝑺)≤|𝑻|.\boldsymbol{2\dim E(S)\leq |T|.}

Each supported unordered edge pair needs at least one actual crossing. Ordered pairs count it twice. Combining this observation with injectivity gives:

𝒄(𝑫)≥|𝑻|2≥dim⁡𝑬(𝑺)=(𝒔2)2.\boldsymbol{c(D)\geq\frac{|T|}{2}\geq\dim E(S)=\binom{s}{2}^{2}.}

Repeated crossings can cancel in the signed sum and remove coordinates from TT. That only reduces the support being counted. It cannot invalidate the lower bound on actual crossing points.

For K7K_7, take s=3s=3. The polynomial space has dimension nine. Injectivity preserves those nine independent directions, while total isotropy requires at least eighteen ordered support coordinates. These represent at least nine unordered crossing pairs. The construction from Section 4 reaches nine, so the algebraic count and the visible drawing agree.

10. Extending the Proof From Odd to Even Complete Graphs

Odd order leaves an even number of other vertices around each vertex, matching the detector’s 2s2s nodes. For even n=2s>4n=2s>4, the paper transfers the odd bound by deleting each vertex in turn.

Every crossing in a normalized minimum drawing involves four distinct vertices. It survives deletion of precisely the other n−4n-4 vertices. Each remaining drawing of Kn−1K_{n-1} has at least the odd-order minimum, regardless of whether that particular subdrawing is optimal. Summing gives:

(𝒏−4)𝒄(𝑫)≥𝒏(𝒔−12)2.\boldsymbol{(n-4)c(D)\geq n\binom{s-1}{2}^{2}.}

Rearranging produces c(D)≥s(s−1)2(s−2)/4c(D)\geq s(s-1)^2(s-2)/4, the even-order floor product. For odd order, the value is (s2)2\binom{s}{2}^2. The cases n=3,4n=3,4 need only the nonnegative lower bound and crossing-free constructions. Both parity arguments therefore support the same compact formula, rather than two unrelated answers.

11. What OpenAI’s Proof Establishes and Why the Bounds Match

The lower bound applies to unrestricted ordinary drawings. The two-page construction supplies the matching upper bound:

cr⁡(𝑲𝒏)≥𝒁(𝒏)andcr⁡(𝑲𝒏)≤𝒁(𝒏).\boldsymbol{\operatorname{cr}(K_n)\geq Z(n)\quad\text{and}\quad\operatorname{cr}(K_n)\leq Z(n).}
cr⁡(𝑲𝒏)=𝒁(𝒏)\boldsymbol{\boxed{\operatorname{cr}(K_n)=Z(n)}}

OpenAI’s mathematics release announcement attributes the wider collection of AI mathematical proofs to an internal frontier model. That context does not supply a paper-specific runtime or reproducible public-model workflow. LLM math benchmark scores measure different evidence. Unlike an algorithmic result such as maximum cardinality matching, this determines an optimum without demonstrating faster graph-layout software.

As checked on October 30, 2026, OpenAI’s Lean scope documentation includes the exact formula, lower bound, and matching two-page drawing. The linked complete-graph comparator specifies a target theorem with a placeholder, rather than providing the implementation proof. This article did not independently rebuild the Lean project. Formal statement fidelity and expert review of the exposition remain separate checks.

The OpenAI Harary–Hill proof concerns ordinary crossing numbers. Straight-line drawings form a restricted subclass, so the formula supplies a lower bound there without establishing rectilinear equality. Pair-crossing and odd-crossing objectives also require separate statements. For the crossing number of complete graphs, the achievement is precise: construction and necessity finally meet. Follow Binary Verse AI for research explainers that connect theorem statements to the arguments and verification evidence behind them.

How do you calculate the crossing number of a complete graph?

For a complete graph KnK_n, substitute nn into the Harary–Hill formula and evaluate its four floor factors. OpenAI’s paper proves that the result is the exact minimum over all ordinary plane drawings, rather than merely the crossing count of one construction.

What are the crossing numbers of K5, K6, and K7?

They are 1, 3, and 9, respectively. For K7K_7, the formula gives (3·3·2·2)/4=9(3\cdot3\cdot2\cdot2)/4=9. These are the minimum crossing counts when edges may be continuous curves.

Why is K5 nonplanar, and how many edges does it have?

K5K_5 has ten edges. A simple planar graph with five vertices has at most 3(5)−6=93(5)-6=9 edges, so K5K_5 cannot be drawn without crossings. A drawing with exactly one crossing exists, giving cr(K5)=1\operatorname{cr}(K_5)=1.

Why did Hill’s original construction not settle the conjecture?

It supplied drawings attaining Z(n)Z(n), which proved an upper bound. It did not exclude every drawing with fewer crossings. The missing step was a matching lower bound without restrictions on vertex positions or edge routes.

How does polynomial interpolation prove a geometric crossing bound?

The proof converts signed intersection and local-order information into polynomial identities. An interpolation-based detector makes the evaluation map injective. A second identity puts its image inside its orthogonal complement for a nondegenerate symmetric form. Comparing dimensions then forces enough supported edge pairs, and therefore enough crossings.

Does the proof apply to curved edges and straight-line drawings?

It applies to unrestricted ordinary drawings with simple continuous curved edges, counting repeated crossings separately. Straight-line drawings are a restricted subclass, so the theorem supplies a lower bound for their crossing numbers. It does not establish equality for the rectilinear crossing number.

Was OpenAI’s Harary–Hill proof verified in Lean?

OpenAI reports a Lean formalization whose stated scope includes the exact complete-graph crossing formula, the lower bound, and a matching two-page construction. The linked comparator defines a target theorem with a placeholder and is not itself the implementation proof. This article did not independently rebuild the project. Machine checking of an encoded statement and review of the accompanying natural-language exposition are distinct checks.

Leave a Comment