pub fn distance_spectrum(graph: &Graph) -> IgraphResult<Vec<f64>>Expand description
Compute the distance spectrum, sorted in decreasing order.
Returns the eigenvalues of the distance matrix. Requires a connected undirected graph.
ยงExamples
use rust_igraph::{Graph, distance_spectrum};
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
let spec = distance_spectrum(&g).unwrap();
assert_eq!(spec.len(), 3);
// Largest eigenvalue is positive
assert!(spec[0] > 0.0);