Attempt to create a valid degree sequence of length n using specified function sfunction(n,**kwds).
Parameters: | n : int
sfunction: function :
max_tries: int :
|
---|
Notes
Repeatedly create a degree sequence by calling sfunction(n,**kwds) until achieving a valid degree sequence. If unsuccessful after max_tries attempts, raise an exception.
For examples of sfunctions that return sequences of random numbers, see networkx.Utils.
Examples
>>> from networkx.utils import uniform_sequence
>>> seq=nx.create_degree_sequence(10,uniform_sequence)