Image: Post of Azerbaijan, public domainPreparing for the graph theory problems of the IMO and the IOI
The International Mathematical Olympiad gives six problems over two days, three per day in four and a half hours, and every problem is a proof. One of the four areas is combinatorics, and in most years at least one of its problems is a graph in disguise: people and acquaintances, cities and roads, a tournament, a set of points and segments. The International Olympiad in Informatics gives six tasks over two days, three per day in five hours, each a program judged on hidden tests, and graph algorithms appear in nearly every year: shortest paths, spanning trees, trees as data structures, flows, matchings. Both competitions assume theory that is rarely taught in school. This post says what that theory is, where the Graph Theory Masterclass covers it, and what the masterclass does not do.
What the IMO assumes
The combinatorics of the IMO uses a small toolkit that must be second nature. Degrees and the handshake lemma, double counting, the pigeonhole principle, and the extremal principle, which means looking at a longest path or a largest set, are Unit 1. Paths, connectivity, bipartite graphs and their characterization by odd cycles, and distances are Unit 2. Trees, the fact that a tree on n vertices has n minus 1 edges, and induction on a leaf are Unit 4. Matchings and Hall's theorem are Unit 5, planarity and Euler's formula are Unit 6, colouring is Unit 7, Turán's theorem on how many edges force a triangle is Unit 10, and Ramsey's theorem with the small Ramsey numbers is Unit 13. The colourings of the integers in Unit 15, Schur and van der Waerden, appear now and then.
Knowing a theorem is not the skill. The skill is recognizing that a problem about 2019 users of a social network is a problem about degrees and components, and that is learned by solving problems and reading solutions until the translation is automatic. The masterclass teaches the theorems with proofs, which matters because an olympiad solution often reuses the proof idea rather than the statement.
What the IOI assumes
The informatics olympiad needs the same theory and, on top of it, the algorithms and the data structures to run them fast. Breadth-first search and Dijkstra's algorithm with a priority queue are Unit 2. Kruskal's and Prim's algorithms, with the union-find structure that Kruskal's needs, are Unit 4. Bipartite matching by augmenting paths is Unit 5. Maximum flow, the Edmonds and Karp rule, and minimum cuts are Unit 9. The masterclass proves why each algorithm is correct and how many steps it takes, which is what the task statements assume when they say that n is up to 200,000; the implementation in C++ or Python, the choice of a heap, and the handling of edge cases must come from a programming resource and from practice. Units 12, 14, and 16 lie outside both syllabi and show where the subject goes after the competitions.
Three problems, no solutions
Problem 4 of the IMO of 1964 asked: seventeen people correspond by mail, each pair on exactly one of three topics; prove that some three of them write to each other about the same topic. It is the statement R(3,3,3) at most 17 of Unit 13, and the colouring of 16 points that avoids it shows the number cannot be lowered.
Problem 3 of the IMO of 1992 asked: nine points in space, no four coplanar, every pair joined by a segment, each segment coloured blue or red or left uncoloured; find the smallest n such that whenever exactly n segments are coloured, some triangle has all three sides the same colour. The answer combines Turán's theorem on the number of edges that forces a triangle, Unit 10, with R(3,3) = 6, Unit 13.
Problem 3 of the IMO of 2019 asked: a social network has 2019 users, 1010 of them with 1009 friends and 1009 with 1010 friends; an operation on three users A, B, C with A friends with B and C but B and C not friends makes B and C friends and removes A's two friendships; prove that some sequence of operations leaves every user with at most one friend. The tools are degrees, components, and trees, Units 1, 2, and 4. All three statements are on the official IMO site with the full problem sheets.
For the IOI, two tasks: Crocodile, from IOI 2011 in Pattaya, is a variant of Dijkstra's algorithm in which the second-best path from each vertex is what matters, Unit 2; and Dreaming, from IOI 2013 in Brisbane, asks how to join the trees of a forest with new edges so that the longest shortest path is as short as possible, which is the diameter of a tree and its centre, Unit 4. The task statements and the test data are on the IOI site.
Where the problems are
The IMO site has every problem since 1959 and the official solutions for recent years. The Art of Problem Solving contest collection has the problems of nearly every national and regional olympiad with discussion threads, and the national olympiad of the reader's own country, with its shortlist, is the first place to look. For the IOI, the site has every task with its data, and online judges such as Codeforces host past IOI and national tasks with automatic judging, which is the only honest way to practise, because a program that is right in the head and wrong on test 17 scores zero. Two books that have trained generations: Lovász's Combinatorial Problems and Exercises, which has hints and full solutions, and Engel's Problem-Solving Strategies, whose chapter on graphs is a complete introduction on its own.
A training rhythm
One unit of the masterclass per week is the designed pace, and for olympiad preparation it should be paired with problems from the same area in the same week: after Unit 5, Hall's theorem problems; after Unit 13, Ramsey problems. Write every solution out in full, as it would be handed in, and have it read by someone who will mark it strictly; most lost points at the IMO are for proofs with a gap the writer did not see. For the IOI, implement each algorithm of the week from memory, submit it to a judge, and time it. Timed practice on full papers, three problems in four and a half hours or three tasks in five, belongs to the last two months before the competition, not the first.
The masterclass does not teach problem-solving speed, contest tactics, or programming. It teaches the theory the problems assume, with proofs, and it is honest about that boundary. The olympiad preparation page has the table from syllabus area to unit and the three problems above in full. Teachers who run a club will find a note on using the Foundation masterclass as the theory track on the page for schools.
A student who can prove that a graph with minimum degree at least 2 contains a cycle, find an augmenting path in a bipartite graph, and explain why six people always contain three mutual acquaintances or three mutual strangers has the graph theory of the IMO. Everything after that is practice.


