From 80f8a00a24bb226e0d642985ba7d4277c2dc7822 Mon Sep 17 00:00:00 2001 From: stefiosif Date: Fri, 10 Feb 2023 18:28:09 +0200 Subject: [PATCH] Only update the reachability tree of the vertex that is the center of insertions --- include/algorithm/king.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/algorithm/king.h b/include/algorithm/king.h index 8681253..3ffd863 100644 --- a/include/algorithm/king.h +++ b/include/algorithm/king.h @@ -71,9 +71,13 @@ void King::remove(const T& u, const T& v) { template void King::insert(const T& c, const std::vector& vertices) { - for (const auto& v : vertices) + for (const auto& v : vertices) { this->G.insert(c, v); - init(); + } + In[c] = Italiano(BreadthFirstTree(this->G.reverse(), c)); + In[c].init(); + Out[c] = Italiano(BreadthFirstTree(this->G, c)); + Out[c].init(); } } // namespace algo