Function cnetworks::explore[][src]

pub fn explore(
    net: &Network,
    root: usize
) -> Result<(HashSet<usize>, HashSet<usize>), String>

Explore the network with BFS starting with root. Return a tuple of two HashSets: one with the explored nodes (including the root) and another with the unexplored. Returns Err if the root does not exist. Panics when the network is corrupted or if the queue operations fail.

Examples

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