Warning
This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.
is_valid_degree_sequence_havel_hakimi¶
-
is_valid_degree_sequence_havel_hakimi
(deg_sequence)[source]¶ Returns True if deg_sequence can be realized by a simple graph.
The validation proceeds using the Havel-Hakimi theorem. Worst-case run time is: O(s) where s is the sum of the sequence.
Parameters: deg_sequence : list
A list of integers where each element specifies the degree of a node in a graph.
Returns: valid : bool
True if deg_sequence is graphical and False if not.
Notes
The ZZ condition says that for the sequence d if
\[\begin{split}|d| >= \frac{(\max(d) + \min(d) + 1)^2}{4*\min(d)}\end{split}\]then d is graphical. This was shown in Theorem 6 in [R252].
References
[R252] (1, 2) I.E. Zverovich and V.E. Zverovich. “Contributions to the theory of graphic sequences”, Discrete Mathematics, 105, pp. 292-303 (1992).