Add custom equality comparison for SCCs

This commit is contained in:
stefiosif
2022-08-08 22:18:52 +03:00
parent 5f5bd889d7
commit dd71ab75b6

View File

@@ -17,12 +17,19 @@ public:
//
T representative() { return proxy; };
bool operator==(const SCC& o) const;
private:
// Each SCC has a representative vertex that helps
// answer strong connectivity queries in O(1) time
T proxy;
};
template<typename T>
bool SCC<T>::operator==(const SCC& o) const{
return proxy == o.proxy;
}
}; // namespace graph
#endif