Refactor: Change reachability interfaces to handle multiple removals/insertions

This commit is contained in:
stefiosif
2022-10-15 10:40:08 +03:00
parent 04ab33888e
commit e7fd88f82c
8 changed files with 41 additions and 37 deletions

View File

@@ -24,11 +24,8 @@ public:
// in O(1) using the transitive closure matrix
bool query(const T& u, const T& v) override;
// Delete edge e(u, v)
void remove(const T& u, const T& v) override;
// Delete set of edges and explicitely maintain the transitive closure
void remove(const std::vector<std::pair<T, T>>& edges);
void remove(const std::vector<std::pair<T, T>>& edges) override;
private:
// Transitive closure matrix, used to answer reachability queries in O(1)
std::unordered_map<T, std::unordered_map<T, bool>> TC;
@@ -84,11 +81,6 @@ bool Frigioni<T>::query(const T& u, const T& v) {
return TC[u][v];
}
template<typename T>
void Frigioni<T>::remove(const T& u, const T& v) {
}
template<typename T>
void Frigioni<T>::remove(const std::vector<std::pair<T, T>>& edges) {
std::vector<std::pair<T, T>> Eint;