Files
reachability-algorithms/algorithm/frigioni.h

61 lines
1.0 KiB
C++

#ifndef FRIGIONI_H_
#define FRIGIONI_H_
#include "algorithm/roditty_zwick.h"
#include "algorithm/tarjan.h"
#include "tree/breadth_first_tree.h"
#include <forward_list>
using namespace graph;
using namespace tree;
namespace algo {
template<typename T>
class Frigioni : public RodittyZwick<T> {
public:
Frigioni(Digraph<T> G) : G(G) {}
void init();
bool query(const T& u, const T& v);
void remove(const T& u, const T& v);
private:
Digraph<T> G;
// Connect each vertex with its representative SCC
std::map<T, SCC<T>> TC;
// Reachability trees
std::map<SCC<T>, std::set<SCC<T>>> RT;
// Incoming / Outgoing / Internal edges
struct Edges {
std::forward_list<T> Ein;
std::forward_list<T> Eout;
std::forward_list<T> Eint;
};
std::map<SCC<T>, Edges> E;
};
template<typename T>
void Frigioni<T>::init() {
}
template<typename T>
bool Frigioni<T>::query(const T& u, const T& v) {
return TC[u] == TC[v];
}
template<typename T>
void Frigioni<T>::remove(const T& u, const T& v) {
}
} // namespace algo
#endif