Bellman Ford Visitor Concept
This concept defines the visitor interface for
bellman_ford_shortest_paths().
Users can define a class with the Bellman Ford Visitor interface and
pass and object of the class to
bellman_ford_shortest_paths(), thereby augmenting the
actions taken during the graph search.
Notation
V |
A type that is a model of Bellman Ford 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 |
|---|---|---|---|
Examine Edge |
|
|
This is invoked on
every edge in the graph |
Edge Relaxed |
|
|
Upon examination,
if the following condition holds then the edge is relaxed (its distance
is reduced), and this method is invoked. |
Edge Not Relaxed |
|
|
Upon examination, if the edge is not relaxed (see above) then this method is invoked. |
Edge Minimized |
|
|
After
|
Edge Not Minimized |
|
|
If the edge is not minimized, this function is invoked. This happens when there is a negative cycle in the graph. |