Warning

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

networkx.algorithms.graphical.is_multigraphical

is_multigraphical(sequence)[source]

Returns True if some multigraph can realize the sequence.

Parameters

sequence (list) – A list of integers

Returns

valid – True if deg_sequence is a multigraphic degree sequence and False if not.

Return type

bool

Notes

The worst-case run time is \(O(n)\) where \(n\) is the length of the sequence.

References

1

S. L. Hakimi. “On the realizability of a set of integers as degrees of the vertices of a linear graph”, J. SIAM, 10, pp. 496-506 (1962).