NetworkX

Previous topic

networkx.generators.degree_seq.degree_sequence_tree

Next topic

networkx.generators.degree_seq.create_degree_sequence

networkx.generators.degree_seq.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 [R55]. This algorithm is also used in havel_hakimi_graph()

References

[R55](1, 2) G. Chartrand and L. Lesniak, “Graphs and Digraphs”, Chapman and Hall/CRC, 1996.