DFS Visitor Concept
This concept defines the visitor interface for
depth_first_search(). Users
can define a class with the DFS Visitor interface and pass an object of
the class to depth_first_search(), thereby augmenting the
actions taken during the graph search.
Notation
V |
A type that is a model of DFS Visitor. |
|---|---|
|
An object of type |
|
A type that is a model of Graph. |
|
An object of type |
|
An object of type
|
|
An object of type
|
Valid Expressions
| Name | Expression | Return Type | Description |
|---|---|---|---|
Initialize Vertex |
|
|
This is invoked on every vertex of the graph before the start of the graph search. |
Start Vertex |
|
|
This is invoked on the source vertex once before the start of the search. |
Discover Vertex |
|
|
This is invoked when a vertex is encountered for the first time. |
Examine Edge |
|
|
This is invoked on every out-edge of each vertex after it is discovered. |
Tree Edge |
|
|
This is invoked on each edge as it becomes a member of the edges that form the search tree. |
Back Edge |
|
|
This is invoked on the
back edges in the graph. For an undirected graph there is some ambiguity
between tree edges and back edges since the edge (u,v) and (v,u) are
the same edge, but both the |
Forward or Cross Edge |
|
|
This is invoked on forward or cross edges in the graph. In an undirected graph this method is never called. |
Finish Edge |
|
|
This is invoked on
each non-tree edge as well as on each tree edge after
|
Finish Vertex |
|
|
This is invoked
on vertex |