degree_sequence_tree#

degree_sequence_tree(deg_sequence, create_using=None)[source]#

为给定的度序列构建一棵树。

一棵树满足 #节点 - #边 = 1,因此 度序列必须满足 len(度序列) - sum(度序列)/2 = 1