Code to compute the minimal dominating vertex set for an undirected graph. Sometimes also called domination number, see: https://en.wikipedia.org/wiki/Dominating_set
A demo showing how to use the cli tool to compute a minimal dominating vertex set for the graph drawn on the right hand side
demo.MOV
Follow official instructions to install the Rust toolchain:
https://www.rust-lang.org/tools/install
Once Rust is installed, do the following:
[Note: These are unix commands you need to find the analogs for windows]
1.) Clone the repository
git clone https://github.com/IgorPietrzak/DominatingGraphs.git2.) cd into the directory
cd DominatingGraphs3.) Make the main.rs file
touch main.rs
Write code using the library crate, see Usage.
4.) Run the program
cargo runUse of the library shown in demo
// main.rs
extern crate dominating_graphs;
use dominating_graphs::graph_builder_cli;
fn main() {
let graph = graph_builder_cli::program_loop();
let min_vertex_set = graph.get_dominating_vertex_set().unwrap();
println!("\n ------------------------------------------------------------------------------");
println!("Your graph is: {:?}", graph);
println!(" ------------------------------------------------------------------------------");
println!("\n ------------------------------------------------------------------------------");
println!("A minimal dominating vertex set is: {:?}", min_vertex_set);
println!(" ------------------------------------------------------------------------------ \n");
}