Undirected degree sequence#
- is_graphic(degree_seq: List[int]) bool #
Directed degree-pair sequence#
- is_digraphic(in_out_degree_sequence: List[Pair[int, int]]) bool #
Checks if the sequence can be the degree-pair sequence of a valid directed graph, containing no multi-edges or loops, based on the algorithm by Kleitman and Wang .
A degree pair sequence is a range (list) of pairs (2-tuples) of integers, where the first element of each item represents in-degree and the second item out-degree of one vertex.