Skip to main content

GraphCore

Struct GraphCore 

Source
pub struct GraphCore { /* private fields */ }

Implementations§

Source§

impl GraphCore

Source

pub fn new(directed: bool) -> Self

Source

pub fn directed(&self) -> bool

Source

pub fn add_node(&mut self, node: &str)

Source

pub fn has_node(&self, node: &str) -> bool

Source

pub fn add_edge(&mut self, left: &str, right: &str)

Source

pub fn add_nodes(&mut self, nodes: Vec<String>)

Source

pub fn add_edges(&mut self, edges: Vec<(String, String)>)

Source

pub fn has_edge(&self, left: &str, right: &str) -> bool

Source

pub fn remove_edge(&mut self, left: &str, right: &str)

Source

pub fn remove_edges(&mut self, edges: Vec<(String, String)>)

Source

pub fn remove_node(&mut self, node: &str)

Source

pub fn remove_nodes(&mut self, nodes: Vec<String>)

Source

pub fn nodes(&self) -> Vec<String>

Source

pub fn edges(&self) -> Vec<(String, String)>

Source

pub fn neighbors(&self, node: &str) -> Vec<String>

Source

pub fn predecessors(&self, node: &str) -> Vec<String>

Source

pub fn successors(&self, node: &str) -> Vec<String>

Source

pub fn all_neighbors(&self, node: &str) -> Vec<String>

Source

pub fn in_degree(&self, node: &str) -> usize

Source

pub fn out_degree(&self, node: &str) -> usize

Source

pub fn clone_graph(&self) -> Self

Source

pub fn induced_subgraph(&self, nodes: Vec<String>) -> Self

Source

pub fn to_undirected_graph(&self) -> Self

Source

pub fn connected_components(&self) -> Vec<Vec<String>>

Source

pub fn is_weakly_connected(&self) -> bool

Source

pub fn topological_sort(&self) -> Result<Vec<String>, String>

Source

pub fn shortest_path(&self, source: &str, target: &str) -> Option<Vec<String>>

Source

pub fn shortest_path_length(&self, source: &str, target: &str) -> Option<usize>

Source

pub fn ego_graph_nodes(&self, center: &str, radius: usize) -> Vec<String>

Source

pub fn multi_source_dijkstra_path( &self, sources: Vec<String>, weights: Vec<(String, String, f64)>, ) -> Result<Vec<(String, Vec<String>)>, String>

Source

pub fn steiner_tree_nodes( &self, terminals: Vec<String>, weights: Vec<(String, String, f64)>, ) -> Result<Vec<String>, String>

Trait Implementations§

Source§

impl Clone for GraphCore

Source§

fn clone(&self) -> GraphCore

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for GraphCore

Source§

fn default() -> GraphCore

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.