Add operator<< for graph types, add contains query for digraph types and normalize scc

This commit is contained in:
stefiosif
2022-09-09 17:50:28 +03:00
parent 4d189f269c
commit a4ddc3fbe7
9 changed files with 144 additions and 189 deletions

View File

@@ -0,0 +1,28 @@
#ifndef BREADTH_FIRST_TREE_H_
#define BREADTH_FIRST_TREE_H_
#include "digraph.h"
namespace graph {
template<typename T>
class BreadthFirstTree : public Digraph<T> {
public:
BreadthFirstTree() = default;
BreadthFirstTree(std::map<T, std::set<T>> G, T root)
: BreadthFirstTree<T>(Digraph<T>(G), root) {}
BreadthFirstTree(Digraph<T> G, T root);
T root;
};
template<typename T>
BreadthFirstTree<T>::BreadthFirstTree(Digraph<T> G, T root) {
this->adjMatrix = algo::BreadthFirstSearch<T>(G.adjMatrix).execute(root);
}
} // namespace graph
#endif