#include #include #include "algorithm/decremental_scc.h" #include "algorithm/italiano.h" #include "algorithm/frigioni.h" #include "algorithm/tarjan.h" #include using namespace graph; TEST_SUITE("Decremental algorithms") { TEST_CASE("Decremental maintenance of SCCs 1") { std::ifstream infile("resources/dag.txt"); std::uint16_t u, v; Digraph G; while (infile >> u >> v) G.insert(u, v); auto SCCs = algo::Tarjan(G.adjMatrix).execute(); // Testing whether an scc is a 1-vertex scc which after the normalization // has no edges, in this case we know tgat there exist no 2-vertex sccs for (auto& scc : SCCs) { CHECK_EQ(std::all_of(scc.adjMatrix.begin(), scc.adjMatrix.end(), [](const auto& p) { return p.second.size() == 0; }), true); } } }