NetworkX

Previous topic

networkx.degree_sequence_tree

Next topic

networkx.create_degree_sequence

Quick search

networkx.is_valid_degree_sequence

is_valid_degree_sequence(deg_sequence)

Return True if deg_sequence is a valid sequence of integer degrees equal to the degree sequence of some simple graph.

  • deg_sequence: degree sequence, a list of integers with each entry

    corresponding to the degree of a node (need not be sorted). A non-graphical degree sequence (i.e. one not realizable by some simple graph) will raise an exception.

See Theorem 1.4 in [chartrand-graphs-1996]. This algorithm is also used in havel_hakimi_graph()

References:

[chartrand-graphs-1996] G. Chartrand and L. Lesniak, “Graphs and Digraphs”,
Chapman and Hall/CRC, 1996.