Skip to content
Snippets Groups Projects
Commit 1cd59c98 authored by Florian Heinrichs's avatar Florian Heinrichs
Browse files

testint bnb on first graph

parent 9ee6099d
Branches
No related merge requests found
#include <catch2/catch.hpp>
#include <gp-bnb/graph.hpp>
//#include <gp-bnb/MetisReader.hpp>
#include <gp-bnb/metis_reader.hpp>
#include <gp-bnb/bnb.hpp>
// Tests for Branch&Bound algorithm
TEST_CASE("BnbTest") {
//test partitioning of tiny graph
std::string graph = "../test/inputs/tiny_01.graph";
auto g = metis_reader().read(graph);
auto sol = gp_bnb::solver(g);
sol.solve();
std::vector<partition::subgraph> f= sol.best_solution();
REQUIRE(f[0] == -1);
REQUIRE(f[1] == -1);
REQUIRE(f[2] == -1);
REQUIRE(f[3] == 1);
REQUIRE(f[4] == -1);
REQUIRE(f[5] == 1);
REQUIRE(f[6] == 1);
std::vector<std::vector<unsigned int>> a;
a ={
{5, 2, 3},
{1, 3, 4},
{5, 4, 2, 1},
{2, 3, 6, 7},
{1, 3, 6},
{5, 4, 7},
{6, 4},
};
}
\ 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