pub struct DiGraph {
pub bit_vec: Vec<usize>,
pub n: usize,
}Expand description
Creates a directed graph from a graph6 representation
Fields§
§bit_vec: Vec<usize>§n: usizeImplementations§
source§impl DiGraph
impl DiGraph
sourcepub fn from_d6(repr: &str) -> Result<Self, IOError>
pub fn from_d6(repr: &str) -> Result<Self, IOError>
Creates a new DiGraph from a graph6 representation string
Arguments
repr- A graph6 representation string
Errors
Returns an error if the graph6 representation is invalid (i.e. missing digraph header ‘&’)
Examples
use graph6_rs::DiGraph;
let graph = DiGraph::from_d6("&AG").unwrap();
assert_eq!(graph.n, 2);
assert_eq!(graph.bit_vec, &[0, 0, 1, 0]);