Files
reachability-algorithms/graph/scc.h
2022-05-17 21:25:47 +03:00

47 lines
642 B
C++

#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