pub struct TreeBackedGraph { /* private fields */ }
Expand description
An undirected graph with balanced computational complexity.
Complexity | |
---|---|
add_vertex | $O(\log |V|)$ |
add_edge | $O(\log |V| + \log |E|)$ |
remove_edge | $O(\log |E|)$ |
remove_vertex | $O(\log |V| + |E’|)$, where $E’$ is the set of edges connecting to the vertex to remove. |
vertex_size | $O(1)$ |
iter_vertices | amortized $O(1)$ and $O(\log |V|)$ in the worst cases. |
contains_vertex | $O(\log |V|)$ |
edge_size | $O(1)$ |
iter_edges | amortized $O(1)$ and $O(\log |E|)$ in the worst cases. |
contains_edge | $O(\log |E|)$ |
find_edge | $O(\log |E|)$ |
edges_connecting | returns in $O(\log |E|)$. amortized $O(1)$ and $O(\log |E|)$ in the worst cases on each call to .next . |
in_edges | returns in $O(\log |E|)$. amortized $O(1)$ and $O(\log |E|)$ in the worst cases on each call to .next . |
out_edges | returns in $O(\log |E|)$. amortized $O(1)$ and $O(\log |E|)$ in the worst cases on each call to .next . |
Trait Implementations§
Source§impl Clone for TreeBackedGraph
impl Clone for TreeBackedGraph
Source§fn clone(&self) -> TreeBackedGraph
fn clone(&self) -> TreeBackedGraph
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TreeBackedGraph
impl Debug for TreeBackedGraph
Source§impl DirectedOrNot for TreeBackedGraph
impl DirectedOrNot for TreeBackedGraph
Source§const DIRECTED_OR_NOT: bool = false
const DIRECTED_OR_NOT: bool = false
When the graph is directed, it is true; otherwise, it is false.
Source§impl GrowableGraph for TreeBackedGraph
impl GrowableGraph for TreeBackedGraph
Source§impl QueryableGraph for TreeBackedGraph
impl QueryableGraph for TreeBackedGraph
Source§fn vertex_size(&self) -> usize
fn vertex_size(&self) -> usize
Number of vertices in the graph.
Source§fn iter_vertices(&self) -> Box<dyn Iterator<Item = VertexId> + '_>
fn iter_vertices(&self) -> Box<dyn Iterator<Item = VertexId> + '_>
Iteration over all vertices in the graph.
Source§fn contains_vertex(&self, v: &VertexId) -> bool
fn contains_vertex(&self, v: &VertexId) -> bool
Whether a vertex is in the graph or not.
Source§fn iter_edges(&self) -> Box<dyn Iterator<Item = Edge> + '_>
fn iter_edges(&self) -> Box<dyn Iterator<Item = Edge> + '_>
Iteration over all edges in the graph.
Source§fn contains_edge(&self, e: &EdgeId) -> bool
fn contains_edge(&self, e: &EdgeId) -> bool
Whether an edge is in the graph or not.
Source§fn find_edge(&self, e: &EdgeId) -> Option<Edge>
fn find_edge(&self, e: &EdgeId) -> Option<Edge>
Returns information about a specified edge in the graph.
Source§fn in_edges(&self, v: &VertexId) -> Box<dyn Iterator<Item = Edge> + '_>
fn in_edges(&self, v: &VertexId) -> Box<dyn Iterator<Item = Edge> + '_>
Iteration over all edges going into the vertex
v
. Read moreSource§fn out_edges(&self, v: &VertexId) -> Box<dyn Iterator<Item = Edge> + '_>
fn out_edges(&self, v: &VertexId) -> Box<dyn Iterator<Item = Edge> + '_>
Iteration over all edges going out of
v
. Read moreSource§fn edges_connecting<'a, 'b>(
&'a self,
source: &'b VertexId,
sink: &'b VertexId,
) -> Box<dyn Iterator<Item = Edge> + 'a>
fn edges_connecting<'a, 'b>( &'a self, source: &'b VertexId, sink: &'b VertexId, ) -> Box<dyn Iterator<Item = Edge> + 'a>
Iteration over all edges between two vertices in undirected graphs
or those from
source
to sink
in directed graphs.Auto Trait Implementations§
impl Freeze for TreeBackedGraph
impl RefUnwindSafe for TreeBackedGraph
impl Send for TreeBackedGraph
impl Sync for TreeBackedGraph
impl Unpin for TreeBackedGraph
impl UnwindSafe for TreeBackedGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more