Combinatorics and discrete mathematics
Graphs, degree, and paths
Graphs as networks of vertices and edges: degree, walks and Eulerian circuits, bipartite matching, colouring, and planarity — from the Seven Bridges of Königsberg to open questions in Ramsey theory.
IntuitionWhat is a graph?
A graph is just points (vertices) joined by lines (edges): a map of who is connected to whom. A friendship network, a road map, a molecule's bonds, pages of the web linked to each other — all of these are graphs. What matters is not where the points sit on the page, but which pairs are joined.
SchoolVertices, edges, and degree
Definition: Graph, degree
A graph consists of a set of vertices and a set of edges , each edge joining two vertices. The degree of a vertex is the number of edges touching it.
In any finite graph, the sum of all vertex degrees equals twice the number of edges: . In particular, the number of vertices of odd degree is always even.
Why is it true?
Each edge is counted exactly twice when we sum degrees: once from each of its two endpoints. So the sum is even, and since the even-degree vertices already contribute an even amount to the total, the odd-degree vertices must appear an even number of times.
Proof
Take any finite graph . Build the set of all vertex-edge incidence pairs where vertex is an endpoint of edge , and count this set two different ways. Counting by vertex: each vertex contributes exactly incidence pairs (one for every edge touching it), so the total count is . Counting by edge: every edge has exactly endpoints, and , so it contributes exactly incidence pairs, and summing over all edges gives .
Since both counts tally the same set of pairs, they must agree: . For the second claim, split the sum into vertices of even and odd degree: is a sum of even numbers, hence even, so must also be even (their total is even). A sum of odd numbers is even only when there is an even number of terms, so the number of odd-degree vertices is even.
Example: Counting degrees in
In the complete graph (four vertices, every pair joined), what is , and how many edges does have?
Solution
Each of the 4 vertices is joined to the other 3, so every degree is 3 and . By the handshaking lemma, .
Example: Snowplow and courier route planning (the Chinese Postman Problem)
A municipal snowplow must clear every street in a connected district of intersections whose street-degrees are , starting and ending at the depot. (1) How many street segments does the district have, and can the snowplow clear every street segment exactly once without deadheading (re-traversing an already cleared street)? (2) If a new road is built between two intersections and that previously had degree , changing their degrees to , is a closed route without deadheading still possible?
Solution
(1) By the handshaking lemma, , so the district has street segments. Because the graph is connected and all six intersections have even degree ( odd-degree vertices), Euler's circuit theorem guarantees an Eulerian circuit: the snowplow can clear every street segment exactly once and return to the depot with zero wasted mileage.
(2) Adding the edge between and raises their degrees from to , creating vertices of odd degree. By Euler's theorem, a closed Eulerian circuit no longer exists — only an open Eulerian trail starting at and ending at . To return to the depot, the snowplow must re-traverse a shortest path between and (effectively duplicating those edges so every degree becomes even again). In operations research, minimising total deadhead distance by pairing odd-degree vertices via a minimum-weight perfect matching is the Chinese Postman Problem (Mei-Ko Kwan, 1962), used daily in garbage collection, street sweeping, and power-line inspection.
UndergraduateWalks, trails, and Eulerian circuits
Definition: Eulerian circuit
A walk is a sequence of vertices where consecutive ones are joined by an edge. A trail is a walk that never repeats an edge. An Eulerian circuit is a closed trail (starts and ends at the same vertex) that uses every edge of the graph exactly once.
A connected graph with at least one edge has an Eulerian circuit if and only if every vertex has even degree. More generally, it has an open Eulerian trail between two distinct vertices if and only if and are exactly the two vertices of odd degree.
Why is it true?
Follow any trail; each time you pass through a vertex (other than the start/end) you use up two of its edges, so a vertex where you could get stuck (other than the two endpoints) must have even degree — this is the easy direction. The converse (even degree is enough) follows by an inductive argument: peel off closed trails and splice them together (Hierholzer's construction, 1873).
Proof
(Necessity.) Suppose a connected graph has an Eulerian circuit , a closed trail using every edge exactly once. Every time passes through a vertex other than the start/end vertex, it enters along one edge and leaves along a different, previously unused edge, consuming exactly of 's incident edges; since uses every edge of exactly once by the time it finishes, must be even for every vertex, including the start/end vertex where the first departing edge pairs with the final arriving edge.
(Sufficiency.) Suppose instead every vertex of the connected graph has even degree. Start at any vertex and greedily walk along unused edges; because every vertex has even degree, whenever the walk enters a vertex other than the start it can always leave again (an even number of incident edges can never be reduced to exactly unused edge), so the walk cannot get stuck except back at the starting vertex, producing a closed trail . If already uses every edge, we are done. Otherwise, since is connected, some vertex on has an unused incident edge; the unused edges also all have even degree at every vertex (removing the even-degree closed trail preserves parity), so by the same argument they form another closed trail through . Splicing into at produces a longer closed trail; repeating this splicing process (Hierholzer's construction, 1873) until no unused edges remain yields an Eulerian circuit.
This is exactly Euler's original argument, and the puzzle itself is now catalogued in the library as the great problem Seven Bridges of Königsberg.
AdvancedBipartite graphs and Hall's marriage theorem
Definition: Bipartite graph
A graph is bipartite if its vertices split into two sets with every edge joining a vertex of to a vertex of (no edge inside or inside ). Bipartite graphs model matching problems: jobs to workers, students to schools.
Let be a bipartite graph with parts and . There is a matching that covers every vertex of if and only if for every subset , the neighbourhood satisfies (Hall's condition).
Why is it true?
If some has , the vertices of have nowhere near enough neighbours to be matched injectively, so the condition is clearly necessary. That it is also sufficient is proved by finding an augmenting path whenever a matching is not yet complete (the König–Egerváry augmenting-path argument).
Proof
(Necessity.) If some had , then the vertices of have fewer than possible partners among all of combined, so no matching can inject into injectively — hence no matching covering all of can exist. So Hall's condition is clearly necessary.
(Sufficiency.) Suppose Hall's condition holds but some matching leaves a vertex unmatched. Build an alternating tree from : follow non-matching edges out of -vertices and matching edges back from -vertices, exploring all vertices reachable this way. If this tree ever reaches a -vertex not covered by , the path from to alternates non-matching/matching edges and has odd length, so swapping matched and unmatched edges along it (taking the symmetric difference ) strictly increases the matching size by one, contradicting that was already as large as possible along this branch — repeat until no unmatched remains, or Hall's condition is violated on the set of -vertices reached, since then every -vertex reached is matched back into , forcing . Since Hall's condition holds by assumption, this contradiction cannot occur, so every vertex of must eventually be matched — this is the König–Egerváry augmenting-path argument.
Colouring a whole map rather than an abstract graph leads to the most famous colouring question of all, the great problem Four colour theorem: every planar map can be coloured with four colours so that neighbouring regions differ. Deciding which graphs are planar in the first place is answered exactly by Kuratowski's theorem, below.
Definition: Planar graph
A graph is planar if it can be drawn in the plane with no two edges crossing (except at shared endpoints).
A finite graph is planar if and only if it contains no subgraph that is a subdivision of or of .
Why is it true?
and are themselves non-planar (checked directly with Euler's formula ), and any subdivision (replacing edges by paths) preserves non-planarity. Kuratowski's 1930 theorem is the surprising converse: these two graphs are the only obstructions.
Proof
(Necessity: , , and their subdivisions are non-planar.) In any connected simple planar graph with drawn without crossings, every face is bounded by at least edges and each edge borders at most faces, so counting edge-face incidences gives . Substituting from Euler's formula yields , i.e. . For we have and , violating , so is non-planar. For the bipartite graph , there are no odd cycles (hence no triangles), so every face requires at least edges: , which combines with to give . Since has and , violating , is also non-planar.
Subdividing an edge (replacing it by a path through new vertices of degree ) does not affect whether a graph can be drawn in the plane without crossings, so any graph containing a subdivision of or is non-planar. For the converse (sufficiency), proved by Kuratowski in 1930, one proceeds by induction on : a minimal non-planar graph must be -connected, and deleting an edge produces a planar graph whose cycle around the endpoints of has alternating chords on both the inside and the outside, which forces a subdivision of either or inside .
By the handshaking lemma, a graph with 5 edges has vertex degrees summing to
Among , , , and the Petersen graph, which one has an Eulerian circuit?
In a bipartite graph with parts , two vertices have only one common neighbour, i.e. . What does Hall's theorem tell us?
Which pair of graphs are exactly the forbidden subdivisions in Kuratowski's theorem?
References
- Vigleik Angeltveit, Brendan D. McKay (2024). R(5,5) ≤ 46 · arXiv:2409.15709 [preprint, not peer-reviewed]
- Marcelo Campos, Simon Griffiths, Robert Morris, Julian Sahasrabudhe (2023). Towards fully exponential bounds for the diagonal Ramsey numbers · arXiv:2303.09521 [preprint, not peer-reviewed]
- Reinhard Diestel (2017). Graph Theory
- Leonhard Euler (1736). Solutio problematis ad geometriam situs pertinentis