manuEbg / thm-ptas

This repository is used for our GFSP SS23 Project
MIT License
3 stars 0 forks source link

thm-ptas

This repository is used for our GFSP SS23 Project.

The ptas approximation scheme only works correctly on graphs that are generated via the python script with the circular option.

To find independent sets on other graphs you need to use one of the other schemes ( EXHAUSTIVE or ALL-WITH-TD )

If you are interested in how this algorithm works, please have a look at the wiki or the presentation.

How to use?

View available falgs with:

cargo run -- --help

To execute the Program with a given example graph using the PTAS scheme with an approximation of k=2:

cargo run -- ptas --k 2 data/exp.graph 

To execute the Program with a given example graph using the exhaustive scheme:

cargo run -- exhaustive data/exp.graph 

The input data

The input of this program is the planar embedding of a (planar) undirected graph.

The embedding should be provided as a text-file and follow this specification:

<Number of vertices>
<Number of edges>
<Source vertex> <Target vertex>
<Source vertex> <Target vertex>
<Source vertex> <Target vertex>
...

It is important, that the embedding contains both directions for each arc of the graph. Also the arcs have to be in counterclockwise order for each source vertex.

If you want more information about this format or more graphs, you can find both here.

Generating Input Data

To generate random planar graphs and their embedding, you can use the python script located in this repository. For example:

 python3 ./generate.py --nodes 25 --rings 2 --nprob 0.8 --eprob 0.7 data/exp.graph --type random

Web Visualizer

It is possible to use the Rust MIS solver and Generator script in tandem through a nice web interface.

screenshot

Installation

Running

Run the server.py program in the web folder.

Functions