Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

# networkx.generators.degree_seq.directed_havel_hakimi_graph¶

directed_havel_hakimi_graph(in_deg_sequence, out_deg_sequence, create_using=None)[source]

Returns a directed graph with the given degree sequences.

Parameters: in_deg_sequence (list of integers) – Each list entry corresponds to the in-degree of a node. out_deg_sequence (list of integers) – Each list entry corresponds to the out-degree of a node. create_using (NetworkX graph constructor, optional (default DiGraph)) – Graph type to create. If graph instance, then cleared before populated. G – A graph with the specified degree sequences. Nodes are labeled starting at 0 with an index corresponding to the position in deg_sequence DiGraph NetworkXError – If the degree sequences are not digraphical.

Notes

Algorithm as described by Kleitman and Wang [1].

References

 [1] D.J. Kleitman and D.L. Wang Algorithms for Constructing Graphs and Digraphs with Given Valences and Factors Discrete Mathematics, 6(1), pp. 79-88 (1973)