pub struct AdjacencyNodeList { /* private fields */ }
Expand description
Sparse, node first, adjacency list
Space Complexity
- for undirected graph(deprecated)
- for directed graph
Node Time Complexity
This structure has very good performance for nodes
- Insert:
- Query:
- Removal:
- Count:
- Neighbors:
Edge Time Complexity
This structure has linear complexity across the edges
- Insert edge:
- Query edge:
- Removal edge:
- Count edges:
Trait Implementations§
Source§impl Debug for AdjacencyNodeList
impl Debug for AdjacencyNodeList
Source§impl Default for AdjacencyNodeList
impl Default for AdjacencyNodeList
Source§impl<'a> GraphEngine<'a> for AdjacencyNodeList
impl<'a> GraphEngine<'a> for AdjacencyNodeList
Source§type NeighborIterator = PlaceholderNodeIterator
type NeighborIterator = PlaceholderNodeIterator
According to a given vertex, find all neighbor nodes
Source§type BridgeIterator = PlaceholderEdgeIterator
type BridgeIterator = PlaceholderEdgeIterator
An iterator over the edges.
Source§type NodeTraverser = PlaceholderNodeIterator
type NodeTraverser = PlaceholderNodeIterator
An iterator over the nodes.
Source§type EdgeTraverser = PlaceholderNodeIterator
type EdgeTraverser = PlaceholderNodeIterator
An iterator over the edges.
Source§type BridgeTraverser = PlaceholderEdgeIterator
type BridgeTraverser = PlaceholderEdgeIterator
An iterator over the edges.
Source§fn graph_kind(&self) -> GraphKind
fn graph_kind(&self) -> GraphKind
Check the graph kind, it can be directed or undirected. Read more
Source§fn get_node(&self, node: NodeID) -> Result<NodeID, GraphError>
fn get_node(&self, node: NodeID) -> Result<NodeID, GraphError>
Check if the node exists, return the node id if exists. Read more
Source§fn all_nodes(&self) -> Self::NodeTraverser
fn all_nodes(&self) -> Self::NodeTraverser
Traverse all nodes in the graph. Read more
Source§fn all_neighbors(&'a self, node: NodeID) -> Self::NeighborIterator
fn all_neighbors(&'a self, node: NodeID) -> Self::NeighborIterator
Check if the node exists, return the node id if exists. Read more
Source§fn get_edge(&self, edge: EdgeID) -> Result<EdgeID, GraphError>
fn get_edge(&self, edge: EdgeID) -> Result<EdgeID, GraphError>
Check if the edge exists, return the node id if exists. Read more
Source§fn all_edges(&self) -> Self::EdgeTraverser
fn all_edges(&self) -> Self::EdgeTraverser
Get the edges of the graph. Read more
fn get_bridge(&self, edge: EdgeID) -> Result<IndeterminateEdge, GraphError>
Source§fn get_bridges(&'a self, from: NodeID, goto: NodeID) -> Self::BridgeIterator
fn get_bridges(&'a self, from: NodeID, goto: NodeID) -> Self::BridgeIterator
Give all edges matching the start and end points Read more
Source§fn all_bridges(&self) -> Self::BridgeIterator
fn all_bridges(&self) -> Self::BridgeIterator
Get the edges of the graph. Read more
Source§fn count_nodes(&'a self) -> usize
fn count_nodes(&'a self) -> usize
Count the number of nodes in the graph. Read more
Source§fn get_outgoing(&'a self, node: usize) -> Self::NeighborIterator
fn get_outgoing(&'a self, node: usize) -> Self::NeighborIterator
Find all vertices ending at a given point Read more
Source§fn get_incoming(&'a self, node: usize) -> Self::NeighborIterator
fn get_incoming(&'a self, node: usize) -> Self::NeighborIterator
Check if the node exists, return the node id if exists. Read more
Source§fn count_degree(&'a self, node: usize) -> NodeDegree
fn count_degree(&'a self, node: usize) -> NodeDegree
Check if the node exists, return the node id if exists. Read more
Source§fn count_edges(&'a self) -> usize
fn count_edges(&'a self) -> usize
Count the number of edges in the graph. Read more
Source§impl MutableGraph for AdjacencyNodeList
impl MutableGraph for AdjacencyNodeList
Source§fn insert_node(&mut self, node_id: usize) -> bool
fn insert_node(&mut self, node_id: usize) -> bool
Insert a node without any neighbors (edges). Read more
Source§fn create_node(&mut self) -> usize
fn create_node(&mut self) -> usize
Insert a node without any neighbors (edges). Read more
Source§fn remove_node_with_edges(&mut self, node_id: usize)
fn remove_node_with_edges(&mut self, node_id: usize)
Remove the given node and all edges connected to it. Read more
Source§fn insert_edge_with_nodes<E: Edge>(&mut self, edge: E) -> EdgeInsertID
fn insert_edge_with_nodes<E: Edge>(&mut self, edge: E) -> EdgeInsertID
Insert edge to graph, if the nodes does not exist, also insert them. Read more
Source§fn remove_edge<E>(&mut self, edge: E)
fn remove_edge<E>(&mut self, edge: E)
Remove edge by given edge-id or start and end node-id. Read more
Source§fn remove_node(&mut self, node_id: usize)
fn remove_node(&mut self, node_id: usize)
Remove the given node. Read more
Source§fn insert_edge<E>(&mut self, edge: E) -> EdgeInsertIDwhere
E: Edge,
fn insert_edge<E>(&mut self, edge: E) -> EdgeInsertIDwhere
E: Edge,
Insert a edge between two nodes. Read more
Auto Trait Implementations§
impl Freeze for AdjacencyNodeList
impl RefUnwindSafe for AdjacencyNodeList
impl Send for AdjacencyNodeList
impl Sync for AdjacencyNodeList
impl Unpin for AdjacencyNodeList
impl UnwindSafe for AdjacencyNodeList
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