Make class Graph abstract and make derived classes Digraph and SCC

This commit is contained in:
stefiosif
2022-06-12 00:49:42 +03:00
parent b5b031db7f
commit 72741a6a5b
7 changed files with 113 additions and 113 deletions

View File

@@ -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;
};