Fix includes and add some comments
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#ifndef TARJAN_H_
|
||||
#define TARJAN_H_
|
||||
|
||||
#include "graph/digraph.h"
|
||||
#include "graph/scc.h"
|
||||
|
||||
#include <stack>
|
||||
@@ -16,10 +15,8 @@ class Tarjan {
|
||||
public:
|
||||
Tarjan(Digraph<T> G) : G(G) {}
|
||||
|
||||
//
|
||||
std::vector<SCC<T>> findSCC();
|
||||
std::vector<SCC<T>> execute();
|
||||
|
||||
//
|
||||
void strongConnect(const T& v);
|
||||
private:
|
||||
// Necessary info about vertices when running Tarjan's algorithm
|
||||
@@ -68,7 +65,7 @@ void Tarjan<T>::strongConnect(const T& v) {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
std::vector<SCC<T>> Tarjan<T>::findSCC() {
|
||||
std::vector<SCC<T>> Tarjan<T>::execute() {
|
||||
for (const auto& v : G.vertices) {
|
||||
if (p[v].index == -1) {
|
||||
strongConnect(v);
|
||||
|
||||
Reference in New Issue
Block a user