pub trait AsSubgraph<W, E: Edge<W>>: AsFrozenSubgraph<W, E> {
// Required methods
fn remove_edge(
&mut self,
src_id: usize,
dst_id: usize,
edge_id: usize,
) -> Result<()>;
fn remove_edge_unchecked(
&mut self,
src_id: usize,
dst_id: usize,
edge_id: usize,
);
fn remove_vertex(&mut self, vertex_id: usize) -> Result<()>;
fn remove_vertex_unchecked(&mut self, vertex_id: usize);
fn add_vertex_from_graph(&mut self, vertex_id: usize) -> Result<()>;
fn add_vertex_from_graph_unchecked(&mut self, vertex_id: usize);
fn add_edge_from_graph(
&mut self,
src_id: usize,
dst_id: usize,
edge_id: usize,
) -> Result<()>;
fn add_edge_from_graph_unchecked(
&mut self,
src_id: usize,
dst_id: usize,
edge_id: usize,
);
}Expand description
Describes a subgraph that can mutate but the graph that it represents, can not mutate.
Obviously you can remove vertices and edges from the subgraph but it does not remove them from the graph. You can also add already existing vertices and edges from graph to subgraph.
§Note
Functions defined in this trait are abstractions of what is expected from a subgraph.
For concrete information about why/when these functions may panic or return Err, refer to the specific subgraph struct that you are using.
§Generic Parameters
W: Weight type associated with edges.E: Edge type that subgraph uses.
Required Methods§
Sourcefn remove_edge_unchecked(
&mut self,
src_id: usize,
dst_id: usize,
edge_id: usize,
)
fn remove_edge_unchecked( &mut self, src_id: usize, dst_id: usize, edge_id: usize, )
Removes the edge with id: edge_id.
§Arguments
src_id: Id of source vertex.dst_id: Id of destination vertex.edge_id: Id of edge to be removed.
Sourcefn remove_vertex(&mut self, vertex_id: usize) -> Result<()>
fn remove_vertex(&mut self, vertex_id: usize) -> Result<()>
Sourcefn remove_vertex_unchecked(&mut self, vertex_id: usize)
fn remove_vertex_unchecked(&mut self, vertex_id: usize)
Removes the vertex with id: vertex_id from subgraph.
§Arguments
vertex_id: Id of the vertex to be removed.
Sourcefn add_vertex_from_graph(&mut self, vertex_id: usize) -> Result<()>
fn add_vertex_from_graph(&mut self, vertex_id: usize) -> Result<()>
Sourcefn add_vertex_from_graph_unchecked(&mut self, vertex_id: usize)
fn add_vertex_from_graph_unchecked(&mut self, vertex_id: usize)
Adds a vertex that is already in the graph, to the subgraph.
§Arguments
vertex_id: Id of the vertex to be added from graph to subgraph.
Sourcefn add_edge_from_graph(
&mut self,
src_id: usize,
dst_id: usize,
edge_id: usize,
) -> Result<()>
fn add_edge_from_graph( &mut self, src_id: usize, dst_id: usize, edge_id: usize, ) -> Result<()>
Sourcefn add_edge_from_graph_unchecked(
&mut self,
src_id: usize,
dst_id: usize,
edge_id: usize,
)
fn add_edge_from_graph_unchecked( &mut self, src_id: usize, dst_id: usize, edge_id: usize, )
Adds an edge that is already in the graph, to the subgraph.
§Arguments
src_id: Id of the source vertex.dst_id: Id of the destination vertex.edge_id: Id of the edge from source vertex to destination vertex.
Implementors§
impl<'a, W, E, Dir, G> AsSubgraph<W, E> for MultiRootSubgraph<'a, W, E, Dir, G>
MultiRootSubgraph uses Subgraph internally so for more info checkout Subgraph.