Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ray-chew/steiner_solver
A Steiner graph solver using: binary heap, adjacency list, Dijkstra’s algorithm, OpenMP parallelisation, Takahashi and Matsuyama's heuristics, with tools for solution verification and validation
https://github.com/ray-chew/steiner_solver
adjacency-lists binary-heap cpp dijkstra-algorithm openmp optimization-algorithms steiner-tree-problem
Last synced: about 1 month ago
JSON representation
A Steiner graph solver using: binary heap, adjacency list, Dijkstra’s algorithm, OpenMP parallelisation, Takahashi and Matsuyama's heuristics, with tools for solution verification and validation
- Host: GitHub
- URL: https://github.com/ray-chew/steiner_solver
- Owner: ray-chew
- License: apache-2.0
- Created: 2024-03-19T11:28:16.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-03-19T15:00:52.000Z (9 months ago)
- Last Synced: 2024-03-20T14:34:09.188Z (9 months ago)
- Topics: adjacency-lists, binary-heap, cpp, dijkstra-algorithm, openmp, optimization-algorithms, steiner-tree-problem
- Language: C++
- Homepage:
- Size: 193 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Steiner graph solver
I completed this project as part of the *Advanced Practical Programming for Scientists* module at the Technische Universität Berlin.
This project uses an improved Steiner graph heuristics proposed by [Takahashi and Matsuyama (1980)](https://www.cs.haifa.ac.il/~golumbic/courses/seminar-2010approx/takahashi80.PDF). Parallelisation is also implemented. The Steiner graph problem for graphs of size ~2.0gb can be solved in under 30s.
Specifically, the code computes the best Steiner Tree for a given number of starting terminals (default is 100) and a given graph file.
* **Compile**: `make THREADS=XX`, where `THREADS=XX` specifies the number of threads to be used in the parallel section of the code.
* **Compile and run**: `make THREADS=XX FILE=YY test`, where `FILE=YY` is the graph file to execute right after the target is compiled.
* **Run**: `./steiner_solver [# of terminals] [-s]`. `[# of terminals]` is the number of starting terminals to check through to obtain a best objective value. Include the `[-s]` flag to print the edges of the Steiner subgraph.***
* `make check` runs the cppcheck static analysis check.
* `make coverage` runs gcov coverage test with lcov results output in folder result/.
* `make doc` compiles doxygen documentation in folder html/.
* `make cleancoverage` cleans all files related to coverage test, except the results folder.
* `make clean` cleans all files created by the Makefile, including the coverage-test related files.***
**To compile without Makefile**:
1. Compile utils.cxx: `g++ -std=c++14 -O3 -march=native -pedantic -Wall -c src/utils.cxx -o utils.o -lboost_timer -lboost_program_options -lboost_system -fopenmp`
2. Compile heap.cxx: `g++ -std=c++14 -O3 -march=native -pedantic -Wall -c src/heap.cxx -o heap.o -lboost_timer -lboost_program_options -lboost_system -fopenmp`
3. Compile steiner.cxx: `g++ -std=c++14 -O3 -march=native -pedantic -Wall -c src/steiner.cxx -o steiner.o -lboost_timer -lboost_program_options -lboost_system -fopenmp`
4. Compile checker.cxx: `g++ -std=c++14 -O3 -march=native -pedantic -Wall -c src/checker.cxx -o checker.o -lboost_timer -lboost_program_options -lboost_system -fopenmp`
5. Link and output: `g++ -std=c++14 -O3 -march=native -pedantic -Wall src/utils.o src/heap.o src/steiner.o src/checker.o src/steiner_solver.cxx -o steiner_solver -lboost_timer -lboost_program_options -lboost_system [-fopenmp]`. Include `-fopenmp` to enable parallelization.