From dd71ab75b6857b6652598acf4ddb2c41846998ee Mon Sep 17 00:00:00 2001 From: stefiosif Date: Mon, 8 Aug 2022 22:18:52 +0300 Subject: [PATCH] Add custom equality comparison for SCCs --- graph/scc.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/graph/scc.h b/graph/scc.h index e2b835b..83760e9 100644 --- a/graph/scc.h +++ b/graph/scc.h @@ -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 +bool SCC::operator==(const SCC& o) const{ + return proxy == o.proxy; +} + }; // namespace graph #endif \ No newline at end of file