GraphConversion

Trait GraphConversion 

Source
pub trait GraphConversion {
    // Required methods
    fn bit_vec(&self) -> &[usize];
    fn size(&self) -> usize;
    fn is_directed(&self) -> bool;

    // Provided methods
    fn to_dot(&self, id: Option<usize>) -> String { ... }
    fn to_undirected_dot(&self, dot: &mut String, bit_vec: &[usize], n: usize) { ... }
    fn to_directed_dot(&self, dot: &mut String, bit_vec: &[usize], n: usize) { ... }
    fn to_adjmat(&self) -> String { ... }
    fn to_flat(&self) -> String { ... }
    fn to_net(&self) -> String { ... }
}
Expand description

Conversion trait for graphs into various text graph formats

Required Methods§

Source

fn bit_vec(&self) -> &[usize]

Returns the bitvector representation of the graph

Source

fn size(&self) -> usize

Returns the number of vertices in the graph

Source

fn is_directed(&self) -> bool

Returns true if the graph is directed

Provided Methods§

Source

fn to_dot(&self, id: Option<usize>) -> String

Returns the graph in the DOT format

Source

fn to_undirected_dot(&self, dot: &mut String, bit_vec: &[usize], n: usize)

Source

fn to_directed_dot(&self, dot: &mut String, bit_vec: &[usize], n: usize)

Source

fn to_adjmat(&self) -> String

Returns the graph as an adjacency matrix

Source

fn to_flat(&self) -> String

Returns the graph in a flat adjacency matrix

Source

fn to_net(&self) -> String

Returns the graph in the Pajek NET format

Implementors§