Update decremental algorithms according to project structure changes
This commit is contained in:
@@ -50,17 +50,15 @@ void Digraph<T>::insert(const T& u, const T& v) {
|
||||
template<typename T>
|
||||
void Digraph<T>::remove(const T& u, const T& v) {
|
||||
this->adjMatrix[u].erase(v);
|
||||
//if (this->adjMatrix[u].size() == 0)
|
||||
// this->adjMatrix.erase(u);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
auto Digraph<T>::reverse() {
|
||||
std::map<T, std::set<T>> revMatrix;
|
||||
|
||||
for (const auto& u : this->adjMatrix) {
|
||||
for (const auto& v : u.second) {
|
||||
revMatrix[v].insert(u.first);
|
||||
for (const auto& u : vertices()) {
|
||||
for (const auto& v : this->adjMatrix[u]) {
|
||||
revMatrix[v].insert(u);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user