Why Search for a Ramsey Lower-Bound Certificate?
For positive integers \(r,s\ge 2\), the Ramsey number \(R(r,s)\) is the least integer \(N\) such that every red-blue colouring of the edges of \(K_N\) contains either a red \(K_r\) or a blue \(K_s\). To prove \(R(r,s)>n\), it is enough to give one red-blue colouring of \(K_n\) containing neither forbidden clique. Such a colouring is a lower-bound certificate: checking it establishes that \(n\) vertices do not suffice.
For small \(n\), a computer can search all colourings, but an unstructured list of colourings is difficult to inspect. Backtracking organizes the search as a tree of partial assignments. At each step it chooses a still-uncoloured edge and branches by assigning it red or blue. If the assignments already made complete a forbidden monochromatic clique, that branch is discarded: no future choice can remove the clique. This tutorial develops the method and explains both what it can certify and why it is exhaustive.
When we describe a red-blue colouring, we give the vertex set and the two edge sets explicitly. Every edge of \(K_n\) belongs to exactly one of these sets. If the red and blue edge sets are \(E_R\) and \(E_B\), then \(E_R\cap E_B=\varnothing\) and \(E_R\cup E_B=E(K_n)\).
The Backtracking Search
Fix an order \(e_1,\ldots,e_m\) of the edges of \(K_n\), where \(m=\binom n2\). A search state consists of a partial colouring of an initial segment of this edge list. At each state, the search tests whether a forbidden clique has been completed. If so, it returns from that branch. If not, it assigns the next edge red and searches that branch, then assigns it blue and searches that branch. When all \(m\) edges have been assigned, the colouring is a valid certificate.
Give \(K_n\) no assigned edge colours and choose an edge order.
If some \(r\)-set has all its edges assigned red, or some \(s\)-set has all its edges assigned blue, discard this branch.
If unassigned edges remain, search once with the next edge red and once with it blue.
A complete admissible colouring gives a lower-bound certificate. If every branch is discarded, no admissible colouring exists for the chosen \(n,r,s\).
The test in Step 2 must examine only completed cliques: all the edges of the candidate vertex set must already be assigned the required colour. The state may still have unassigned edges elsewhere. A completed forbidden clique stays completed in every extension of the state, which is the reason pruning is safe.
Proof. Suppose the partial colouring contains a fully assigned red \(K_r\). An extension assigns colours only to previously unassigned edges; it does not change the colours already assigned to edges of this \(K_r\). Thus this same vertex set remains a red \(K_r\) in every extension, so no extension is admissible. If instead the partial colouring contains a fully assigned blue \(K_s\), its edges also retain their assigned colours in every extension, so every extension contains that blue \(K_s\). Either way, no extension is admissible. \(\square\)
Proof. If the search returns a complete admissible colouring, it assigns every edge exactly one of the two colours and has passed the completed-clique test. By the definition of admissibility, it contains neither forbidden monochromatic clique. This proves one direction.
For the other direction, suppose some admissible complete colouring exists. Consider the search branch whose successive choices agree with that colouring. No partial state on this branch can contain a completed forbidden clique: such a clique would also appear in the assumed admissible complete colouring, since the assigned edges keep their colours. Thus the branch is never discarded by the test. It reaches a complete colouring, and that colouring is admissible, so the search can return it. Consequently, if every branch is discarded, there is no admissible colouring of \(K_n\). By the definition of \(R(r,s)\), every colouring of \(K_n\) then contains a red \(K_r\) or a blue \(K_s\), which implies \(R(r,s)\le n\). \(\square\)
This argument also explains the search’s scope. It proves a lower bound by exhibiting a colouring; it proves that a particular \(n\) has no certificate only after all branches have been explored. A run that stops at its first certificate answers the existence question positively, but does not enumerate or count all certificates.
Worked Searches and Certificates
Worked Example: Finding a Valid Colouring of \(K_4\)
Search for a colouring of \(K_4\) with no red \(K_3\) and no blue \(K_3\). Let \(V=\{1,2,3,4\}\) and process the edges in the order \(12,13,14,23,24,34\). The search uses red-first branching. The table follows the first branch choices until it finds a certificate; each discarded branch is shown before the search backtracks.
| Step | Assignment or test | Result |
|---|---|---|
| 1 | \(12=R,\ 13=R,\ 14=R\) | No triangle is complete yet. |
| 2 | Try \(23=R\). | Edges \(12,13,23\) complete a red \(K_3\); discard this branch. |
| 3 | Backtrack; try \(23=B\), then \(24=R\). | Edges \(12,14,24\) complete a red \(K_3\); discard this branch. |
| 4 | Backtrack; try \(24=B\), then \(34=R\). | Edges \(13,14,34\) complete a red \(K_3\); discard this branch. |
| 5 | Try \(34=B\). | Edges \(23,24,34\) complete a blue \(K_3\); discard this branch. |
| 6 | Backtrack to \(14=B\). Try \(23=R\). | Edges \(12,13,23\) complete a red \(K_3\); discard this branch. |
| 7 | Try \(23=B,\ 24=R,\ 34=R\). | All edges are assigned and no forbidden triangle has been completed. |
The resulting colouring has \(E_R=\{12,13,24,34\}\) and \(E_B=\{14,23\}\). To check it independently, the four triples are \(123,124,134,234\). Triple \(123\) has blue edge \(23\); \(124\) has blue edge \(14\); \(134\) has blue edge \(14\); and \(234\) has blue edge \(23\). So none is a red triangle. A blue triangle is also impossible because there are only two blue edges, while a triangle has three edges. Finally, the edge sets are disjoint and contain \(4+2=6=\binom42\) edges, so they colour every edge of \(K_4\). Thus this is a valid certificate that \(R(3,3)>4\).
Worked Example: Certifying \(R(3,3)>5\)
Let \(V=\{1,2,3,4,5\}\). Colour the cycle edges red and the remaining edges blue: \(E_R=\{12,23,34,45,15\}\) and \(E_B=\{13,14,24,25,35\}\). We verify the certificate without relying on a picture.
The red edges form the cycle \(1,2,3,4,5,1\). The red neighbours of each vertex are its two neighbours on this cycle; those two vertices are not joined by a red edge. Therefore no vertex can belong to a red triangle: a red triangle containing a vertex would require its two other vertices to be joined by a red edge. For blue, the listed edges form the cycle \(1,3,5,2,4,1\). The same neighbour argument shows that the blue edges contain no blue triangle.
Check: The five red edges and five blue edges are disjoint. Since \(K_5\) has \(\binom52=5\cdot4/2=10\) edges, their total of \(5+5=10\) accounts for every edge. Neither colour contains a triangle, so this colouring proves \(R(3,3)>5\), or equivalently \(R(3,3)\ge6\).
Worked Example: The Boundary Case \(R(2,3)>2\)
Consider \(K_2\) with \(V=\{1,2\}\), \(E_R=\varnothing\), and \(E_B=\{12\}\). A red \(K_2\) would require its single edge to be red, but the only edge is blue. A blue \(K_3\) would require three vertices, while \(K_2\) has only two. Thus this colouring avoids both forbidden cliques and certifies \(R(2,3)>2\).
Check: The graph has \(\binom22=2\cdot1/2=1\) edge, and the blue edge set contains exactly that edge. The example illustrates why the search should test the specified clique sizes directly: when a target size exceeds \(n\), there is no vertex set of that size to test.
What a Certificate Does—and Does Not—Show
A certificate is independently checkable: list the vertices and the red and blue edges, then test every \(r\)-vertex set for an all-red edge set and every \(s\)-vertex set for an all-blue edge set. If all tests pass, the certificate proves \(R(r,s)>n\). The number of tests is finite, so this verification does not depend on trusting the search procedure that found the colouring.
For a small instance, search can also settle the opposite question. If it explores every branch and discards them all, the correctness theorem proves that no certificate exists on \(n\) vertices. Combined with a certificate on \(n-1\) vertices, this can identify an exact Ramsey value. The search itself does not make an incomplete run into a proof: stopping early without finding a colouring, or without exhausting the branches, gives no conclusion that all colourings fail.
In practice, an implementation can improve speed by choosing an edge order that tends to complete likely forbidden cliques early. It can also keep track of which vertex sets have become fully assigned. These choices may change how soon a branch is discarded, but not the correctness argument, provided the program still considers both colours for each unassigned edge unless it has a valid pruning reason.
Common Mistake: Pruning Before a Clique Is Complete
A frequent error is to discard a partial state merely because it has \(r-1\) red edges among the vertices of a possible \(K_r\), even though one or more of the clique’s edges remain unassigned. For example, on \(V=\{1,2,3\}\), suppose \(12\) and \(13\) are red while \(23\) is unassigned. It is incorrect to prune this state as a red triangle: if the remaining edge \(23\) is assigned blue, the triangle is not monochromatic red. The correct test waits until all three edges have been assigned and are red. Pruning is justified by a completed obstruction, not by a partial resemblance to one.
The distinction is central to exhaustive search. The method is efficient because it avoids exploring extensions of a completed forbidden clique, but it remains reliable only when every discarded branch is known to have no admissible extension. Safe pruning and a complete branching rule turn a finite computation into a proof.
Check Your Understanding
Use the definitions and search rule above to answer these questions.
- For a partial colouring of \(K_6\) when searching for a red \(K_3\) and a blue \(K_4\), what exact condition allows a branch to be pruned?
- Why does a complete admissible colouring of \(K_n\) prove \(R(r,s)>n\)?
- In the \(K_4\) search, why is the branch with \(12,13,14\) red not discarded before edge \(23\) is assigned?
- Explain why an exhaustive search that discards every branch proves \(R(r,s)\le n\), while a search stopped early with no certificate proves no such bound.
- Give the number of edges in \(K_5\), and explain how the two edge sets in the \(R(3,3)>5\) example verify that every edge has been coloured.