File: BidirectionalBFSVisitor.h

package info (click to toggle)
abyss 2.3.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,284 kB
  • sloc: cpp: 78,182; ansic: 6,512; makefile: 2,252; perl: 672; sh: 509; haskell: 412; python: 4
file content (63 lines) | stat: -rw-r--r-- 1,280 bytes parent folder | download | duplicates (6)
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