#ifndef RODITTY_ZWICK_H_ #define RODITTY_ZWICK_H_ #include "graph/digraph.h" #include "graph/scc.h" #include "algorithm/tarjan.h" #include "algorithm/bfs.h" #include using namespace graph; namespace algo { // A randomized decremental algorithm for maintaining SCCs template class RodittyZwick { public: RodittyZwick(Digraph G) : G(G) {} // void sccDecrementalMaintenance(); // void tcDecrementalMaintenance(); private: Digraph G; }; template void RodittyZwick::sccDecrementalMaintenance() { std::map A; Tarjan tarjan(G); auto sccs = tarjan.run(); for (auto& scc : sccs) { const auto& root = scc.representative(); BFS bfs(scc); auto spt = bfs.run(root); for (const auto& vertex : scc.vertices) { A[vertex] = root; } } } template void RodittyZwick::tcDecrementalMaintenance() { } }; // namespace algo #endif