Crates.io | snark-tool |
lib.rs | snark-tool |
version | 0.4.0 |
source | src |
created_at | 2021-10-26 19:42:33.553204 |
updated_at | 2021-10-26 19:42:33.553204 |
description | snark-tool library contains structures and algorithm for (mainly) cubic graph analysis |
homepage | https://github.com/jkbstrmen/snark-tool |
repository | https://github.com/jkbstrmen/snark-tool |
max_upload_size | |
id | 472066 |
size | 2,615,165 |
Snark tool is simple tool for snarks analysis. Snark is cubic graph with girth at least 5 and cyclic edge connectivity at least 4.
Include snark-tool in your Cargo project by adding as a dependency to your Cargo.toml configuration file.
[dependencies]
...
snark-tool = "0.4.0"
Then simply use needed structs or functions in your code.
use crate::graph::undirected::simple_graph::graph::SimpleGraph;
use crate::service::io::reader_g6::G6Reader;
pub fn read_graph(graph_g6: &String) {
let graph: SimpleGraph = G6Reader::read_graph(graph_g6).unwrap();
}
For more examples see examples folder.
At first install cargo. Then install snark-tool.
cargo install snark-tool
To run snark-tool at first we have to define configuration file in YAML format. Here we can specify what we want to do.
version: 0.1
procedures:
- proc-type: read
config:
file: input-file.g6
graph-format: g6
# means regular 3-edge coloring
- proc-type: colour
config:
colouriser-type: dfs
- proc-type: write
config:
file: output.json
graph-format: s6
# if set to true, file format will be json for g6/s6 graph format
with-properties: true # default true
- proc-type: count
Basic usage is that snark-tool takes input file, read graphs from specified format. Then applies/perform specified procedures (in this case edge colouring) over graphs and at the end writes graphs to output file.
When we have specified configuration file with name snark-tool.yml we can start snark-tool using terminal command:
snark-tool run snark-tool.yml
For full description of available procedures and its configuration see procedures.md.
Licensed under either of
at your option.
Package and all its parts are WIP. Package's API can change rapidly from version to version.