Add decremental maintenance of SCCs frame

This commit is contained in:
stefiosif
2022-05-17 21:25:47 +03:00
parent c2c278784b
commit 89a2a24f50
3 changed files with 74 additions and 0 deletions

47
graph/scc.h Normal file
View 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