Struct graphic::DirectedGraph
[−]
[src]
pub struct DirectedGraph<A> { /* fields omitted */ }
A directed graph
Methods
impl<A> DirectedGraph<A>
[src]
fn new() -> DirectedGraph<A>
[src]
Constructs a new empty directed graph
fn vertex(&self, id: VertexId) -> Option<&Vertex<A>>
[src]
Retrieves the vertex at the given id
fn vertex_mut(&mut self, id: VertexId) -> Option<&mut Vertex<A>>
[src]
Retrieves the vertex at the given id
fn vertex_value(&self, id: VertexId) -> Option<&A>
[src]
Retrieves a vertex value
fn vertex_value_mut(&mut self, id: VertexId) -> Option<&mut A>
[src]
Retrieves a vertex value
fn add_vertex(&mut self, value: A) -> VertexId
[src]
Retrieves the vertex value from the graph
fn connect(&mut self, from: VertexId, to: VertexId, weight: i64) -> Result
[src]
Connects two vertices
fn breadth_first_iter(&self, from: VertexId) -> BFDirectedGraphIter<A>
[src]
Iterate over vertices in breadth-first order
fn depth_first_iter(&self, from: VertexId) -> DFDirectedGraphIter<A>
[src]
fn is_empty(&self) -> bool
[src]
fn is_cyclic(&self) -> bool
[src]
Checks if the graph is cyclic
fn out_degree(&self, vertex_id: VertexId) -> Option<usize>
[src]
The out-degree of a vertex
fn in_degree(&self, vertex_id: VertexId) -> Option<usize>
[src]
The in-degree of a vertex
fn topologically_ordered_iter(&self) -> Option<TopologicalIter<A>>
[src]
Returns an iterator over topologically-ordered vertices if the graph is acyclic
fn longest_distance_from(&self, source: VertexId) -> Option<(VertexId, i64)>
[src]
Returns a vertex with the weight of the path to it