Make class Graph abstract and make derived classes Digraph and SCC
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
#ifndef BFS_H_
|
||||
#define BFS_H_
|
||||
|
||||
#include "graph/graph.h"
|
||||
using namespace graph;
|
||||
#include "graph/digraph.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <queue>
|
||||
|
||||
using namespace graph;
|
||||
|
||||
namespace algo {
|
||||
|
||||
template<typename T>
|
||||
class BFS {
|
||||
public:
|
||||
BFS(Graph<T> G, T root) : G(G), root(root) {}
|
||||
BFS(Digraph<T> G, T root) : G(G), root(root) {}
|
||||
|
||||
//
|
||||
std::map<T, std::set<T>> run();
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
//
|
||||
std::map<T, bool> initExplore();
|
||||
private:
|
||||
Graph<T> G;
|
||||
Digraph<T> G;
|
||||
T root;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user