Only update the reachability tree of the vertex that is the center of insertions
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user