Skip to content

IgorPietrzak/DominatingGraphs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Given a graph find the minimal dominating vertex set.

Table of Contents

Introduction

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

Demo

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

Installation

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.git

2.) cd into the directory

cd DominatingGraphs

3.) Make the main.rs file

touch main.rs

Write code using the library crate, see Usage.

4.) Run the program

cargo run

Usage

Use 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");
}

About

Compute the domination number (minimal dominating set of vertices) of an undirected graph.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages