The Havel-Hakimi algorithm is a systematic method used to determine if a sequence of numbers is graphical. It applies a sequence of reductions to simplify and test the sequence progressively.
Here's a simplified guide on how to use it:
- Sort the degree sequence in non-increasing order.
- Remove the first element (the largest degree) from the sequence.
- Subtract 1 from the next 'largest degree' number of elements since this removed largest degree represents connecting edges to other vertices, thus decreasing those vertices' degrees by 1.
- Resort and repeat the process on the new sequence.
If you eventually reduce the sequence to all zeros, the initial sequence is graphical. In our case, the sequence \(4,3,2,2,1\) was reduced successfully to all zeros, confirming its graphical nature. Conversely, the algorithm fails for sequences like \(3,3,3,1\), where negative values emerge, proving it non-graphical.
The Havel-Hakimi theorem backs this algorithm by stating that such reductions preserve the graphical nature when performed consistently and accurately.