networkx 2.8.2 Pypi GitHub Homepage
Other Docs
_configuration_model(deg_sequence, create_using, directed=False, in_deg_sequence=None, seed=None)

deg_sequence is a list of nonnegative integers representing the degree of the node whose label is the index of the list element.

create_using see ~networkx.empty_graph .

directed and in_deg_sequence are required if you want the returned graph to be generated using the directed configuration model algorithm. If directed is False , then deg_sequence is interpreted as the degree sequence of an undirected graph and in_deg_sequence is ignored. Otherwise, if directed is True , then deg_sequence is interpreted as the out-degree sequence and in_deg_sequence as the in-degree sequence of a directed graph.

note

deg_sequence and in_deg_sequence need not be the same length.

seed is a random.Random or numpy.random.RandomState instance

This function returns a graph, directed if and only if directed is True , generated according to the configuration model algorithm. For more information on the algorithm, see the configuration_model or directed_configuration_model functions.

Helper function for generating either undirected or directed configuration model graphs.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/generators/degree_seq.py#59
type: <class 'function'>
Commit: