Skip to content
Snippets Groups Projects
Commit 9ea2fb22 authored by Lukas Garbas's avatar Lukas Garbas
Browse files

One test case for max-flow algorithm

parent d02343a8
Branches
No related merge requests found
#include <catch2/catch.hpp>
#include <gp-bnb/edmonds_karp.hpp>
#include <gp-bnb/graph.hpp>
#include <gp-bnb/metis_reader.hpp>
// Tests for Edmonds-Karp Max Flow algorithm
TEST_CASE("EdmondsKarpMaxFlow") {
std::string graph_file = "../test/inputs/tiny_01.graph";
graph g = metis_reader().read(graph_file);
node_id source = 1;
node_id sink = 7;
edmonds_karp ek = edmonds_karp(g, source, sink);
ek.run();
int max_flow = ek.get_max_flow();
REQUIRE(max_flow == 2);
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment