graph_analysis
BFS.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_ANALYSIS_ALGORITHMS_BFS_HPP
2 #define GRAPH_ANALYSIS_ALGORITHMS_BFS_HPP
3 
4 #include <queue>
5 #include "../BaseGraph.hpp"
6 #include "Skipper.hpp"
7 #include "BFSVisitor.hpp"
8 
9 namespace graph_analysis {
10 namespace algorithms {
11 
18 class BFS
19 {
20 public:
27  BFS(const BaseGraph::Ptr& graph, const Visitor::Ptr& visitor, Skipper skipper = Skipper());
28 
33  void run(const Vertex::Ptr& startVertex = Vertex::Ptr());
34 
35 private:
36  BaseGraph::Ptr mpGraph;
37  Vertex::Ptr mStartVertex;
38  std::queue<Vertex::Ptr> mStack;
39  Visitor::Ptr mpVisitor;
40  Skipper mSkipper;
41 };
42 
43 } // end namespace algorithms
44 } // end namespace graph_analysis
45 #endif // GRAPH_ANALYSIS_ALGORITHMS_BFS_HPP
function1< bool, Edge::Ptr > Skipper
Definition of the EdgeSkipper function.
Definition: Skipper.hpp:9
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
shared_ptr< Vertex > Ptr
Definition: Vertex.hpp:22
shared_ptr< Visitor > Ptr
Definition: Visitor.hpp:20
shared_ptr< BaseGraph > Ptr
Definition: BaseGraph.hpp:34
Implementation of Breadth-First-Search ΒΈ
Definition: BFS.hpp:18
void run(const Vertex::Ptr &startVertex=Vertex::Ptr())
Definition: BFS.cpp:12
BFS(const BaseGraph::Ptr &graph, const Visitor::Ptr &visitor, Skipper skipper=Skipper())
Definition: BFS.cpp:6