|
Public Types |
typedef GR | Graph |
| The type of the underlying graph.
|
typedef Graph::Node | Node |
|
|
typedef Graph::NodeIt | NodeIt |
|
|
typedef Graph::Edge | Edge |
|
|
typedef Graph::OutEdgeIt | OutEdgeIt |
|
|
typedef Graph::template NodeMap<
Edge > | PredMap |
| The type of the map that stores the last edges of the shortest paths.
|
typedef Graph::template NodeMap<
Node > | PredNodeMap |
| The type of the map that stores the last but one nodes of the shortest paths.
|
typedef Graph::template NodeMap<
int > | DistMap |
| The type of the map that stores the dists of the nodes.
|
Public Member Functions |
| Bfs (const Graph &_G) |
| Constructor.
|
| ~Bfs () |
| Destructor.
|
Bfs & | setPredMap (PredMap &m) |
| Sets the map storing the predecessor edges.
|
Bfs & | setPredNodeMap (PredNodeMap &m) |
| Sets the map storing the predecessor nodes.
|
Bfs & | setDistMap (DistMap &m) |
| Sets the map storing the distances calculated by the algorithm.
|
void | run (Node s) |
| Runs BFS algorithm from node s .
|
int | dist (Node v) const |
| The distance of a node from the root.
|
Edge | pred (Node v) const |
| Returns the 'previous edge' of the BFS path tree.
|
Node | predNode (Node v) const |
| Returns the 'previous node' of the BFS tree.
|
const DistMap & | distMap () const |
| Returns a reference to the NodeMap of distances.
|
const PredMap & | predMap () const |
| Returns a reference to the BFS tree map.
|
const PredNodeMap & | predNodeMap () const |
| Returns a reference to the map of last but one nodes of shortest paths.
|
bool | reached (Node v) |
| Checks if a node is reachable from the root.
|