A list such as [3,3,2,2,2] might be the vertex degrees of a simple undirected graph—but a list such as [4,4,1,1] cannot be realised without loops or repeated edges. The handshake lemma gives a necessary even-sum check, yet it is not sufficient. Havel–Hakimi supplies a constructive reduction: remove the largest degree d, subtract one from the next d largest degrees, resort and repeat. Mathematics matters because an exchange argument proves that this greedy-looking step preserves graphicality, turning a global existence question into a sequence of smaller verifiable questions.
The practical search question is not simply “what is this named method?” but “which mathematical structure makes the method work, what does it guarantee, and what evidence would show that it is a poor choice?” This article keeps those questions together so students can connect mathematics education with computing, engineering, data reasoning and careful everyday decisions without turning one technique into a career promise.
Quick navigation: Why it matters · Mechanism · Worked example · Deeper ideas · Investigations · Limits · Learning route · Parent guidance · FAQs · Sources
Why this mathematics matters
Mathematics is important here because it turns an apparently visual or computational trick into a chain of reasons. The representation tells us what information is kept. The equation or invariant explains each legal step. The complexity analysis describes the work. The boundary conditions say when a conclusion should not be trusted. That combination is a practical form of problem-solving literacy.
A strong learner should be able to move in both directions: from a real task to a mathematical model, and from a formal guarantee back to its real meaning. Naming an algorithm is not enough. The useful achievement is to explain why the next operation is valid, check a small instance independently, and notice which assumptions the implementation has added.
Source: S. L. Hakimi’s 1962 SIAM paper on graph realisability.
Primary or implementation reference: EuDML record for Václav Havel’s 1955 graph-existence paper.
How the mechanism works
Sort the nonnegative degrees in descending order. Remove the first value d. If d exceeds the number of remaining entries, reject. Subtract one from the next d entries; if any becomes negative, reject. Resort and repeat until all values are zero, which certifies a graphical sequence, or a rejection condition appears. To construct a graph, retain vertex labels: connect the removed vertex to the d currently highest-degree remaining vertices and update their residual degrees. The theorem is for finite simple undirected graphs unless a different graph model is explicitly stated.
The handshake lemma says sum d_i=2|E|, so the total must be even and each degree is at most n−1. Havel–Hakimi strengthens these checks. If a realisation exists for a nonincreasing sequence, an exchange argument can rewire edges so a maximum-degree vertex is adjacent to the next d highest-degree vertices without changing any degree. Removing that vertex leaves precisely the reduced sequence. Therefore the original sequence is graphical if and only if the reduction is graphical. Repeated sorting gives a straightforward polynomial algorithm; heaps, buckets or Erdős–Gallai tests offer other performance choices.
Keep a four-column notebook labelled object, rule, guarantee and caveat. In the first column name the inputs and stored state. In the second write one update precisely. In the third state what remains true after the update. In the fourth record a tie, approximation, domain restriction or hardware assumption. This routine prevents symbols from drifting away from their meaning.
Worked example and core calculations
Start with labelled residual degrees A3,B3,C2,D2,E2. Remove A and connect it to B,C,D. The remaining residual degrees are B2,E2,C1,D1 after sorting. Remove B and connect it to E and C, leaving E1,D1,C0. Remove E and connect it to D, leaving all zeros. The edges are AB, AC, AD, BE, BC and ED. Their degrees are A3, B3, C2, D2 and E2, exactly the requested multiset. The sum is 12=2×6, matching six edges, but the successful reduction—not evenness alone—certifies simple-graph realisability.
How to audit the calculation
- Recompute every intermediate value directly from the definition.
- Keep labels, indices, signs, units and normalisation visible.
- Test a case with a known exact answer.
- State tie rules, random seeds, tolerances and boundary conventions.
- Compare with a slower transparent baseline or trusted implementation.
- Separate agreement of numbers from suitability of the real-world model.
Small examples are not childish; they are diagnostic instruments. A five-line trace can reveal a reversed inequality, a missing scale factor or an inconsistent label convention before a large dataset hides the same error behind plausible output.
Four deeper ideas
The reduction is backed by edge exchanges
If a maximum-degree vertex has the wrong neighbours, alternating edge swaps can move its adjacency toward the highest residual degrees.
To transfer this idea, ask what would remain true if labels, scale or input order changed. Then identify the step whose justification would fail if the stated assumption were removed. This turns the paragraph into a reusable reasoning pattern rather than a fact to memorise.
Did you know? A successful test can build a witness
Keeping labels and chosen neighbours produces an explicit graph, not just yes or no.
To transfer this idea, ask what would remain true if labels, scale or input order changed. Then identify the step whose justification would fail if the stated assumption were removed. This turns the paragraph into a reusable reasoning pattern rather than a fact to memorise.
The handshake lemma is necessary but incomplete
Even total degree cannot prevent one vertex from demanding more distinct neighbours than the others can provide.
To transfer this idea, ask what would remain true if labels, scale or input order changed. Then identify the step whose justification would fail if the stated assumption were removed. This turns the paragraph into a reusable reasoning pattern rather than a fact to memorise.
Graph model changes the answer
Loops, parallel edges, directed arcs and bipartite partitions obey different realisation rules.
To transfer this idea, ask what would remain true if labels, scale or input order changed. Then identify the step whose justification would fail if the stated assumption were removed. This turns the paragraph into a reusable reasoning pattern rather than a fact to memorise.
Twelve practical investigations
1. Five-vertex witness
Repeat [3,3,2,2,2]. Retain labels and edges.
What the mathematics reveals: The reduction constructs a valid graph. Evidence to collect: write the input, predict the next state, carry out the calculation, and compare the result with an independently produced reference. Explain the exact invariant, equation, inequality or counting rule that supports the conclusion. Then vary one assumption and record whether the result changes smoothly, discontinuously or not at all.
Limit to keep visible: Check the final degree count. A useful report places this boundary beside the result rather than hiding it in a final disclaimer.
2. Odd sum
Use [2,2,1]. Apply the handshake test.
What the mathematics reveals: Odd total cannot equal twice an edge count. Evidence to collect: write the input, predict the next state, carry out the calculation, and compare the result with an independently produced reference. Explain the exact invariant, equation, inequality or counting rule that supports the conclusion. Then vary one assumption and record whether the result changes smoothly, discontinuously or not at all.
Limit to keep visible: Reject before reductions. A useful report places this boundary beside the result rather than hiding it in a final disclaimer.
3. Degree too large
Use [4,1,1,0]. Compare 4 with n−1=3.
What the mathematics reveals: A simple vertex lacks enough distinct neighbours. Evidence to collect: write the input, predict the next state, carry out the calculation, and compare the result with an independently produced reference. Explain the exact invariant, equation, inequality or counting rule that supports the conclusion. Then vary one assumption and record whether the result changes smoothly, discontinuously or not at all.
Limit to keep visible: Loops are excluded. A useful report places this boundary beside the result rather than hiding it in a final disclaimer.
4. Negative residual
Reduce [3,1,1,1]. Observe the later state.
What the mathematics reveals: Local capacity can fail after a plausible start. Evidence to collect: write the input, predict the next state, carry out the calculation, and compare the result with an independently produced reference. Explain the exact invariant, equation, inequality or counting rule that supports the conclusion. Then vary one assumption and record whether the result changes smoothly, discontinuously or not at all.
Limit to keep visible: Stop as soon as a value is negative. A useful report places this boundary beside the result rather than hiding it in a final disclaimer.
5. All zeros
Use [0,0,0]. Return an edgeless graph.
What the mathematics reveals: Zero sequence is graphical. Evidence to collect: write the input, predict the next state, carry out the calculation, and compare the result with an independently produced reference. Explain the exact invariant, equation, inequality or counting rule that supports the conclusion. Then vary one assumption and record whether the result changes smoothly, discontinuously or not at all.
Limit to keep visible: Connectedness fails for n>1. A useful report places this boundary beside the result rather than hiding it in a final disclaimer.
6. Complete graph
Use [n−1,…,n−1]. Trace reductions.
What the mathematics reveals: Every pair must be an edge. Evidence to collect: write the input, predict the next state, carry out the calculation, and compare the result with an independently produced reference. Explain the exact invariant, equation, inequality or counting rule that supports the conclusion. Then vary one assumption and record whether the result changes smoothly, discontinuously or not at all.
Limit to keep visible: Watch quadratic output size. A useful report places this boundary beside the result rather than hiding it in a final disclaimer.
7. Star sequence
Use [n−1,1,…,1]. Construct the hub.
What the mathematics reveals: One high degree can be supported exactly. Evidence to collect: write the input, predict the next state, carry out the calculation, and compare the result with an independently produced reference. Explain the exact invariant, equation, inequality or counting rule that supports the conclusion. Then vary one assumption and record whether the result changes smoothly, discontinuously or not at all.
Limit to keep visible: Label choice changes the named hub. A useful report places this boundary beside the result rather than hiding it in a final disclaimer.
8. Nonunique sequence
Use [2,2,2,2]. Build a four-cycle and compare alternatives.
What the mathematics reveals: Degree data need not fix topology. Evidence to collect: write the input, predict the next state, carry out the calculation, and compare the result with an independently produced reference. Explain the exact invariant, equation, inequality or counting rule that supports the conclusion. Then vary one assumption and record whether the result changes smoothly, discontinuously or not at all.
Limit to keep visible: Do not claim reconstruction. A useful report places this boundary beside the result rather than hiding it in a final disclaimer.
9. Connectivity request
Test a graphical sequence with isolated vertices. Assess a separate condition.
What the mathematics reveals: Graphicality and connectedness differ. Evidence to collect: write the input, predict the next state, carry out the calculation, and compare the result with an independently produced reference. Explain the exact invariant, equation, inequality or counting rule that supports the conclusion. Then vary one assumption and record whether the result changes smoothly, discontinuously or not at all.
Limit to keep visible: State the target property. A useful report places this boundary beside the result rather than hiding it in a final disclaimer.
10. Random generation
Run greedy construction repeatedly. Inspect bias.
What the mathematics reveals: A witness algorithm is not uniform sampling. Evidence to collect: write the input, predict the next state, carry out the calculation, and compare the result with an independently produced reference. Explain the exact invariant, equation, inequality or counting rule that supports the conclusion. Then vary one assumption and record whether the result changes smoothly, discontinuously or not at all.
Limit to keep visible: Use specialised samplers. A useful report places this boundary beside the result rather than hiding it in a final disclaimer.
11. Erdos-Gallai comparison
Evaluate prefix inequalities. Compare yes/no results.
What the mathematics reveals: Two theorems certify the same property differently. Evidence to collect: write the input, predict the next state, carry out the calculation, and compare the result with an independently produced reference. Explain the exact invariant, equation, inequality or counting rule that supports the conclusion. Then vary one assumption and record whether the result changes smoothly, discontinuously or not at all.
Limit to keep visible: Keep sort order consistent. A useful report places this boundary beside the result rather than hiding it in a final disclaimer.
12. Property test
Generate small graphs and degree lists. Run the reduction.
What the mathematics reveals: Known witnesses must be accepted. Evidence to collect: write the input, predict the next state, carry out the calculation, and compare the result with an independently produced reference. Explain the exact invariant, equation, inequality or counting rule that supports the conclusion. Then vary one assumption and record whether the result changes smoothly, discontinuously or not at all.
Limit to keep visible: Also test impossible bounded sequences. A useful report places this boundary beside the result rather than hiding it in a final disclaimer.
Limits and misconceptions
Havel–Hakimi addresses degree sequences of simple undirected graphs. It does not guarantee connectedness, planarity, uniqueness, randomness or a particular community structure. Many non-isomorphic graphs can share one sequence. A greedy construction is a witness, not a uniform random sample of all witnesses. Input values must be integers between zero and n−1; negative or fractional values are invalid. Repeated sorting can be inefficient for large instances. The method also does not infer a real network from observed degrees: matching degrees alone ignores labels, edge meaning, time and measurement error. Directed, bipartite and multigraph sequences require other theorems or adaptations.
Five misconceptions to challenge
- An even degree sum is sufficient: It is necessary but not sufficient for a simple graph.
- The construction finds the only graph: Many non-isomorphic realisations may share the sequence.
- Connecting the largest degree arbitrarily is always safe: The theorem specifies the next highest residual degrees, supported by exchange reasoning.
- A graphical sequence must yield a connected graph: Connectedness is an additional property.
- A degree sequence reconstructs a real network: It preserves only one local count per vertex.
Another broad misconception is that advanced mathematics automatically creates intelligence, admission, income or employment. It does not. Deliberate study can strengthen modelling, abstraction, calculation and explanation, while real pathways also depend on interests, communication, domain knowledge, opportunities and circumstances outside one topic.
A learning route for students
Move from a visible trace to a symbolic rule, then to code and critique. For every step below, prepare three pieces of evidence: a correct hand example, a boundary or failure case, and a short explanation using the relevant invariant. Do not advance merely because software returned a number.
Step 1: Apply the handshake lemma
Begin with the smallest non-trivial instance that lets you apply the handshake lemma. Predict the result before calculating. Write each state change clearly enough that another student can reproduce it. Compare with a trusted implementation only after the hand trace is complete.
Next, change one feature—size, ordering, sign, tolerance, labelling or data distribution—and explain which part of the reasoning changes. Finish by teaching the step without code and by naming one input for which the method is unhelpful. This predict–calculate–vary–explain cycle is a strong test of transferable understanding.
Step 2: Sort a degree sequence
Begin with the smallest non-trivial instance that lets you sort a degree sequence. Predict the result before calculating. Write each state change clearly enough that another student can reproduce it. Compare with a trusted implementation only after the hand trace is complete.
Next, change one feature—size, ordering, sign, tolerance, labelling or data distribution—and explain which part of the reasoning changes. Finish by teaching the step without code and by naming one input for which the method is unhelpful. This predict–calculate–vary–explain cycle is a strong test of transferable understanding.
Step 3: Perform a havel-hakimi reduction
Begin with the smallest non-trivial instance that lets you perform a Havel-Hakimi reduction. Predict the result before calculating. Write each state change clearly enough that another student can reproduce it. Compare with a trusted implementation only after the hand trace is complete.
Next, change one feature—size, ordering, sign, tolerance, labelling or data distribution—and explain which part of the reasoning changes. Finish by teaching the step without code and by naming one input for which the method is unhelpful. This predict–calculate–vary–explain cycle is a strong test of transferable understanding.
Step 4: Detect invalid residual degrees
Begin with the smallest non-trivial instance that lets you detect invalid residual degrees. Predict the result before calculating. Write each state change clearly enough that another student can reproduce it. Compare with a trusted implementation only after the hand trace is complete.
Next, change one feature—size, ordering, sign, tolerance, labelling or data distribution—and explain which part of the reasoning changes. Finish by teaching the step without code and by naming one input for which the method is unhelpful. This predict–calculate–vary–explain cycle is a strong test of transferable understanding.
Step 5: Retain vertex labels
Begin with the smallest non-trivial instance that lets you retain vertex labels. Predict the result before calculating. Write each state change clearly enough that another student can reproduce it. Compare with a trusted implementation only after the hand trace is complete.
Next, change one feature—size, ordering, sign, tolerance, labelling or data distribution—and explain which part of the reasoning changes. Finish by teaching the step without code and by naming one input for which the method is unhelpful. This predict–calculate–vary–explain cycle is a strong test of transferable understanding.
Step 6: Construct a witness graph
Begin with the smallest non-trivial instance that lets you construct a witness graph. Predict the result before calculating. Write each state change clearly enough that another student can reproduce it. Compare with a trusted implementation only after the hand trace is complete.
Next, change one feature—size, ordering, sign, tolerance, labelling or data distribution—and explain which part of the reasoning changes. Finish by teaching the step without code and by naming one input for which the method is unhelpful. This predict–calculate–vary–explain cycle is a strong test of transferable understanding.
Step 7: Explain the exchange argument
Begin with the smallest non-trivial instance that lets you explain the exchange argument. Predict the result before calculating. Write each state change clearly enough that another student can reproduce it. Compare with a trusted implementation only after the hand trace is complete.
Next, change one feature—size, ordering, sign, tolerance, labelling or data distribution—and explain which part of the reasoning changes. Finish by teaching the step without code and by naming one input for which the method is unhelpful. This predict–calculate–vary–explain cycle is a strong test of transferable understanding.
Step 8: Distinguish graph models
Begin with the smallest non-trivial instance that lets you distinguish graph models. Predict the result before calculating. Write each state change clearly enough that another student can reproduce it. Compare with a trusted implementation only after the hand trace is complete.
Next, change one feature—size, ordering, sign, tolerance, labelling or data distribution—and explain which part of the reasoning changes. Finish by teaching the step without code and by naming one input for which the method is unhelpful. This predict–calculate–vary–explain cycle is a strong test of transferable understanding.
Step 9: Compare with erdos-gallai inequalities
Begin with the smallest non-trivial instance that lets you compare with Erdos-Gallai inequalities. Predict the result before calculating. Write each state change clearly enough that another student can reproduce it. Compare with a trusted implementation only after the hand trace is complete.
Next, change one feature—size, ordering, sign, tolerance, labelling or data distribution—and explain which part of the reasoning changes. Finish by teaching the step without code and by naming one input for which the method is unhelpful. This predict–calculate–vary–explain cycle is a strong test of transferable understanding.
Step 10: Validate a realised degree list
Begin with the smallest non-trivial instance that lets you validate a realised degree list. Predict the result before calculating. Write each state change clearly enough that another student can reproduce it. Compare with a trusted implementation only after the hand trace is complete.
Next, change one feature—size, ordering, sign, tolerance, labelling or data distribution—and explain which part of the reasoning changes. Finish by teaching the step without code and by naming one input for which the method is unhelpful. This predict–calculate–vary–explain cycle is a strong test of transferable understanding.
A four-week practice plan
- Week 1 — vocabulary and diagrams: define each object, redraw the mechanism and reproduce the worked example.
- Week 2 — equations and manufactured tests: derive the key relation and test inputs with known answers.
- Week 3 — implementation and evidence: use a trusted library, record parameters and compare with a transparent baseline.
- Week 4 — transfer and critique: apply the method to a new context, report limits and identify when a different method is better.
Guidance for parents and educators
Ask “what stays true?” and “what could make this conclusion fail?” before asking for speed. Invite the student to draw the input and output, estimate the result and locate the first step that disagrees with a reference. These prompts reveal conceptual understanding more clearly than memorised terminology.
Advanced enrichment should sit beside secure school foundations in algebra, functions, geometry, statistics and computational thinking. It need not accelerate a student into a fixed career identity. A healthy goal is curiosity with discipline: the learner becomes comfortable reading unfamiliar notation, checking an example, revising a model and communicating uncertainty.
Evidence prompts for a useful conversation
- Which quantity is observed and which is inferred?
- Which step saves work, and why is it allowed?
- Is the claim exact, approximate, probabilistic or empirical?
- What units and conventions are in use?
- Which input makes the method struggle?
- What simple baseline could check the answer?
- What would count as evidence that the parameters are poor?
Mini-project assessment
A strong mini-project contains the original question, a small reproducible dataset, a hand-worked example, code or a spreadsheet trace, at least one boundary test, a comparison with a baseline, and a paragraph on limits. Assess the reasoning trail as well as the final output. Repairing a model after a surprising result is valuable mathematical progress.
Six evidence checks for a finished project
Check 1: Apply the handshake lemma
Ask the student to demonstrate how to apply the handshake lemma without relying on a hidden software step. The evidence should include a labelled input, the exact rule used, one intermediate state and a result that can be checked independently. If the answer changes after labels or order change, the student should say whether that reflects the mathematics or only a convention.
Then request one deliberately awkward example. The learner should predict the difficulty before running the method, explain what the output does and does not establish, and name a reasonable alternative or safeguard. This check joins correctness with judgement: a technically valid calculation is useful only when its assumptions and interpretation remain visible.
Check 2: Sort a degree sequence
Ask the student to demonstrate how to sort a degree sequence without relying on a hidden software step. The evidence should include a labelled input, the exact rule used, one intermediate state and a result that can be checked independently. If the answer changes after labels or order change, the student should say whether that reflects the mathematics or only a convention.
Then request one deliberately awkward example. The learner should predict the difficulty before running the method, explain what the output does and does not establish, and name a reasonable alternative or safeguard. This check joins correctness with judgement: a technically valid calculation is useful only when its assumptions and interpretation remain visible.
Check 3: Perform a havel-hakimi reduction
Ask the student to demonstrate how to perform a Havel-Hakimi reduction without relying on a hidden software step. The evidence should include a labelled input, the exact rule used, one intermediate state and a result that can be checked independently. If the answer changes after labels or order change, the student should say whether that reflects the mathematics or only a convention.
Then request one deliberately awkward example. The learner should predict the difficulty before running the method, explain what the output does and does not establish, and name a reasonable alternative or safeguard. This check joins correctness with judgement: a technically valid calculation is useful only when its assumptions and interpretation remain visible.
Check 4: Detect invalid residual degrees
Ask the student to demonstrate how to detect invalid residual degrees without relying on a hidden software step. The evidence should include a labelled input, the exact rule used, one intermediate state and a result that can be checked independently. If the answer changes after labels or order change, the student should say whether that reflects the mathematics or only a convention.
Then request one deliberately awkward example. The learner should predict the difficulty before running the method, explain what the output does and does not establish, and name a reasonable alternative or safeguard. This check joins correctness with judgement: a technically valid calculation is useful only when its assumptions and interpretation remain visible.
Check 5: Retain vertex labels
Ask the student to demonstrate how to retain vertex labels without relying on a hidden software step. The evidence should include a labelled input, the exact rule used, one intermediate state and a result that can be checked independently. If the answer changes after labels or order change, the student should say whether that reflects the mathematics or only a convention.
Then request one deliberately awkward example. The learner should predict the difficulty before running the method, explain what the output does and does not establish, and name a reasonable alternative or safeguard. This check joins correctness with judgement: a technically valid calculation is useful only when its assumptions and interpretation remain visible.
Check 6: Construct a witness graph
Ask the student to demonstrate how to construct a witness graph without relying on a hidden software step. The evidence should include a labelled input, the exact rule used, one intermediate state and a result that can be checked independently. If the answer changes after labels or order change, the student should say whether that reflects the mathematics or only a convention.
Then request one deliberately awkward example. The learner should predict the difficulty before running the method, explain what the output does and does not establish, and name a reasonable alternative or safeguard. This check joins correctness with judgement: a technically valid calculation is useful only when its assumptions and interpretation remain visible.
Frequently asked questions
What is a graphical degree sequence?
A list realised by the vertex degrees of a simple undirected graph.
What does Havel–Hakimi do?
It repeatedly removes the largest degree and reduces the next largest residual degrees.
Why must the degree sum be even?
Each undirected edge contributes two to the total degree.
Is even sum sufficient?
No.
Can the algorithm build a graph?
Yes, if labels and chosen connections are retained.
Is the realisation unique?
Usually not.
Does graphical imply connected?
No.
Can degrees exceed n−1?
Not in a simple graph with n vertices.
What is the runtime?
A straightforward repeatedly sorted implementation is polynomial; data structures can improve it.
What should students know first?
Graphs, vertices, edges, degrees, sorting and proof by equivalence.
Useful next reading and sources
Source: S. L. Hakimi’s 1962 SIAM paper on graph realisability.
Source: EuDML record for Václav Havel’s 1955 graph-existence paper.
Related eduKateSG reading: Prüfer sequences and labelled trees.
Related eduKateSG reading: Boyer–Myrvold planarity testing.
Related eduKateSG reading: Fiduccia–Mattheyses graph partitioning.
Read sources with a question in mind: which definition, theorem, default or limitation is being supported? An authoritative link is useful evidence, but it does not replace a worked calculation or a clear statement of how the source applies to the example.
A cheerful final thought
Mathematics becomes friendlier when every symbol has a job and every claim has a boundary. Start small, make the state visible, test the awkward case, and celebrate the moment when a pattern becomes explainable. That is the practical benefit of learning mathematics: not certainty about every future, but a growing ability to ask better questions and build trustworthy answers.