From a1f955ebb97df7993396f68d59c75cb60a0b2fde Mon Sep 17 00:00:00 2001 From: stefiosif Date: Thu, 29 Sep 2022 23:47:36 +0300 Subject: [PATCH] Refactor: Split remove into remove/repairTrees --- algorithm/italiano.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/algorithm/italiano.h b/algorithm/italiano.h index acb0852..1bfa2cc 100644 --- a/algorithm/italiano.h +++ b/algorithm/italiano.h @@ -39,6 +39,9 @@ private: std::set out; }; std::map E; + + // Repair reachability trees after edge deletions + void repairTrees(std::map>& H); }; template @@ -82,6 +85,11 @@ void Italiano::remove(const T& u, const T& v) { E[v].inc.erase(u); this->G.remove(u, v); + repairTrees(H); +} + +template +void Italiano::repairTrees(std::map>& H) { for (const auto& z : this->G.vertices()) { while (H[z].size() > 0) { const auto& h = H[z].top();