pub fn explore(net: &Network, root: usize) -> Result<(VecSet, VecSet)>
Expand description

Explore the network starting with root, finding all nodes for which the path from root to node exists (the explored) and those for which it does not (the unexplored).

Returns a pair of cn::VecSet s: one with the explored nodes (including the root) and another with the unexplored.

Returns cn::Err::NoSuchNode if the root does not exist.

Examples

let net = Network::new(100, Model::ER { p: 0.05, whole: false }, Weight::default());
let (exp, unexp) = bfs::explore(&net, 1).unwrap();
println!("Available from 1: {:?}", exp);
println!("Unavailable from 1: {:?}", unexp);