pub fn is_degree_sequence_graphlike(degrees: &[usize]) -> bool
Expand description

Check whether the sequence of numbers is graph-like.

A sequence of non-negative integers is called a graph-like if it is a sequence of powers of some simple graph.

Example

use graphalgs::spec::is_degree_sequence_graphlike;

// Graph: [ 1-2-2-1 ] (the numbers are degrees of the vertices).
assert!(is_degree_sequence_graphlike(&vec![2, 2, 1, 1]));

// A single vertex of a graph cannot have degree 2.
assert!(!is_degree_sequence_graphlike(&vec![2]));