pub struct BfsSimple {
pub order: Vec<VertexId>,
pub layers: Vec<usize>,
pub parents: Vec<Option<VertexId>>,
}Expand description
Result of bfs_simple.
Fields§
§order: Vec<VertexId>Vertices visited during the traversal, in BFS order.
layers: Vec<usize>Layer boundary indices into order. Vertices at
distance d from the root are order[layers[d]..layers[d+1]].
The length is max_distance + 2.
parents: Vec<Option<VertexId>>parents[v] == Some(p) if vertex v was discovered via p;
parents[root] == None (root has no parent).
parents[v] == None for unreachable vertices as well.
To distinguish root from unreachable, check order[0] == v.
Trait Implementations§
impl Eq for BfsSimple
impl StructuralPartialEq for BfsSimple
Auto Trait Implementations§
impl Freeze for BfsSimple
impl RefUnwindSafe for BfsSimple
impl Send for BfsSimple
impl Sync for BfsSimple
impl Unpin for BfsSimple
impl UnsafeUnpin for BfsSimple
impl UnwindSafe for BfsSimple
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more