Note

This is the documentation for the current state of the development branch of rustworkx. The documentation or APIs here can change prior to being released.

DijkstraVisitor#

class DijkstraVisitor[source]#

Bases: object

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

Methods

discover_vertex

This is invoked when a vertex is encountered for the first time and it's popped from the queue.

edge_not_relaxed

Upon examination, if the edge is not relaxed, this event is emitted.

edge_relaxed

Upon examination, if the distance of the target of the edge is reduced, this event is emitted.

examine_edge

This is invoked on every out-edge of each vertex after it is discovered.

finish_vertex

This is invoked on vertex v after all of its out edges have been examined.