Turning a Problem into a Graph
Section titled “Turning a Problem into a Graph”A graph consists of vertices and edges joining pairs of vertices. Vertices might represent people, cities, or objects; edges record a relation such as friendship or a direct connection.
Unless stated otherwise, use a finite simple undirected graph: no loops, no repeated edges, and no directions. Results about such graphs may change when those assumptions change.
A complete graph connects every pair of distinct vertices, so it has edges. A graph is connected if every pair of vertices can be joined by a path.
Example. Eight teams each play every other team once. How many games are played?
Represent teams by vertices and games by edges. A game is an unordered pair of teams, so the graph is and has edges. Counting eight opponents per team would incorrectly include self-play; counting seven per team would count each game twice.
Degrees and the Handshake Lemma
Section titled “Degrees and the Handshake Lemma”The degree is the number of edges incident to vertex . Summing degrees counts each edge twice, once at each endpoint:
where is the number of edges. In particular, the number of odd-degree vertices is even, since an odd number of odd summands would make the sum odd.
Example. Can a group of seven people each have shaken hands with exactly three others in the group?
The proposed degree sum is . But every handshake contributes two to that sum, so it must be even. Such a configuration is impossible.
Another useful consequence is that some degree is at least the average and some is at most it. This provides a starting vertex for many extremal arguments.
Paths, Cycles, and Trees
Section titled “Paths, Cycles, and Trees”A path is a sequence of distinct vertices joined by edges. A cycle returns to its starting vertex, with at least three vertices and no other repeated vertices. A tree is a connected graph with no cycles.
A tree on vertices has edges. One proof repeatedly removes a leaf, a vertex of degree one. A longest path in a tree with at least two vertices has leaf endpoints: any extra neighbor would extend the path or create a cycle. Removing a leaf preserves the tree property and removes one vertex and one edge.
Example. A tree has three vertices of degree three, some leaves, and no other vertices. Find the number of leaves.
Let there be leaves. The tree has vertices and edges. The degree sum gives
so .
A connected graph with a cycle is not a tree, but it contains a spanning tree: repeatedly remove an edge from a cycle without disconnecting the graph. Thus any connected graph has at least edges.
Bipartite Graphs and Coloring
Section titled “Bipartite Graphs and Coloring”A graph is bipartite if its vertices can be split into two groups so every edge runs between the groups. Equivalently, its vertices can be colored with two colors so adjacent vertices have different colors.
A bipartite graph contains no odd cycle because colors must alternate around a cycle. Conversely, a graph with no odd cycle is bipartite: in each component, color vertices according to the parity of their distance from a chosen starting vertex. An edge joining equal parities would produce an odd cycle.
Example. Vertices represent squares of a chessboard, with an edge for each legal knight move. Prove the graph has no odd cycle.
A knight moves two squares in one coordinate and one in the other, changing the parity of the coordinate sum. It therefore switches checkerboard color on every move. The graph is bipartite, so every cycle has even length.
If the two parts have sizes and , there can be at most edges. For example, a bipartite graph with ten vertices has at most edges because .
Extremal Arguments
Section titled “Extremal Arguments”Choosing a vertex of maximum degree or an endpoint of a longest path can force information about its neighbors. Sometimes a local case split gives a global existence result.
Example. Among any six people, prove there are three mutual acquaintances or three mutual strangers, assuming acquaintance is symmetric.
Fix a person . Of the other five people, at least three are all acquaintances of or all strangers to .
Suppose are acquaintances of . If any two of them are acquainted, those two and form three mutual acquaintances. If no two are acquainted, are three mutual strangers.
If instead are strangers to , reverse the roles of acquaintances and strangers in the argument. One of the required triples always exists.
Trails, Euler Tours, and Parity
Section titled “Trails, Euler Tours, and Parity”A path has no repeated vertices. A trail has no repeated edges but may revisit vertices. An Euler trail uses every edge exactly once; if it returns to its starting vertex, it is an Euler circuit.
At every vertex other than a trail’s endpoints, arriving along an unused edge must be paired with leaving along another unused edge. Thus an Euler circuit requires all degrees even, and an open Euler trail requires exactly two odd-degree vertices.
These conditions are also sufficient when all vertices incident to edges belong to one connected component. To construct a circuit in an even-degree graph, follow unused edges until returning to the starting point. If unused edges remain, connectivity supplies a vertex on the current circuit from which another unused circuit can be formed. Splice it into the first circuit and repeat. For two odd vertices, temporarily join them by one extra edge, construct a circuit, and remove the extra edge to obtain an open trail.
Example. Can a drawing of the complete graph on five vertices be traced using every edge once without lifting the pen or retracing an edge?
Every vertex has degree four, and the graph is connected. Therefore an Euler circuit exists. The fact that five vertices cannot be drawn in the plane without crossings does not prevent such a tracing; a crossing is not an additional vertex unless the problem defines it that way.
Do not confuse an Euler problem with a Hamiltonian one. A Hamiltonian cycle visits every vertex once rather than every edge once. Degree parity characterizes Euler trails, but it does not supply a corresponding simple test for Hamiltonian cycles.
Matchings and Hall’s Theorem
Section titled “Matchings and Hall’s Theorem”A matching is a collection of edges sharing no endpoints. In a bipartite graph, it can represent assigning distinct jobs to people when an edge means an assignment is allowed.
For a set of people, write for all jobs adjacent to at least one member of . A matching covering every person requires for every subset : those people collectively need at least that many available jobs.
Hall’s marriage theorem states that this necessary condition is sufficient. The condition must hold for every subset, not merely for each person separately or for the entire group.
Example. Four students need four distinct tasks. A, B, and C can each do only tasks one and two, while D can do tasks three and four. Explain why no complete assignment exists even though every student has two choices.
For , the neighborhood is only . Thus . Hall’s necessary condition fails, so a complete assignment is impossible.
Counting the total number of allowed edges would not detect this bottleneck. The shortage is concentrated in one subset.
For the sufficiency idea, start with a maximum matching. If some person remains unmatched, explore paths that alternate between edges outside the matching and edges in the matching, starting there. Reaching an unmatched job would allow the path’s matched and unmatched edges to be swapped, increasing the matching, which is impossible.
Let be the reached people and the reached jobs. Every reached job is matched to a reached person, while the initial person is unmatched. The exploration therefore gives , contradicting Hall’s condition. This is the augmenting-path proof.
Triangle-Free Graphs and Mantel’s Theorem
Section titled “Triangle-Free Graphs and Mantel’s Theorem”A graph may have many edges without containing a triangle: complete bipartite graphs provide examples. The balanced example has approximately edges, and this is the largest possible number.
Mantel’s theorem states that a simple triangle-free graph on vertices has at most edges.
Proof (Mantel’s edge bound). For an edge , the neighborhoods of and are disjoint, since a common neighbor would form a triangle. Hence .
Sum over every edge. Vertex contributes its degree once for each incident edge, giving
Cauchy–Schwarz and the handshake lemma give
If , combine and divide to obtain . If , the bound is immediate. Since is an integer, take the floor.
Example. Prove that a graph with ten vertices and twenty-six edges contains a triangle, and show twenty-five edges do not suffice.
A triangle-free graph has at most edges by Mantel. The complete bipartite graph with five vertices in each part has twenty-five edges and no triangle, showing sharpness.
This proof combines a local structural fact with a global sum. The same pattern appears often: obtain an inequality at each edge or vertex, sum it, then use an average or a standard algebraic inequality.
Ramsey Arguments and Sharp Constructions
Section titled “Ramsey Arguments and Sharp Constructions”The six-person acquaintance argument proves that every red/blue coloring of the edges of contains a monochromatic triangle. To establish that six is the smallest guarantee, a five-vertex coloring avoiding both kinds is needed.
Arrange five vertices on a pentagon. Color its five boundary edges red and its five diagonals blue. The red graph is a five-cycle, so it has no triangle. The blue graph is also a five-cycle, so it has no triangle either.
This supplies the missing construction and proves the exact Ramsey value . In an extremal problem, a clean construction often deserves as much attention as the upper-bound argument, since it explains why the bound cannot improve.
For larger monochromatic configurations, fixing one vertex and splitting its neighbors by edge color can produce recursive bounds. Keep track of how many neighbors are required in each color; an informal “at least half” is not always enough when the target sizes differ.
Planar Graphs and Face Counting
Section titled “Planar Graphs and Face Counting”A graph is planar if it has a drawing in the plane where edges meet only at common endpoints. For a connected planar drawing, Euler’s formula is
where includes the unbounded outer face. Counting sides around faces counts each edge twice, including a bridge once on each side.
For a simple connected planar graph with , every face boundary has at least three edge occurrences, so . Combining with Euler gives . If the graph is bipartite, there are no odd cycles; the corresponding face count gives .
Example. Prove that and are not planar.
The graph has five vertices and ten edges. A simple planar graph with five vertices has at most edges, a contradiction.
The graph has six vertices and nine edges. Because it is bipartite, a planar drawing would require at most edges, again a contradiction.
The ordinary edge bound alone would not rule out , since nine is at most twelve. The bipartite structure supplies the stronger inequality needed for the problem.
Counting Walks by States
Section titled “Counting Walks by States”A walk may repeat both vertices and edges. Counting walks is naturally recursive: the number reaching a vertex after steps is the sum of the counts reaching its neighbors after steps.
Example. Starting at a specified vertex of a triangle graph, how many walks of length six return to the starting vertex?
Let count walks ending at the starting vertex, and let count walks ending at one particular other vertex. Symmetry makes the counts at the two other vertices equal. Then
These give , either by solving the recurrence or by checking it with the initial values. Therefore .
For a larger graph, put the state counts in a vector and multiply by its adjacency matrix. The entry in row , column of the th matrix power counts length- walks from one specified endpoint to the other under the chosen row/column convention. This connects graph counting with the recurrence and matrix methods used elsewhere in competition math.