Function cnetworks::explore [−][src]
pub fn explore(
net: &Network,
root: usize
) -> Result<(HashSet<usize>, HashSet<usize>), Err>
Expand description
Explore the network starting with root
, finding all nodes for which the path root -> node
exists (the explored) and those for which it does not (the unexplored).
Returns 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
This function pancis when the queue operations fail.
Examples
let net = Network::new(100, Model::ER { p: 0.05, whole: false }, Weight::None);
let (exp, unexp) = explore(&net, 1).unwrap();
println!("Available from 1: {:?}", exp);
println!("Unavailable from 1: {:?}", unexp);