Skip to main content

density

Function density 

Source
pub fn density(graph: &Graph) -> DensityResult
Expand description

Computes the density of an undirected graph: 2 * |E| / (|V| * (|V| - 1)).

Returns 0.0 for graphs with fewer than 2 nodes.