1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
#ifndef BIDIRECTION_BFS_VISITOR_H
#define BIDIRECTION_BFS_VISITOR_H 1
#include "Graph/Path.h"
enum BFSVisitorResult { SUCCESS, ABORT_SEARCH, SKIP_ELEMENT };
template <class Graph>
class BidirectionalBFSVisitor {
public:
typedef typename boost::graph_traits<Graph>::vertex_descriptor Vertex;
typedef typename boost::graph_traits<Graph>::edge_descriptor Edge;
typedef unsigned NumFrontierNodes;
BidirectionalBFSVisitor() { }
virtual ~BidirectionalBFSVisitor() { }
virtual BFSVisitorResult discover_vertex(const Vertex&, const Graph&, Direction, NumFrontierNodes)
{
return SUCCESS;
}
virtual void examine_vertex(const Vertex&, const Graph&, Direction)
{
}
virtual void finish_vertex(const Vertex&, const Graph&, Direction)
{
}
virtual void examine_edge(const Edge&, const Graph&, Direction)
{
}
virtual BFSVisitorResult common_edge(const Edge&, const Graph&, Direction)
{
return SUCCESS;
}
virtual BFSVisitorResult tree_edge(const Edge&, const Graph&, Direction)
{
return SUCCESS;
}
virtual BFSVisitorResult non_tree_edge(const Edge&, const Graph&, Direction)
{
return SUCCESS;
}
virtual void gray_target(const Edge&, const Graph&, Direction)
{
}
virtual void black_target(const Edge&, const Graph&, Direction)
{
}
};
#endif
|