NetworkX

Previous topic

is_pseudographical

Next topic

is_valid_degree_sequence_erdos_gallai

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

|d| >= \frac{(\max(d) + \min(d) + 1)^2}{4*\min(d)}

then d is graphical. This was shown in Theorem 6 in [R227].

References

[R227](1, 2) I.E. Zverovich and V.E. Zverovich. “Contributions to the theory of graphic sequences”, Discrete Mathematics, 105, pp. 292-303 (1992).

[havel1955], [hakimi1962], [CL1996]