Struct matrixgraph::SimpleGraph
[−]
[src]
pub struct SimpleGraph { // some fields omitted }
A simple graph represented by the upper right triangle of an adjacency matrix of fixed size
The cells of the adjacency matrix are assigned values of type Option
Methods
impl SimpleGraph
fn new(size: usize) -> SimpleGraph
Creates a new simple graph object with a fixed size.
fn from_vec(weights: &Vec<Option<f64>>) -> SimpleGraph
Creates a new simple graph object with a fixed size from a vector that is the row-wise representation of the upper right triangle of an adjacency matrix.
Note: A zero-sized vector creates a graph with a single vertex.
fn to_vec(&self) -> Vec<Option<f64>>
Returns the vector that is the row-wise representation of the upper right triangle of the adjacency matrix of the simple graph.
fn to_digraph_vec(&self) -> Vec<Option<f64>>
Returns the vector that is the row-wise representation of the full adjacency matrix of the simple graph.