Split graph folder into graph and tree
This commit is contained in:
@@ -55,7 +55,7 @@ void DecrementalSCC<T>::findSCC() {
|
||||
const auto& w = C.representative();
|
||||
|
||||
// Create shortest-paths out-tree/in-tree
|
||||
auto outTree = BFS<T>(C).run(w);
|
||||
auto outTree = Digraph<T>(BFS<T>(C).run(w));
|
||||
SPT[w] = std::make_pair(outTree, outTree.reverse());
|
||||
|
||||
// Update A with current SCCs vertices
|
||||
@@ -89,13 +89,13 @@ void DecrementalSCC<T>::remove(const T& u, const T& v) {
|
||||
// Update In(w) and Out(w)
|
||||
connection[w].adjMatrix[u].erase(v);
|
||||
G.adjMatrix[u].erase(v);
|
||||
auto inTree = BFS<T>(connection[w]).run(w);
|
||||
auto inTree = Digraph<T>(BFS<T>(connection[w]).run(w));
|
||||
SPT[w] = std::make_pair(inTree, inTree.reverse());
|
||||
|
||||
// If a SCC is broken, compute all SCCs again
|
||||
if (!SPT[w].second.vertices.contains(u) ||
|
||||
!SPT[w].first.vertices.contains(v)) {
|
||||
auto SCCs = Tarjan<T>(G).findSCC();
|
||||
findSCC();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user