pub struct GraphCore { /* private fields */ }Implementations§
Source§impl GraphCore
impl GraphCore
pub fn new(directed: bool) -> Self
pub fn directed(&self) -> bool
pub fn add_node(&mut self, node: &str)
pub fn has_node(&self, node: &str) -> bool
pub fn add_edge(&mut self, left: &str, right: &str)
pub fn add_nodes(&mut self, nodes: Vec<String>)
pub fn add_edges(&mut self, edges: Vec<(String, String)>)
pub fn has_edge(&self, left: &str, right: &str) -> bool
pub fn remove_edge(&mut self, left: &str, right: &str)
pub fn remove_edges(&mut self, edges: Vec<(String, String)>)
pub fn remove_node(&mut self, node: &str)
pub fn remove_nodes(&mut self, nodes: Vec<String>)
pub fn nodes(&self) -> Vec<String>
pub fn edges(&self) -> Vec<(String, String)>
pub fn neighbors(&self, node: &str) -> Vec<String>
pub fn predecessors(&self, node: &str) -> Vec<String>
pub fn successors(&self, node: &str) -> Vec<String>
pub fn all_neighbors(&self, node: &str) -> Vec<String>
pub fn in_degree(&self, node: &str) -> usize
pub fn out_degree(&self, node: &str) -> usize
pub fn clone_graph(&self) -> Self
pub fn induced_subgraph(&self, nodes: Vec<String>) -> Self
pub fn to_undirected_graph(&self) -> Self
pub fn connected_components(&self) -> Vec<Vec<String>>
pub fn is_weakly_connected(&self) -> bool
pub fn topological_sort(&self) -> Result<Vec<String>, String>
pub fn shortest_path(&self, source: &str, target: &str) -> Option<Vec<String>>
pub fn shortest_path_length(&self, source: &str, target: &str) -> Option<usize>
pub fn ego_graph_nodes(&self, center: &str, radius: usize) -> Vec<String>
pub fn multi_source_dijkstra_path( &self, sources: Vec<String>, weights: Vec<(String, String, f64)>, ) -> Result<Vec<(String, Vec<String>)>, String>
pub fn steiner_tree_nodes( &self, terminals: Vec<String>, weights: Vec<(String, String, f64)>, ) -> Result<Vec<String>, String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphCore
impl RefUnwindSafe for GraphCore
impl Send for GraphCore
impl Sync for GraphCore
impl Unpin for GraphCore
impl UnsafeUnpin for GraphCore
impl UnwindSafe for GraphCore
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