diff --git a/include/algorithm/roditty_zwick.h b/include/algorithm/roditty_zwick.h index e6f1b67..fb00aef 100644 --- a/include/algorithm/roditty_zwick.h +++ b/include/algorithm/roditty_zwick.h @@ -18,7 +18,7 @@ public: void init() override; // - void findSCC(); + void findSCC(graph::Digraph G); // Return true if u and v are in the same SCC bool query(const T& u, const T& v) override; @@ -44,12 +44,12 @@ private: template void RodittyZwick::init() { - findSCC(); + findSCC(this->G); } template -void RodittyZwick::findSCC() { - auto SCCs = Tarjan(this->G.adjList).execute(); +void RodittyZwick::findSCC(graph::Digraph G) { + auto SCCs = Tarjan(G.adjList).execute(); for (auto& SCC : SCCs) { const auto& w = SCC.id; @@ -95,7 +95,7 @@ void RodittyZwick::remove(const T& u, const T& v) { // If a SCC is broken, compute all SCCs again if (!In[w].adjList.count(u) || !Out[w].adjList.count(v)) - findSCC(); + findSCC(C[w]); } }; // namespace algo