pub struct IncrementalSubgraph<'a, Graph: GraphBase> { /* private fields */ }
Expand description
A subgraph that stores the presence or absence of a node or edge using integers. Additionally, this subgraph has a current step that can be altered. Nodes and edges that are added are added with that step, and only nodes and edges with a step lower or equal to the current one are counted as present. This allows to combined multiple subgraphs into one, if they are totally ordered by the subset relation.
Implementations
sourceimpl<'a, Graph: ImmutableGraphContainer> IncrementalSubgraph<'a, Graph>
impl<'a, Graph: ImmutableGraphContainer> IncrementalSubgraph<'a, Graph>
sourcepub fn new_with_incremental_steps(
graph: <Self as DecoratingSubgraph>::ParentGraphRef,
incremental_steps: usize
) -> Self
pub fn new_with_incremental_steps(
graph: <Self as DecoratingSubgraph>::ParentGraphRef,
incremental_steps: usize
) -> Self
Create an incremental subgraph with the given amount of incremental steps.
sourcepub fn set_current_step(&mut self, current_step: usize)
pub fn set_current_step(&mut self, current_step: usize)
Set the current incremental step of the graph.
Trait Implementations
sourceimpl<'a, Graph: ImmutableGraphContainer> DecoratingSubgraph for IncrementalSubgraph<'a, Graph>
impl<'a, Graph: ImmutableGraphContainer> DecoratingSubgraph for IncrementalSubgraph<'a, Graph>
sourcefn new_empty(_graph: Self::ParentGraphRef) -> Self
fn new_empty(_graph: Self::ParentGraphRef) -> Self
Not implemented for this type.
sourcefn new_full(_graph: Self::ParentGraphRef) -> Self
fn new_full(_graph: Self::ParentGraphRef) -> Self
Not implemented for this type.
sourcefn add_node(&mut self, node_index: <Self::ParentGraph as GraphBase>::NodeIndex)
fn add_node(&mut self, node_index: <Self::ParentGraph as GraphBase>::NodeIndex)
Panics if the node_index is not valid for the graph passed in the constructor. Panics also if the node was added already.
sourcefn add_edge(&mut self, edge_index: <Self::ParentGraph as GraphBase>::EdgeIndex)
fn add_edge(&mut self, edge_index: <Self::ParentGraph as GraphBase>::EdgeIndex)
Panics if the edge_index is not valid for the graph passed in the constructor. Panics also if the edge was added already.
sourcefn remove_node(
&mut self,
node_index: <Self::ParentGraph as GraphBase>::NodeIndex
)
fn remove_node(
&mut self,
node_index: <Self::ParentGraph as GraphBase>::NodeIndex
)
Panics if the node_index is not valid for the graph passed in the constructor.
sourcefn remove_edge(
&mut self,
edge_index: <Self::ParentGraph as GraphBase>::EdgeIndex
)
fn remove_edge(
&mut self,
edge_index: <Self::ParentGraph as GraphBase>::EdgeIndex
)
Panics if the edge_index is not valid for the graph passed in the constructor.
sourcefn node_count(&self) -> usize
fn node_count(&self) -> usize
Returns the amount of nodes in the subgraph.
sourcefn edge_count(&self) -> usize
fn edge_count(&self) -> usize
Returns the amount of edges in the subgraph.
type ParentGraph = Graph
type ParentGraph = Graph
The type of the associated parent graph.
type ParentGraphRef = &'a Graph
type ParentGraphRef = &'a Graph
The type of the reference to the associated parent graph.
sourcefn parent_graph(&self) -> &Self::ParentGraph
fn parent_graph(&self) -> &Self::ParentGraph
Returns a reference to the original graph.
sourcefn contains_node(
&self,
node_index: <Self::ParentGraph as GraphBase>::NodeIndex
) -> bool
fn contains_node(
&self,
node_index: <Self::ParentGraph as GraphBase>::NodeIndex
) -> bool
Returns true if the given node id is part of the subgraph.
sourcefn contains_edge(
&self,
edge_index: <Self::ParentGraph as GraphBase>::EdgeIndex
) -> bool
fn contains_edge(
&self,
edge_index: <Self::ParentGraph as GraphBase>::EdgeIndex
) -> bool
Returns true if the given edge id is part of the subgraph.
Auto Trait Implementations
impl<'a, Graph> RefUnwindSafe for IncrementalSubgraph<'a, Graph> where
Graph: RefUnwindSafe,
<Graph as GraphBase>::EdgeIndex: RefUnwindSafe,
<Graph as GraphBase>::NodeIndex: RefUnwindSafe,
impl<'a, Graph> Send for IncrementalSubgraph<'a, Graph> where
Graph: Sync,
<Graph as GraphBase>::EdgeIndex: Send,
<Graph as GraphBase>::NodeIndex: Send,
impl<'a, Graph> Sync for IncrementalSubgraph<'a, Graph> where
Graph: Sync,
<Graph as GraphBase>::EdgeIndex: Sync,
<Graph as GraphBase>::NodeIndex: Sync,
impl<'a, Graph> Unpin for IncrementalSubgraph<'a, Graph> where
<Graph as GraphBase>::EdgeIndex: Unpin,
<Graph as GraphBase>::NodeIndex: Unpin,
impl<'a, Graph> UnwindSafe for IncrementalSubgraph<'a, Graph> where
Graph: RefUnwindSafe,
<Graph as GraphBase>::EdgeIndex: UnwindSafe,
<Graph as GraphBase>::NodeIndex: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> GraphBase for T where
T: DecoratingSubgraph,
impl<T> GraphBase for T where
T: DecoratingSubgraph,
type NodeData = <<T as DecoratingSubgraph>::ParentGraph as GraphBase>::NodeData
type NodeData = <<T as DecoratingSubgraph>::ParentGraph as GraphBase>::NodeData
The data type associated with each node.
type EdgeData = <<T as DecoratingSubgraph>::ParentGraph as GraphBase>::EdgeData
type EdgeData = <<T as DecoratingSubgraph>::ParentGraph as GraphBase>::EdgeData
The data type associated with each edge.
type OptionalNodeIndex = <<T as DecoratingSubgraph>::ParentGraph as GraphBase>::OptionalNodeIndex
type OptionalNodeIndex = <<T as DecoratingSubgraph>::ParentGraph as GraphBase>::OptionalNodeIndex
The optional index type used for nodes.
type OptionalEdgeIndex = <<T as DecoratingSubgraph>::ParentGraph as GraphBase>::OptionalEdgeIndex
type OptionalEdgeIndex = <<T as DecoratingSubgraph>::ParentGraph as GraphBase>::OptionalEdgeIndex
The optional index type used for edges.
type NodeIndex = <<T as DecoratingSubgraph>::ParentGraph as GraphBase>::NodeIndex
type NodeIndex = <<T as DecoratingSubgraph>::ParentGraph as GraphBase>::NodeIndex
The index type used for nodes.
type EdgeIndex = <<T as DecoratingSubgraph>::ParentGraph as GraphBase>::EdgeIndex
type EdgeIndex = <<T as DecoratingSubgraph>::ParentGraph as GraphBase>::EdgeIndex
The index type used for edges.
sourcefn new_none_optional_node_index(&self) -> Self::OptionalNodeIndex
fn new_none_optional_node_index(&self) -> Self::OptionalNodeIndex
Returns the none value of the optional node index type used by the trait.
sourcefn new_none_optional_edge_index(&self) -> Self::OptionalEdgeIndex
fn new_none_optional_edge_index(&self) -> Self::OptionalEdgeIndex
Returns the none value of the optional edge index type used by the trait.
sourceimpl<T> ImmutableGraphContainer for T where
T: DecoratingSubgraph,
<T as DecoratingSubgraph>::ParentGraph: ImmutableGraphContainer,
<T as DecoratingSubgraph>::ParentGraph: for<'a> NavigableGraph<'a>,
impl<T> ImmutableGraphContainer for T where
T: DecoratingSubgraph,
<T as DecoratingSubgraph>::ParentGraph: ImmutableGraphContainer,
<T as DecoratingSubgraph>::ParentGraph: for<'a> NavigableGraph<'a>,
sourcefn node_indices(
&self
) -> GraphIndices<<T as GraphBase>::NodeIndex, <T as GraphBase>::OptionalNodeIndex>ⓘNotable traits for GraphIndices<IndexType, OptionalIndexType>impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
fn node_indices(
&self
) -> GraphIndices<<T as GraphBase>::NodeIndex, <T as GraphBase>::OptionalNodeIndex>ⓘNotable traits for GraphIndices<IndexType, OptionalIndexType>impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
Returns an iterator over the node indices in this graph.
sourcefn edge_indices(
&self
) -> GraphIndices<<T as GraphBase>::EdgeIndex, <T as GraphBase>::OptionalEdgeIndex>ⓘNotable traits for GraphIndices<IndexType, OptionalIndexType>impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
fn edge_indices(
&self
) -> GraphIndices<<T as GraphBase>::EdgeIndex, <T as GraphBase>::OptionalEdgeIndex>ⓘNotable traits for GraphIndices<IndexType, OptionalIndexType>impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
Returns an iterator over the edge indices in this graph.
sourcefn contains_node_index(&self, node_id: <T as GraphBase>::NodeIndex) -> bool
fn contains_node_index(&self, node_id: <T as GraphBase>::NodeIndex) -> bool
Returns true if this graph contains the given node index.
sourcefn contains_edge_index(&self, edge_id: <T as GraphBase>::EdgeIndex) -> bool
fn contains_edge_index(&self, edge_id: <T as GraphBase>::EdgeIndex) -> bool
Returns true if this graph contains the given edge index.
sourcefn node_count(&self) -> usize
fn node_count(&self) -> usize
Returns the amount of nodes in this graph.
sourcefn edge_count(&self) -> usize
fn edge_count(&self) -> usize
Returns the amount of edges in this graph.
sourcefn node_data(
&self,
node_id: <T as GraphBase>::NodeIndex
) -> &<T as GraphBase>::NodeData
fn node_data(
&self,
node_id: <T as GraphBase>::NodeIndex
) -> &<T as GraphBase>::NodeData
Returns a reference to the node data associated with the given node id, or None if there is no such node.
sourcefn edge_data(
&self,
edge_id: <T as GraphBase>::EdgeIndex
) -> &<T as GraphBase>::EdgeData
fn edge_data(
&self,
edge_id: <T as GraphBase>::EdgeIndex
) -> &<T as GraphBase>::EdgeData
Returns a reference to the edge data associated with the given edge id, or None if there is no such edge.
sourcefn node_data_mut(
&mut self,
_node_id: <T as GraphBase>::NodeIndex
) -> &mut <T as GraphBase>::NodeData
fn node_data_mut(
&mut self,
_node_id: <T as GraphBase>::NodeIndex
) -> &mut <T as GraphBase>::NodeData
Returns a mutable reference to the node data associated with the given node id, or None if there is no such node.
sourcefn edge_data_mut(
&mut self,
_edge_id: <T as GraphBase>::EdgeIndex
) -> &mut <T as GraphBase>::EdgeData
fn edge_data_mut(
&mut self,
_edge_id: <T as GraphBase>::EdgeIndex
) -> &mut <T as GraphBase>::EdgeData
Returns a mutable reference to the edge data associated with the given edge id, or None if there is no such edge.
sourcefn contains_edge_between(
&self,
from: <T as GraphBase>::NodeIndex,
to: <T as GraphBase>::NodeIndex
) -> bool
fn contains_edge_between(
&self,
from: <T as GraphBase>::NodeIndex,
to: <T as GraphBase>::NodeIndex
) -> bool
Returns true if the graph contains an edge (from, to)
.
sourcefn edge_count_between(
&self,
from: <T as GraphBase>::NodeIndex,
to: <T as GraphBase>::NodeIndex
) -> usize
fn edge_count_between(
&self,
from: <T as GraphBase>::NodeIndex,
to: <T as GraphBase>::NodeIndex
) -> usize
Returns the amount of edges (from, to)
.
type OutNeighbors = EdgeFilteredNeighborIterator<'a, T, <<T as DecoratingSubgraph>::ParentGraph as NavigableGraph<'a>>::OutNeighbors>
type OutNeighbors = EdgeFilteredNeighborIterator<'a, T, <<T as DecoratingSubgraph>::ParentGraph as NavigableGraph<'a>>::OutNeighbors>
The iterator type used to iterate over the outgoing neighbors of a node.
type InNeighbors = EdgeFilteredNeighborIterator<'a, T, <<T as DecoratingSubgraph>::ParentGraph as NavigableGraph<'a>>::InNeighbors>
type InNeighbors = EdgeFilteredNeighborIterator<'a, T, <<T as DecoratingSubgraph>::ParentGraph as NavigableGraph<'a>>::InNeighbors>
The iterator type used to iterate over the incoming neighbors of a node.
type EdgesBetween = EdgeFilteredEdgeIterator<'a, T, <<T as DecoratingSubgraph>::ParentGraph as NavigableGraph<'a>>::EdgesBetween>
type EdgesBetween = EdgeFilteredEdgeIterator<'a, T, <<T as DecoratingSubgraph>::ParentGraph as NavigableGraph<'a>>::EdgesBetween>
The iterator type used to iterate over the edges between to nodes.
sourcefn out_neighbors(
&'a self,
node_id: <T as GraphBase>::NodeIndex
) -> <T as NavigableGraph<'a>>::OutNeighbors
fn out_neighbors(
&'a self,
node_id: <T as GraphBase>::NodeIndex
) -> <T as NavigableGraph<'a>>::OutNeighbors
Returns an iterator over the outgoing neighbors of the given node.
sourcefn in_neighbors(
&'a self,
node_id: <T as GraphBase>::NodeIndex
) -> <T as NavigableGraph<'a>>::InNeighbors
fn in_neighbors(
&'a self,
node_id: <T as GraphBase>::NodeIndex
) -> <T as NavigableGraph<'a>>::InNeighbors
Returns an iterator over the incoming neighbors of the given node.
sourcefn edges_between(
&'a self,
from_node_id: <T as GraphBase>::NodeIndex,
to_node_id: <T as GraphBase>::NodeIndex
) -> <T as NavigableGraph<'a>>::EdgesBetween
fn edges_between(
&'a self,
from_node_id: <T as GraphBase>::NodeIndex,
to_node_id: <T as GraphBase>::NodeIndex
) -> <T as NavigableGraph<'a>>::EdgesBetween
Returns an iterator over the edges (from_node_id, to_node_id)
.
sourcefn 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.
sourcefn in_degree(&'a self, node_id: Self::NodeIndex) -> usize
fn in_degree(&'a self, node_id: Self::NodeIndex) -> usize
Returns the amount of incoming edges to a node.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourceimpl<Graph> WalkableGraph for Graph where
Graph: GraphBase,
impl<Graph> WalkableGraph for Graph where
Graph: GraphBase,
sourcefn create_node_walk<WalkType: for<'a> NodeWalk<'a, Self, SubwalkType> + FromIterator<Self::NodeIndex>, SubwalkType: for<'a> NodeWalk<'a, Self, SubwalkType> + ?Sized>(
&self,
walk: &[Self::NodeIndex]
) -> WalkType
fn create_node_walk<WalkType: for<'a> NodeWalk<'a, Self, SubwalkType> + FromIterator<Self::NodeIndex>, SubwalkType: for<'a> NodeWalk<'a, Self, SubwalkType> + ?Sized>(
&self,
walk: &[Self::NodeIndex]
) -> WalkType
Create a node-centric walk over the given nodes in this graph.
sourcefn create_empty_node_walk<WalkType: for<'a> NodeWalk<'a, Self, SubwalkType> + Default, SubwalkType: for<'a> NodeWalk<'a, Self, SubwalkType> + ?Sized>(
&self
) -> WalkType
fn create_empty_node_walk<WalkType: for<'a> NodeWalk<'a, Self, SubwalkType> + Default, SubwalkType: for<'a> NodeWalk<'a, Self, SubwalkType> + ?Sized>(
&self
) -> WalkType
Create an empty node-centric walk in this graph.
sourcefn create_edge_walk<WalkType: for<'a> EdgeWalk<'a, Self, SubwalkType> + FromIterator<Self::EdgeIndex>, SubwalkType: for<'a> EdgeWalk<'a, Self, SubwalkType> + ?Sized>(
&self,
walk: &[Self::EdgeIndex]
) -> WalkType
fn create_edge_walk<WalkType: for<'a> EdgeWalk<'a, Self, SubwalkType> + FromIterator<Self::EdgeIndex>, SubwalkType: for<'a> EdgeWalk<'a, Self, SubwalkType> + ?Sized>(
&self,
walk: &[Self::EdgeIndex]
) -> WalkType
Create an edge-centric walk over the given edges in this graph.