diff --git a/test/edmonds_karp_test.cpp b/test/edmonds_karp_test.cpp index fc864418422a1b3ab693584b97dc6f4c3c448775..fb1b3debdee98bdcb616468977b490fb1b8279b3 100644 --- a/test/edmonds_karp_test.cpp +++ b/test/edmonds_karp_test.cpp @@ -1,9 +1,22 @@ #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