Skip to main content

ReverseGraph

Trait ReverseGraph 

Source
pub trait ReverseGraph: Graph {
    // Required method
    fn predecessors(
        &self,
        state: &Self::State,
        out: &mut Vec<(Self::State, Self::Weight)>,
    );
}
Expand description

A Graph that can also enumerate incoming edges, for bidirectional search.

The predecessors must mirror the successors exactly: (p, w) is reported by predecessors(s) once for every (s, w) that successors(p) reports, parallel edges included.

Required Methods§

Source

fn predecessors( &self, state: &Self::State, out: &mut Vec<(Self::State, Self::Weight)>, )

Appends every incoming edge of state to out as (predecessor, weight), where weight is the cost of the edge from predecessor to state.

out is empty on entry; the caller clears and reuses it between calls.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§