Trait traitgraph::interface::NavigableGraph [−][src]
pub trait NavigableGraph<'a>: ImmutableGraphContainer + Sized {
type OutNeighbors: Iterator<Item = Neighbor<Self::NodeIndex, Self::EdgeIndex>>;
type InNeighbors: Iterator<Item = Neighbor<Self::NodeIndex, Self::EdgeIndex>>;
type EdgesBetween: Iterator<Item = Self::EdgeIndex>;
fn out_neighbors(&'a self, node_id: Self::NodeIndex) -> Self::OutNeighbors;
fn in_neighbors(&'a self, node_id: Self::NodeIndex) -> Self::InNeighbors;
fn edges_between(
&'a self,
from_node_id: Self::NodeIndex,
to_node_id: Self::NodeIndex
) -> Self::EdgesBetween;
fn out_degree(&'a self, node_id: Self::NodeIndex) -> usize { ... }
fn in_degree(&'a self, node_id: Self::NodeIndex) -> usize { ... }
fn is_biunivocal_node(&'a self, node_id: Self::NodeIndex) -> bool { ... }
fn is_bivalent_node(&'a self, node_id: Self::NodeIndex) -> bool { ... }
fn is_split_edge(&'a self, edge_id: Self::EdgeIndex) -> bool { ... }
fn is_join_edge(&'a self, edge_id: Self::EdgeIndex) -> bool { ... }
fn is_split_node(&'a self, node_id: Self::NodeIndex) -> bool { ... }
fn is_join_node(&'a self, node_id: Self::NodeIndex) -> bool { ... }
}
Expand description
A graph that can be navigated, i.e. that can iterate the neighbors of its nodes.
Associated Types
The iterator type used to iterate over the outgoing neighbors of a node.
The iterator type used to iterate over the incoming neighbors of a node.
type EdgesBetween: Iterator<Item = Self::EdgeIndex>
type EdgesBetween: Iterator<Item = Self::EdgeIndex>
The iterator type used to iterate over the edges between to nodes.
Required methods
fn out_neighbors(&'a self, node_id: Self::NodeIndex) -> Self::OutNeighbors
fn out_neighbors(&'a self, node_id: Self::NodeIndex) -> Self::OutNeighbors
Returns an iterator over the outgoing neighbors of the given node.
fn in_neighbors(&'a self, node_id: Self::NodeIndex) -> Self::InNeighbors
fn in_neighbors(&'a self, node_id: Self::NodeIndex) -> Self::InNeighbors
Returns an iterator over the incoming neighbors of the given node.
fn edges_between(
&'a self,
from_node_id: Self::NodeIndex,
to_node_id: Self::NodeIndex
) -> Self::EdgesBetween
fn edges_between(
&'a self,
from_node_id: Self::NodeIndex,
to_node_id: Self::NodeIndex
) -> Self::EdgesBetween
Returns an iterator over the edges (from_node_id, to_node_id)
.
Provided methods
fn out_degree(&'a self, node_id: Self::NodeIndex) -> usize
fn out_degree(&'a self, node_id: Self::NodeIndex) -> usize
Returns the amount of outgoing edges from a node.
Returns the amount of incoming edges to a node.
fn is_biunivocal_node(&'a self, node_id: Self::NodeIndex) -> bool
fn is_biunivocal_node(&'a self, node_id: Self::NodeIndex) -> bool
Returns true if the given node has indegree == 1 and outdegree == 1.
fn is_bivalent_node(&'a self, node_id: Self::NodeIndex) -> bool
fn is_bivalent_node(&'a self, node_id: Self::NodeIndex) -> bool
Returns true if the given node has indegree > 1 and outdegree > 1.
fn is_split_edge(&'a self, edge_id: Self::EdgeIndex) -> bool
fn is_split_edge(&'a self, edge_id: Self::EdgeIndex) -> bool
Returns true if the given edge’s tail has outdegree > 1.
fn is_join_edge(&'a self, edge_id: Self::EdgeIndex) -> bool
fn is_join_edge(&'a self, edge_id: Self::EdgeIndex) -> bool
Returns true if the given edge’s head has indegree > 1.
fn is_split_node(&'a self, node_id: Self::NodeIndex) -> bool
fn is_split_node(&'a self, node_id: Self::NodeIndex) -> bool
Returns true if the given node has outdegree > 1.
fn is_join_node(&'a self, node_id: Self::NodeIndex) -> bool
fn is_join_node(&'a self, node_id: Self::NodeIndex) -> bool
Returns true if the given node has indegree > 1.