diff --git a/algorithm/decremental_tc.h b/algorithm/decremental_tc.h deleted file mode 100644 index 8de4906..0000000 --- a/algorithm/decremental_tc.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef DECREMENTAL_TC_H_ -#define DECREMENTAL_TC_H_ - -#include "algorithm/roditty_zwick.h" -#include "algorithm/tarjan.h" -#include "algorithm/breadth_first_search.h" -#include "tree/breadth_first_tree.h" - -#include - -using namespace graph; - -namespace algo { - -template -class DecrementalTC : public RodittyZwick { -public: - DecrementalTC(Digraph G) : G(G) {} - - void init(); - - bool query(const T& u, const T& v); - - void remove(const T& u, const T& v); -private: - Digraph G; - - // Every vertex u has a pointer C(u) to the component containing it - std::map> C; - - // The aggregation of edges each component contains - struct LLE { - std::forward_list Ein; - std::forward_list Eout; - std::forward_list Eint; - }; - - std::map, LLE> E; - - // Connect each component with a tree of all reachable components - std::map, std::set>> TC; -}; - - -template -void DecrementalTC::init() { - -} - -template -bool DecrementalTC::query(const T& u, const T& v) { - - return false; -} - -template -void DecrementalTC::remove(const T& u, const T& v) { - -} - -} // namespace algo - -#endif \ No newline at end of file diff --git a/algorithm/frigioni.h b/algorithm/frigioni.h new file mode 100644 index 0000000..ac4aceb --- /dev/null +++ b/algorithm/frigioni.h @@ -0,0 +1,61 @@ +#ifndef FRIGIONI_H_ +#define FRIGIONI_H_ + +#include "algorithm/roditty_zwick.h" +#include "algorithm/tarjan.h" +#include "tree/breadth_first_tree.h" + +#include + +using namespace graph; +using namespace tree; + +namespace algo { + +template +class Frigioni : public RodittyZwick { +public: + Frigioni(Digraph G) : G(G) {} + + void init(); + + bool query(const T& u, const T& v); + + void remove(const T& u, const T& v); +private: + Digraph G; + + // Connect each vertex with its representative SCC + std::map> TC; + + // Reachability trees + std::map, std::set>> RT; + + // Incoming / Outgoing / Internal edges + struct Edges { + std::forward_list Ein; + std::forward_list Eout; + std::forward_list Eint; + }; + std::map, Edges> E; +}; + + +template +void Frigioni::init() { + +} + +template +bool Frigioni::query(const T& u, const T& v) { + return TC[u] == TC[v]; +} + +template +void Frigioni::remove(const T& u, const T& v) { + +} + +} // namespace algo + +#endif \ No newline at end of file diff --git a/algorithm/italiano.h b/algorithm/italiano.h new file mode 100644 index 0000000..89fa9d8 --- /dev/null +++ b/algorithm/italiano.h @@ -0,0 +1,60 @@ +#ifndef ITALIANO_H_ +#define ITALIANO_H_ + +#include "algorithm/roditty_zwick.h" +#include "algorithm/tarjan.h" +#include "tree/breadth_first_tree.h" + +#include + +using namespace graph; +using namespace tree; + +namespace algo { + +template +class Italiano : public RodittyZwick { +public: + Italiano(Digraph G) : G(G) {} + + void init(); + + bool query(const T& u, const T& v); + + void remove(const T& u, const T& v); +private: + Digraph G; + + // Connect each vertex with its representative SCC + std::map> TC; + + // Reachability trees + std::map> RT; + + // Incoming / Outgoing edges + struct Edges { + std::forward_list Ein; + std::forward_list Eout; + }; + std::map, Edges> E; +}; + + +template +void Italiano::init() { + +} + +template +bool Italiano::query(const T& u, const T& v) { + return TC[u] == TC[v]; +} + +template +void Italiano::remove(const T& u, const T& v) { + +} + +} // namespace algo + +#endif \ No newline at end of file