Add virtual class for the dynamic reachability algorithms
This commit is contained in:
38
algorithm/dynamic_reachability.h
Normal file
38
algorithm/dynamic_reachability.h
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
#ifndef DYNAMIC_REACHABILITY_
|
||||||
|
#define DYNAMIC_REACHABILITY_
|
||||||
|
|
||||||
|
#include "graph/digraph.h"
|
||||||
|
#include "graph/scc.h"
|
||||||
|
#include "algorithm/tarjan.h"
|
||||||
|
#include "algorithm/bfs.h"
|
||||||
|
#include "algorithm/roditty_zwick.h"
|
||||||
|
|
||||||
|
using namespace graph;
|
||||||
|
|
||||||
|
namespace algo {
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
class DynamicReachability : public RodittyZwick {
|
||||||
|
~DynamicReachability();
|
||||||
|
|
||||||
|
//
|
||||||
|
virtual void init() =0;
|
||||||
|
|
||||||
|
//
|
||||||
|
virtual bool query(const T& u, const T& v) =0;
|
||||||
|
|
||||||
|
//
|
||||||
|
virtual void remove(const T& u, const T& v) =0;
|
||||||
|
|
||||||
|
//
|
||||||
|
virtual void insert() =0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
inline DynamicReachability<T>::~DynamicReachability() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace algo
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user