Havel-Hakimi Algorithm Proof
Theorem
Let’s assume we are given a non-increasing sequence . If is graphic, we can find a realization of using the following method:
- Step 1.
Create a null graph with vertices . - Step 2.
- Step 2-1.
Connect to . - Step 2-2.
Decrease by . - Step 2-3.
Substitute as . Repeat Step 2. until it becomes .
- Step 2-1.
If is graphic, there exists a realization where a vertex with degree is adjacent to .
Description
The Havel-Hakimi algorithm is an algorithm that concretely finds a realization guaranteed by the existence of the Erdős-Gallai theorem. Its principle is simply to handle the vertex with the highest degree first to ensure no small remainders. By providing degrees first, it can directly be used to construct graphs with degree distributions in random graphs.
For example, with a sequence such as , the realization obtained through the Havel-Hakimi algorithm would look like the one above. If time allows, it is recommended to try creating graphic sequences using the Erdős-Gallai theorem and find realizations manually without the Havel-Hakimi algorithm to see its usefulness.
Proof
Every time is updated, the maximum degree gradually decreases. It suffices for the node with the maximum degree to be adjacent to at each step, and showing that the first vertex with degree is adjacent to completes the proof by mathematical induction.
Assuming that the vertices of any realization of satisfy , let’s define the following two sets.
In the definition, is the set collecting vertices after and within the next , and is the neighborhood of , i.e., the set of vertices actually adjacent to in . Let’s consider the following integer .
Now, it must be shown that is the realization of that maximizes . In other words, it satisfies and , meaning that the vertex with degree is adjacent to . If , naturally follows, making the realization that maximizes without further proof. Now, assuming the case of , if another realization of exists that makes
In the case of , must be adjacent to some instead of any . The red dotted line in the above figure represents the edge that exists in but is removed in , and the red solid line is the newly created edge because the degree of must remain constant.
Just as with , the degrees of and must be maintained, so one must choose one , which originally was not adjacent to but was to in , add , and remove . This way, the original degree sequence does not change at all, and can be considered a realization of . However, since misses one from and adds one to , actually becomes smaller than . This contradicts the existence of the realization that satisfies , thereby necessitating . In other words, the vertex in realization is adjacent to .
■