pub struct Graph {
pub n_nodes: usize,
pub edges: Vec<(usize, usize, String)>,
pub node_labels: Vec<String>,
}Expand description
Simple graph representation for kernel computation
Fields§
§n_nodes: usizeNumber of nodes
edges: Vec<(usize, usize, String)>Edge list (from, to, edge_type)
node_labels: Vec<String>Node labels
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn set_node_label(&mut self, node: usize, label: String)
pub fn set_node_label(&mut self, node: usize, label: String)
Set node label
Sourcepub fn adjacency_list(&self) -> Vec<Vec<usize>>
pub fn adjacency_list(&self) -> Vec<Vec<usize>>
Get adjacency list representation
Sourcepub fn from_tlexpr(expr: &TLExpr) -> Self
pub fn from_tlexpr(expr: &TLExpr) -> Self
Convert TLExpr to graph representation
Trait Implementations§
impl Eq for Graph
impl StructuralPartialEq for Graph
Auto Trait Implementations§
impl Freeze for Graph
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnwindSafe for Graph
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more