Undirected degree sequence#
- is_graphic(degree_seq: List[int]) bool #
bool is_graphic(Range &°ree_sequence)#
Checks if the sequence can be the degree sequence of a valid undirected graph, containing no multi-edges or loops, based on the Erdős–Gallai algorithm [8, 9].
Directed degree-pair sequence#
- is_digraphic(in_out_degree_sequence: List[Pair[int, int]]) bool #
bool is_digraphic(PairRange &&in_out_degree_sequence)#
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.