Crates.io | g6 |
lib.rs | g6 |
version | 0.1.1 |
source | src |
created_at | 2023-05-14 16:19:03.466646 |
updated_at | 2023-05-16 10:17:56.439346 |
description | import/export graph6 format |
homepage | |
repository | https://github.com/ygg-lang/pex-g6 |
max_upload_size | |
id | 864358 |
size | 15,600 |
Pure rust parser for graph6, digraph6 formats.
use g6::Graph6;
use std::str::FromStr;
#[test]
fn import_graph6() {
let graph = Graph6::from_str("E?Bw").unwrap();
assert_eq!(graph.nodes(), 5);
assert_eq!(graph.edges(), 6);
}
use g6::DiGraph6;
use std::str::FromStr;
#[test]
fn import_digraph6() {
let digraph = DiGraph6::from_str("&B|o").unwrap();
assert_eq!(digraph.nodes(), 3);
assert_eq!(digraph.edges(), 7);
}
use g6::Sparse6;
use std::str::FromStr;
#[test]
fn import_sparse6() {
let digraph = Sparse6::from_str(":Fa@x^").unwrap();
assert_eq!(digraph.nodes(), 7);
assert_eq!(digraph.edges(), 4);
}
todo
todo