NetworkX

Previous topic

networkx.havel_hakimi_graph

Next topic

networkx.is_valid_degree_sequence

Quick search

networkx.degree_sequence_tree

degree_sequence_tree(deg_sequence)

Make a tree for the given degree sequence.

A tree has #nodes-#edges=1 so the degree sequence must have len(deg_sequence)-sum(deg_sequence)/2=1