Change project structure
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#ifndef DECREMENTAL_MAINTENANCE_H_
|
||||
#define DECREMENTAL_MAINTENANCE_H_
|
||||
#ifndef DECREMENTAL_SCC_H_
|
||||
#define DECREMENTAL_SCC_H_
|
||||
|
||||
#include "graph/digraph.h"
|
||||
#include "graph/scc.h"
|
||||
@@ -12,9 +12,9 @@ using namespace graph;
|
||||
namespace algo {
|
||||
|
||||
template<typename T>
|
||||
class DecrementalMaintenance : public RodittyZwick<T> {
|
||||
class DecrementalSCC : public RodittyZwick<T> {
|
||||
public:
|
||||
DecrementalMaintenance(Digraph<T> G) : G(G) {}
|
||||
DecrementalSCC(Digraph<T> G) : G(G) {}
|
||||
|
||||
//
|
||||
void init();
|
||||
@@ -40,7 +40,7 @@ private:
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
void DecrementalMaintenance<T>::init() {
|
||||
void DecrementalSCC<T>::init() {
|
||||
auto tarjan = Tarjan<T>(G).run();
|
||||
|
||||
for (auto& C : tarjan) {
|
||||
@@ -60,12 +60,12 @@ void DecrementalMaintenance<T>::init() {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool DecrementalMaintenance<T>::query(const T& u, const T& v) {
|
||||
bool DecrementalSCC<T>::query(const T& u, const T& v) {
|
||||
return A[u] == A[v];
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void DecrementalMaintenance<T>::remove(const T& u, const T& v) {
|
||||
void DecrementalSCC<T>::remove(const T& u, const T& v) {
|
||||
// If u and v are not in the same SCC, do nothing
|
||||
if (A[u] != A[v]) return;
|
||||
|
||||
46
algorithm/decremental_tc.h
Normal file
46
algorithm/decremental_tc.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef DECREMENTAL_TC_H_
|
||||
#define DECREMENTAL_TC_H_
|
||||
|
||||
#include "graph/digraph.h"
|
||||
#include "graph/scc.h"
|
||||
#include "algorithm/tarjan.h"
|
||||
#include "algorithm/bfs.h"
|
||||
#include "algorithm/roditty_zwick.h"
|
||||
|
||||
namespace algo {
|
||||
|
||||
template<typename T>
|
||||
class DecrementalTC : public RodittyZwick<T> {
|
||||
public:
|
||||
DecrementalTC(Digraph<T> G) : G(G) {}
|
||||
|
||||
//
|
||||
void init();
|
||||
|
||||
//
|
||||
bool query(const T& u, const T& v);
|
||||
|
||||
//
|
||||
void remove(const T& u, const T& v);
|
||||
};
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline void DecrementalTC<T>::init() {
|
||||
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline bool DecrementalTC<T>::query(const T& u, const T& v) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void DecrementalTC<T>::remove(const T& u, const T& v) {
|
||||
|
||||
}
|
||||
|
||||
} // namespace algo
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user