Check if edge to be removed is part of the graph

This commit is contained in:
stefiosif
2022-09-26 12:33:13 +03:00
parent cbaf50d401
commit f4acf57c88

View File

@@ -63,9 +63,9 @@ bool Italiano<T>::query(const T& u, const T& v) {
template<typename T> template<typename T>
void Italiano<T>::remove(const T& u, const T& v) { void Italiano<T>::remove(const T& u, const T& v) {
//TRYCATCH if (!this->G.adjMatrix[u].contains(v)) return; if (!this->G.adjMatrix[u].contains(v)) return;
std::map<T, std::stack<T>> H;
std::map<T, std::stack<T>> H;
for (const auto& w : this->G.vertices()) { for (const auto& w : this->G.vertices()) {
if (RT[w].contains(u, v)) { if (RT[w].contains(u, v)) {
if (E[v].inc.size() > 1) if (E[v].inc.size() > 1)