Solutions for graph algorithm tasks.
task1.1- graph implementation and RPO numbering with cycle detection.task1.2- Dijkstra's shortest path algorithm.task1.3- maximum flow using Dinic's algorithm.task1.4- Tarjan's algorithm for strongly connected components.
The shared graph implementation is placed in common.
cmake -S . -B build
cmake --build buildAfter the build, executables are available in the build directory:
build/task1_1
build/task1_2
build/task1_3
build/task1_4
Example:
./build/task1_2 < tests/task1.2/01.inTests are stored in the tests directory as .in / .out pairs.
Run all tests:
python3 tests/tasks_tester.py- C++23
- CMake 3.20+
g++or a compatible compilerpython3for running tests