Add custom equality comparison for SCCs
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user