From 1cd59c987983a5250f371275992e765f01bd1d30 Mon Sep 17 00:00:00 2001
From: Florian <florian.heinrichs@informatik.hu-berlin.de>
Date: Tue, 30 Apr 2019 11:55:25 +0200
Subject: [PATCH] testint bnb on first graph

---
 test/bnb_test.cpp | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/test/bnb_test.cpp b/test/bnb_test.cpp
index 3d0c72e..8347929 100644
--- a/test/bnb_test.cpp
+++ b/test/bnb_test.cpp
@@ -1,10 +1,41 @@
 #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
-- 
GitLab