Returns True if deg_sequence can be realized by a simple graph.
The validation is done using the Erdős-Gallai theorem [EG1960].
Parameters : | deg_sequence : list
|
---|---|
Returns : | valid : bool
|
Notes
This implementation uses an equivalent form of the Erdős-Gallai criterion. Worst-case run time is: O(n) where n is the length of the sequence.
Specifically, a sequence d is graphical if and only if the sum of the sequence is even and for all strong indices k in the sequence,
A strong index k is any index where and the value is the number of occurrences of j in d. The maximal strong index is called the Durfee index.
This particular rearrangement comes from the proof of Theorem 3 in [R226].
The ZZ condition says that for the sequence d if
then d is graphical. This was shown in Theorem 6 in [R226].
References
[R225] | A. Tripathi and S. Vijay. “A note on a theorem of Erdős & Gallai”, Discrete Mathematics, 265, pp. 417-420 (2003). |
[R226] | (1, 2, 3) I.E. Zverovich and V.E. Zverovich. “Contributions to the theory of graphic sequences”, Discrete Mathematics, 105, pp. 292-303 (1992). |