NetworkX

Previous topic

is_valid_degree_sequence

Next topic

is_valid_degree_sequence_erdos_gallai

is_valid_degree_sequence_havel_hakimi

is_valid_degree_sequence_havel_hakimi(sequence)[source]

Returns True if the sequence is a valid degree sequence.

A degree sequence is valid if some graph can realize it. Validation proceeds via the Havel-Hakimi algorithm.

Worst-case run time is: O(n^(log n))

Parameters :

sequence : list or iterable container

A sequence of integer node degrees

Returns :

valid : bool

True if the sequence is a valid degree sequence and False if not.

References

[havel1955], [hakimi1962], [CL1996]