pub fn tree_graph<R: Rng>(n: usize, rng: &mut R) -> Result<Graph<usize, f64>>Expand description
Generates a random tree with n nodes
Uses a random process to connect nodes while maintaining the tree property (connected and acyclic). Each tree has exactly n-1 edges.
§Arguments
n- Number of nodesrng- Random number generator
§Returns
Result<Graph<usize, f64>>- A random tree with nodes 0, 1, …, n-1