In combinatorics, Ramsey's theorem, in one of its graph-theoretic forms, states that one will find monochromatic cliques in any edge labelling (with colours) of a sufficiently large complete graph.
As the simplest example, consider two colours (say, blue and red). Let r and s be any two positive integers. Ramsey's theorem states that there exists a least positive integer R(r, s) for which every blue-red edge colouring of the complete graph on R(r, s) vertices contains a blue clique on r vertices or a red clique on s vertices. (Here R(r, s) signifies an integer that depends on both r and s.)
Ramsey's theorem is a foundational result in combinatorics. The first version of this result was proved by Frank Ramsey. This initiated the combinatorial theory now called Ramsey theory, that seeks regularity amid disorder: general conditions for the existence of substructures with regular properties. In this application it is a question of the existence of monochromatic subsets, that is, subsets of connected edges of just one colour.
An extension of this theorem applies to any finite number of colours, rather than just two. More precisely, the theorem states that for any given number of colours, c, and any given integers n1, …, nc, there is a number, R(n1, …, nc), such that if the edges of a complete graph of order R(n1, …, nc) are coloured with c different colours, then for some i between 1 and c, it must contain a complete subgraph of order ni whose edges are all colour i. The special case above has c = 2 (and n1 = r and n2 = s).
Contents
Examples
R(3, 3) = 6
Suppose the edges of a complete graph on 6 vertices are coloured red and blue. Pick a vertex, v. There are 5 edges incident to v and so (by the pigeonhole principle) at least 3 of them must be the same colour. Without loss of generality we can assume at least 3 of these edges, connecting the vertex, v, to vertices, r, s and t, are blue. (If not, exchange red and blue in what follows.) If any of the edges, (rs), (rt), (st), are also blue then we have an entirely blue triangle. If not, then those three edges are all red and we have an entirely red triangle. Since this argument works for any colouring, any K6 contains a monochromatic K3, and therefore R(3, 3) ≤ 6. The popular version of this is called the theorem on friends and strangers.
An alternative proof works by double counting. It goes as follows: Count the number of ordered triples of vertices, x, y, z, such that the edge, (xy), is red and the edge, (yz), is blue. Firstly, any given vertex will be the middle of either 0 × 5 = 0 (all edges from the vertex are the same colour), 1 × 4 = 4 (four are the same colour, one is the other colour), or 2 × 3 = 6 (three are the same colour, two are the other colour) such triples. Therefore, there are at most 6 × 6 = 36 such triples. Secondly, for any non-monochromatic triangle (xyz), there exist precisely two such triples. Therefore, there are at most 18 non-monochromatic triangles. Therefore, at least 2 of the 20 triangles in the K6 are monochromatic.
Conversely, it is possible to 2-colour a K5 without creating any monochromatic K3, showing that R(3, 3) > 5. The unique colouring is shown to the right. Thus R(3, 3) = 6.
The task of proving that R(3, 3) ≤ 6 was one of the problems of William Lowell Putnam Mathematical Competition in 1953, as well as in the Hungarian Math Olympiad in 1947.
A multicolour example: R(3, 3, 3) = 17
A multicolour Ramsey number is a Ramsey number using 3 or more colours. There are (up to symmetries) only two non-trivial multicolour Ramsey numbers for which the exact value is known, namely R(3, 3, 3) = 17 and R(3, 3, 4) = 30.
Suppose that we have an edge colouring of a complete graph using 3 colours, red, green and blue. Suppose further that the edge colouring has no monochromatic triangles. Select a vertex v. Consider the set of vertices that have a red edge to the vertex v. This is called the red neighbourhood of v. The red neighbourhood of v cannot contain any red edges, since otherwise there would be a red triangle consisting of the two endpoints of that red edge and the vertex v. Thus, the induced edge colouring on the red neighbourhood of v has edges coloured with only two colours, namely green and blue. Since R(3, 3) = 6, the red neighbourhood of v can contain at most 5 vertices. Similarly, the green and blue neighbourhoods of v can contain at most 5 vertices each. Since every vertex, except for v itself, is in one of the red, green or blue neighbourhoods of v, the entire complete graph can have at most 1 + 5 + 5 + 5 = 16 vertices. Thus, we have R(3, 3, 3) ≤ 17.
To see that R(3, 3, 3) = 17, it suffices to draw an edge colouring on the complete graph on 16 vertices with 3 colours that avoids monochromatic triangles. It turns out that there are exactly two such colourings on K16, the so-called untwisted and twisted colourings. Both colourings are shown in the figures to the right, with the untwisted colouring on the left, and the twisted colouring on the right.
If we select any colour of either the untwisted or twisted colouring on K16, and consider the graph whose edges are precisely those edges that have the specified colour, we will get the Clebsch graph.
It is known that there are exactly two edge colourings with 3 colours on K15 that avoid monochromatic triangles, which can be constructed by deleting any vertex from the untwisted and twisted colourings on K16, respectively.
It is also known that there are exactly 115 edge colourings with 3 colours on K14 that avoid monochromatic triangles, provided that we consider edge colourings that differ by a permutation of the colours as being the same.
Proof
2-colour case
The theorem for the 2-colour case can be proved by induction on r + s. It is clear from the definition that for all n, R(n, 2) = R(2, n) = n. This starts the induction. We prove that R(r, s) exists by finding an explicit bound for it. By the inductive hypothesis R(r − 1, s) and R(r, s − 1) exist.
Lemma 1.
R
(
r
,
s
)
≤
R
(
r
−
1
,
s
)
+
R
(
r
,
s
−
1
)
.
{\displaystyle R(r,s)\leq R(r-1,s)+R(r,s-1).}
Proof. Consider a complete graph on R(r − 1, s) + R(r, s − 1) vertices whose edges are coloured with two colours. Pick a vertex v from the graph, and partition the remaining vertices into two sets M and N, such that for every vertex w, w is in M if edge (vw) is blue, and w is in N if (vw) is red. Because the graph has
Case of more colours
Lemma 2. If c > 2, then
R
(
n
1
,
…
,
n
c
)
≤
R
(
n
1
,
…
,
n
c
−
2
,
R
(
n
c
−
1
,
n
c
)
)
.
{\displaystyle R(n_{1},\dots ,n_{c})\leq R(n_{1},\dots ,n_{c-2},R(n_{c-1},n_{c})).}
Ramsey numbers
The numbers R(r, s) in Ramsey's theorem (and their extensions to more than two colours) are known as Ramsey numbers. The Ramsey number R(m, n) gives the solution to the party problem, which asks the minimum number of guests, R(m, n), that must be invited so that at least m will know each other or at least n will not know each other. In the language of graph theory, the Ramsey number is the minimum number of vertices, v = R(m, n), such that all undirected simple graphs of order v, contain a clique of order m, or an independent set of order n. Ramsey's theorem states that such a number exists for all m and n.
By symmetry, it is true that R(m, n) = R(n, m). An upper bound for R(r, s) can be extracted from the proof of the theorem, and other arguments give lower bounds. (The first exponential lower bound was obtained by Paul Erdős using the probabilistic method.) However, there is a vast gap between the tightest lower bounds and the tightest upper bounds. There are also very few numbers r and s for which we know the exact value of R(r, s).
Computing a lower bound L for R(r, s) usually requires exhibiting a blue/red colouring of the graph KL−1 with no blue Kr subgraph and no red Ks subgraph. Such a counterexample is called a Ramsey graph. Brendan McKay maintains a list of known Ramsey graphs. Upper bounds are often considerably more difficult to establish: one either has to check all possible colourings to confirm the absence of a counterexample, or to present a mathematical argument for its absence.
Computational complexity
Erdős asks us to imagine an alien force, vastly more powerful than us, landing on Earth and demanding the value of R(5, 5) or they will destroy our planet. In that case, he claims, we should marshal all our computers and all our mathematicians and attempt to find the value. But suppose, instead, that they ask for R(6, 6). In that case, he believes, we should attempt to destroy the aliens.
A sophisticated computer program does not need to look at all colourings individually in order to eliminate all of them; nevertheless it is a very difficult computational task that existing software can only manage on small sizes. Each complete graph Kn has 1/2n(n − 1) edges, so there would be a total of cn(n − 1)/2 graphs to search through (for c colours) if brute force is used. Therefore, the complexity for searching all possible graphs (via brute force) is O(cn2) for c colourings and at most n nodes.
The situation is unlikely to improve with the advent of quantum computers. One of the best-known searching algorithms for unstructured datasets exhibits only a quadratic speedup (cf. Grover's algorithm) relative to classical computers, so that the computation time is still exponential in the number of nodes.
Known values
As described above, R(3, 3) = 6. It is easy to prove that R(4, 2) = 4, and, more generally, that R(2,s) = s for all s: a graph on s − 1 nodes with all edges coloured red serves as a counterexample and proves that R(2,s) ≥ s; among colourings of a graph on s nodes, the colouring with all edges coloured red contains a s-node red subgraph, and all other colourings contain a 2-node blue subgraph (that is, a pair of nodes connected with a blue edge.)
Using induction inequalities and the handshaking lemma, it can be concluded that R(4, 3) ≤ R(4, 2) + R(3, 3) − 1 = 9, and therefore R(4, 4) ≤ R(4, 3) + R(3, 4) ≤ 18. There are only two (4, 4, 16) graphs (that is, 2-colourings of a complete graph on 16 nodes without 4-node red or blue complete subgraphs) among 6.4 × 1022 different 2-colourings of 16-node graphs, and only one (4, 4, 17) graph (the Paley graph of order 17) among 2.46 × 1026 colourings. It follows that R(4, 4) = 18.
The fact that R(4, 5) = 25 was first established by Brendan McKay and Stanisław Radziszowski in 1995.
The exact value of R(5, 5) is unknown, although it is known to lie between 43 (Geoffrey Exoo (1989)) and 46 (Angeltveit and McKay (2024)), inclusive.
In 1997, McKay, Radziszowski and Exoo employed computer-assisted graph generation methods to conjecture that R(5, 5) = 43. They were able to construct exactly 656 (5, 5, 42) graphs, arriving at the same set of graphs through different routes. None of the 656 graphs can be extended to a (5, 5, 43) graph.
For R(r, s) with r, s > 5, only weak bounds are available. Lower bounds for R(6, 6) and R(8, 8) have not been improved since 1965 and 1972, respectively.
R(r, s) with r, s ≤ 10 are shown in the table below. Where the exact value is unknown, the table lists the best known bounds. R(r, s) with r < 3 are given by R(1, s) = 1 and R(2, s) = s for all values of s.
The standard survey on the development of Ramsey number research is the Dynamic Survey 1 of the Electronic Journal of Combinatorics, by Radziszowski, which is periodically updated. Where not cited otherwise, entries in the table below are taken from the June 2024 edition. (Note there is a trivial symmetry across the diagonal since R(r, s) = R(s, r).)
Asymptotics
The inequality R(r, s) ≤ R(r − 1, s) + R(r, s − 1) may be applied inductively to prove that
R
(
r
,
s
)
≤
(
r
+
s
−
2
r
−
1
)
.
{\displaystyle R(r,s)\leq {\binom {r+s-2}{r-1}}.}
In particular, this result, due to Erdős and Szekeres, implies that when r = s,
R
(
s
,
s
)
≤
(
1
+
o
(
1
Formal verification of Ramsey numbers
The Ramsey number
R
(
3
,
8
)
{\displaystyle R(3,8)}
and
R
(
3
,
9
)
{\displaystyle R(3,9)}
have been formally verified to be 28 and 36. This verification was achieved using a combination of Boolean satisfiability (SAT) solving and computer algebra systems (CAS). The proof was generated automatically using the SAT+CAS approach, marking the first certifiable proof of
R
(
3
,
8
)
=
28
{\displaystyle R(3,8)=28}
and
R
(
3
,
9
Induced Ramsey
There is a less well-known yet interesting analogue of Ramsey's theorem for induced subgraphs. Roughly speaking, instead of finding a monochromatic subgraph, we are now required to find a monochromatic induced subgraph. In this variant, it is no longer sufficient to restrict our focus to complete graphs, since the existence of a complete subgraph does not imply the existence of an induced subgraph. The qualitative statement of the theorem in the next section was first proven independently by Erdős, Hajnal and Pósa, Deuber and Rödl in the 1970s. Since then, there has been much research in obtaining good bounds for induced Ramsey numbers.
Statement
Let H be a graph on n vertices. Then, there exists a graph G such that any coloring of the edges of G using two colors contains a monochromatic induced copy of H (i.e. an induced subgraph of G such that it is isomorphic to H and its edges are monochromatic). The smallest possible number of vertices of G is the induced Ramsey number rind(H)
Sometimes, we also consider the asymmetric version of the problem. We define rind(X,Y) to be the smallest possible number of vertices of a graph G such that every coloring of the edges of G using only red or blue contains a red induced subgraph of X or blue induced subgraph of Y.
Considering X = Kr and Y = Ks is then nothing else then the normal Ramsey numbers i.e. rind(Kr,Ks) = R(r,s).
History and bounds
Similar to Ramsey's theorem, it is unclear a priori whether induced Ramsey numbers exist for every graph H. In the early 1970s, Erdős, Hajnal and Pósa, Deuber, and Rödl independently proved that this is the case. However, the original proofs gave terrible bounds (e.g. towers of twos) on the induced Ramsey numbers. It is interesting to ask if better bounds can be achieved. In 1974, Paul Erdős conjectured that there exists a constant c such that every graph H on k vertices satisfies rind(H) ≤ 2ck. If this conjecture is true, it would be optimal up to the constant c because the complete graph achieves a lower bound of this form (in fact, it's the same as Ramsey numbers). However, this conjecture is still open as of now.
In 1984, Erdős and Hajnal claimed that they proved the bound
r
ind
(
H
)
≤
2
2
k
1
+
o
(
1
)
.
{\displaystyle r_{\text{ind}}(H)\leq 2^{2^{k^{1+o(1)}}}.}
However, that was still far from the exponential bound conjectured by Erdős. It was not until 1998 when a major breakthrough was achieved by Kohayakawa, Prömel and Rödl, who proved the first almost-exponential bound of rind(H) ≤ 2ck(log k)2 for some constant c. Their approach was to consider a suitable random graph constructed on projective planes and show that it has the desired properties with nonzero probability. The idea of using random graphs on projective planes have also previously been used in studying Ramsey properties with respect to vertex colorings and the induced Ramsey problem on bounded degree graphs H.
Special cases
While the general bounds for the induced Ramsey numbers are exponential in the size of the graph, the behaviour is much different on special classes of graphs (in particular, sparse ones). Many of these classes have induced Ramsey numbers polynomial in the number of vertices.
If H is a cycle, path or star on k vertices, it is known that rind(H) is linear in k.
If H is a tree on k vertices, it is known that rind(H) = O(k2 log2k). It is also known that rind(H) is superlinear (i.e. rind(H) = ω(k)). Note that this is in contrast to the usual Ramsey numbers, where the Burr–Erdős conjecture (now proven) tells us that r(H) is linear (since trees are 1-degenerate).
For graphs H with number of vertices k and bounded degree Δ, it was conjectured that rind(H) ≤ cnd(Δ), for some constant d depending only on Δ. This result was first proven by Łuczak and Rödl in 1996, with d(Δ) growing as a tower of twos with height O(Δ2). More reasonable bounds for d(Δ) were obtained since then. In 2013, Conlon, Fox and Zhao showed using a counting lemma for sparse pseudorandom graphs that rind(H) ≤ cn2Δ+8, where the exponent is best possible up to constant factors.
For the asymetric case Erdős was able to show that
r
i
n
d
(
P
n
,
K
m
)
=
(
n
−
Generalizations
Similar to Ramsey numbers, we can generalize the notion of induced Ramsey numbers to hypergraphs and multicolor settings.
We can also generalize the induced Ramsey's theorem to a multicolor setting. For graphs H1, H2, …, Hr, define rind(H1, H2, …, Hr) to be the minimum number of vertices in a graph G such that, given any coloring of the edges of G into r colors, there exists an i such that 1 ≤ i ≤ r and such that G contains an induced subgraph isomorphic to Hi whose edges are all colored in the i-th color. Let rind(H;q) := rind(H, H, …, H) (q copies of H).
It is possible to derive a bound on rind(H;q) which is approximately a tower of two of height ~ log q by iteratively applying the bound on the two-color case. The current best known bound is due to Fox and Sudakov, which achieves rind(H;q) ≤ 2ck3, where k is the number of vertices of H and c is a constant depending only on q.
We can extend the definition of induced Ramsey numbers to d-uniform hypergraphs by simply changing the word graph in the statement to hypergraph. Furthermore, we can define the multicolor version of induced Ramsey numbers in the same way as the previous subsection.
Let H be a d-uniform hypergraph with k vertices. Define the tower function tr(x) by letting t1(x) = x and for i ≥ 1, ti+1(x) = 2ti(x). Using the hypergraph container method, Conlon, Dellamonica, La Fleur, Rödl and Schacht were able to show that for d ≥ 3, q ≥ 2, rind(H;q) ≤ td(ck) for some constant c depending on only d and q. In particular, this result mirrors the best known bound for the usual Ramsey number when d = 3.
Extensions of the theorem
Infinite graphs
A further result, also commonly called Ramsey's theorem, applies to infinite graphs. In a context where finite graphs are also being discussed it is often called the "Infinite Ramsey theorem". As intuition provided by the pictorial representation of a graph is diminished when moving from finite to infinite graphs, theorems in this area are usually phrased in set-theoretic terminology.
Theorem. Let
X
{\displaystyle X}
be some infinite set and colour the elements of
[
X
]
n
{\displaystyle [X]^{n}}
(the subsets of
X
{\displaystyle X}
of size
n
{\displaystyle n}
) in
c
{\displaystyle c}
different colours. Then there exists some infinite subset
M
{\displaystyle M}
of
X
{\displaystyle X}
such that the size
Hypergraphs
The theorem can also be extended to hypergraphs. An m-hypergraph is a graph whose "edges" are sets of m vertices – in a normal graph an edge is a set of 2 vertices. The full statement of Ramsey's theorem for hypergraphs is that for any integers m and c, and any integers n1, …, nc, there is an integer R(n1, …, nc; m) such that if the hyperedges of a complete m-hypergraph of order R(n1, …, nc; m) are coloured with c different colours, then for some i between 1 and c, the hypergraph must contain a complete sub-m-hypergraph of order ni whose hyperedges are all colour i. This theorem is usually proved by induction on m, the 'hyper-ness' of the graph. The base case for the proof is m = 2, which is exactly the theorem above.
For m = 3 we know the exact value of one non-trivial Ramsey number, namely R(4, 4; 3) = 13. This fact was established by Brendan McKay and Stanisław Radziszowski in 1991. Additionally, we have: R(4, 5; 3) ≥ 35, R(4, 6; 3) ≥ 63 and R(5, 5; 3) ≥ 88.
Directed graphs
It is also possible to define Ramsey numbers for directed graphs; these were introduced by P. Erdős and L. Moser (1964). Let R(n) be the smallest number Q such that any complete graph with singly directed arcs (also called a "tournament") and with ≥ Q nodes contains an acyclic (also called "transitive") n-node subtournament.
This is the directed-graph analogue of what (above) has been called R(n, n; 2), the smallest number Z such that any 2-colouring of the edges of a complete undirected graph with ≥ Z nodes, contains a monochromatic complete graph on n nodes. (The directed analogue of the two possible arc colours is the two directions of the arcs, the analogue of "monochromatic" is "all arc-arrows point the same way"; i.e., "acyclic.")
We have R(0) = 0, R(1) = 1, R(2) = 2, R(3) = 4, R(4) = 8, R(5) = 14, R(6) = 28, and 34 ≤ R(7) ≤ 47.
Uncountable cardinals
In terms of the partition calculus, Ramsey's theorem can be stated as
ℵ
0
→
(
ℵ
0
)
k
n
{\displaystyle \aleph _{0}\rightarrow (\aleph _{0})_{k}^{n}}
for all finite n and k. Wacław Sierpiński showed that the Ramsey theorem does not extend to graphs of size
ℵ
1
{\displaystyle \aleph _{1}}
by showing that
2
ℵ
0
↛
(
ℵ
1
)
2
2
{\displaystyle 2^{\aleph _{0}}\nrightarrow (\aleph _{1})_{2}^{2}}
. In particular, the continuum hypothesis implies that
ℵ
Reverse mathematics
In reverse mathematics, there is a significant difference in proof strength between the versions of Ramsey's theorem. Some are equally strong as one of the big five subsystems in reverse mathematics, but others are not. By a theorem of David Seetapun, the graph version of the theorem is weaker than ACA0, and (combining Seetapun's result with others) it does not fall into one of the big five subsystems.
Let
R
T
k
n
{\displaystyle RT_{k}^{n}}
denote Ramsey's theorem for when we k-color the n-sized subsets of the natural numbers
N
{\displaystyle \mathbb {N} }
, and let
R
T
<
∞
n
:=
∀
k
,
R
T
k
n
{\displaystyle RT_{<\infty }^{n}:=\forall k,RT_{k}^{n}}
denote Ramsey's theorem for any finite k with a single fixed n.




