BellmanFordVisitor#

class graph_tool.search.BellmanFordVisitor[source]#

Bases: object

A visitor object that is invoked at the event-points inside the bellman_ford_search() algorithm. By default, it performs no action, and should be used as a base class in order to be useful.

Methods

edge_minimized(e)

This is invoked during the second stage of the algorithm, during the test of whether each edge was minimized.

edge_not_minimized(e)

This is invoked during the second stage of the algorithm, during the test of whether each edge was minimized.

edge_not_relaxed(e)

This is invoked if the distance label for the target vertex is not decreased.

edge_relaxed(e)

This is invoked when the distance label for the target vertex is decreased.

examine_edge(e)

This is invoked on every edge in the graph |V| times.

edge_minimized(e)[source]#

This is invoked during the second stage of the algorithm, during the test of whether each edge was minimized. If the edge is minimized then this function is invoked.

edge_not_minimized(e)[source]#

This is invoked during the second stage of the algorithm, during the test of whether each edge was minimized. If the edge was not minimized, this function is invoked. This happens when there is a negative cycle in the graph.

edge_not_relaxed(e)[source]#

This is invoked if the distance label for the target vertex is not decreased.

edge_relaxed(e)[source]#

This is invoked when the distance label for the target vertex is decreased. The edge (u,v) that participated in the last relaxation for vertex v is an edge in the shortest paths tree.

examine_edge(e)[source]#

This is invoked on every edge in the graph |V| times.