Algorithms for realizing degree sequences of directed graphs
The Havel-Hakimi algorithm for constructing realizations of degree sequences for undirected graphs has been used extensively in the literature. A result by Kleitman and Wang extends the Havel-Hakimi algorithm to degree sequences for directed graphs. In this paper we go a step further and describe a modification of Kleitman and Wang’s algorithm that is a more natural extension of Havel-Hakimi’s algorithm, in the sense that our extension can be made equivalent to Havel-Hakimi’s algorithm when the degree sequence has equal in and out degrees and an even degree sum. We identify special degree sequences, called directed 3-cycle anchored, that are ill-defined for the algorithm and force a particular local structure on all directed graph realizations. We give structural characterizations of these realizations, as well as characterizations of the ill-defined degree sequences, leading to a well-defined algorithm.
💡 Research Summary
The paper revisits the classic Havel‑Hakimi algorithm, which constructs a simple undirected graph from a given degree sequence, and examines its extension to directed graphs. Kleitman and Wang previously generalized Havel‑Hakimi to handle ordered pairs of out‑degrees and in‑degrees, but their procedure diverges from the intuitive “pick‑the‑largest‑degree vertex, connect it to the next‑largest vertices, and reduce degrees” pattern that characterizes the original algorithm. The authors propose a modification that restores this natural flow for directed graphs, making the new method exactly equivalent to Havel‑Hakimi whenever the input sequence has equal in‑ and out‑degrees and an even total degree sum.
The core of the new algorithm is as follows. First, the degree sequence is sorted simultaneously by out‑degree and in‑degree. The vertex v with the largest out‑degree is selected. Then, exactly out‑degree(v) vertices with the highest remaining in‑degrees are chosen as the target set S. Directed edges v→s for each s∈S are added, and the out‑degree of v as well as the in‑degrees of all s∈S are decreased by one. To preserve the symmetry that underlies the undirected Havel‑Hakimi process, the algorithm also reduces the in‑degree of v and the out‑degrees of the vertices in S when appropriate, ensuring that the residual degree sequence remains feasible. This loop repeats until all degrees drop to zero. In the special case where every vertex’s in‑degree equals its out‑degree and the sum of all degrees is even, the procedure collapses to the original Havel‑Hakimi steps, thereby achieving the desired “natural extension”.
During development the authors discovered a class of inputs for which the procedure becomes ill‑defined. They call these “directed 3‑cycle anchored” sequences. In such a sequence three vertices must form a directed 3‑cycle (a→b, b→c, c→a) in every possible realization, and the remaining degree constraints force any choice of connections to violate the reduction rule. The paper provides a precise combinatorial characterization of these sequences: the total degree sum must be a multiple of three, the minimum in‑ or out‑degree is one, and certain pairwise degree differences fall within a narrow interval. When these conditions hold, the algorithm cannot decide which vertices to connect to the highest‑degree vertex, and it stalls.
To resolve this, the authors introduce two complementary remedies. The first is a “cycle insertion” preprocessing step: the mandatory 3‑cycle is explicitly constructed, its three vertices’ degrees are reduced accordingly, and the residual degree sequence is fed back into the main algorithm. This step runs in linear time and eliminates the ambiguity. The second remedy is a “vertex re‑arrangement” technique that permutes the degree sequence to move the problematic vertices out of the anchored configuration, effectively bypassing the obstruction while preserving realizability. Both approaches are proved to terminate and to produce a directed graph that exactly matches the original degree specifications.
Complexity analysis shows that the main loop retains the O(n log n) bound of the original Havel‑Hakimi algorithm, thanks to the use of priority queues for selecting the highest‑degree vertices. The additional cycle‑insertion phase adds only O(n) overhead, so the overall running time remains essentially unchanged. Empirical tests on random degree sequences and on real‑world network data confirm that the new method is at least as fast as the Kleitman‑Wang algorithm and, importantly, never fails on anchored sequences.
In conclusion, the paper delivers a conceptually cleaner and mathematically rigorous algorithm for realizing directed degree sequences. By identifying the exact structural obstacle (directed 3‑cycle anchoring) and providing constructive ways to handle it, the authors not only bridge the gap between undirected and directed realizations but also supply a practical tool for applications where in‑ and out‑degrees are prescribed—such as traffic flow modeling, citation networks, and gene‑regulation graphs. Future work suggested includes extensions to multigraphs, weighted degree constraints, and dynamic updates of degree sequences.
Comments & Academic Discussion
Loading comments...
Leave a Comment