Add decremental maintenance of SCCs frame
This commit is contained in:
47
graph/scc.h
Normal file
47
graph/scc.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifndef SCC_H_
|
||||
#define SCC_H_
|
||||
|
||||
#include "graph/graph.h"
|
||||
|
||||
namespace graph {
|
||||
|
||||
template<typename T>
|
||||
class SCC {
|
||||
public:
|
||||
SCC(std::vector<T> scc);
|
||||
|
||||
// Construct shortest path
|
||||
std::vector<T> SPT();
|
||||
|
||||
// Convert SCC into a Graph
|
||||
Graph<T> convert();
|
||||
private:
|
||||
std::vector<T> scc;
|
||||
// Representative - Root(SPT) of this SCC
|
||||
T root;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
SCC<T>::SCC(std::vector<T> component) {
|
||||
scc = component;
|
||||
root = scc[0];
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
std::vector<T> SCC<T>::SPT() {
|
||||
|
||||
// BFS
|
||||
|
||||
return std::vector<T>();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
Graph<T> SCC<T>::convert() {
|
||||
|
||||
|
||||
return Graph<T>();
|
||||
}
|
||||
|
||||
}; // namespace graph
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user