Only update the reachability tree of the vertex that is the center of insertions

This commit is contained in:
stefiosif
2023-02-10 18:28:09 +02:00
parent 3591c58f6d
commit 80f8a00a24

View File

@@ -71,9 +71,13 @@ void King<T>::remove(const T& u, const T& v) {
template<typename T> template<typename T>
void King<T>::insert(const T& c, const std::vector<T>& vertices) { void King<T>::insert(const T& c, const std::vector<T>& vertices) {
for (const auto& v : vertices) for (const auto& v : vertices) {
this->G.insert(c, v); this->G.insert(c, v);
init(); }
In[c] = Italiano<T>(BreadthFirstTree<T>(this->G.reverse(), c));
In[c].init();
Out[c] = Italiano<T>(BreadthFirstTree<T>(this->G, c));
Out[c].init();
} }
} // namespace algo } // namespace algo