Files
reachability-algorithms/graph/scc.h

29 lines
475 B
C++

#ifndef SCC_H_
#define SCC_H_
#include "graph.h"
#include <ranges>
namespace graph {
template<typename T>
class SCC : public Graph<T> {
public:
SCC(std::map<T, std::set<T>> scc);
private:
T root;
};
template<typename T>
SCC<T>::SCC(std::map<T, std::set<T>> scc) {
Graph<T>::adjMatrix = scc;
auto kv = std::views::keys(Graph<T>::adjMatrix);
Graph<T>::vertices = std::set<T>{ kv.begin(), kv.end() };
root = scc.begin()->first;
}
}; // namespace graph
#endif