Crate bigs[][src]

Expand description

BIpartite Graph Sampler.

A tool to generate regular bipartite graphs. A bipartite graph is a set of variables and constraints (named like this because of SAT problems) together with a set of edges. Right now, only regular graphs can be sampled. That is, graphs with the same degree for all variables and the same for all constraints.

Quick start

Graphs are sampled using a Sampler which are instanciated via the builder method. Then, any random number generator can be used to sample a Graph.

use bigs::Sampler;
use rand::thread_rng;

let sampler = Sampler::builder()
    .build() // Returns an error if the parameters are invalid.

let graph = sampler.sample_with(&mut thread_rng());
let other_graph = sampler.sample_with(&mut thread_rng());


pub use graph::Edge;
pub use graph::Graph;


An helper to build sampler.

Everything related to graphs: edges, nodes and, of course, graphs.


A sampler for regular bipartite graph.