DijkstraVisitor#

class graph_tool.search.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(u)

This is invoked when a vertex is encountered for the first time.

edge_not_relaxed(e)

Upon examination, if the edge is not relaxed (see edge_relaxed()) then this method is invoked.

edge_relaxed(e)

Upon examination, if the following condition holds then the edge is relaxed (its distance is reduced), and this method is invoked.

examine_edge(e)

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

examine_vertex(u)

This is invoked on a vertex as it is popped from the queue.

finish_vertex(u)

This invoked on a vertex after all of its out edges have been added to the search tree and all of the adjacent vertices have been discovered (but before their out-edges have been examined).

initialize_vertex(u)

This is invoked on every vertex of the graph before the start of the graph search.

discover_vertex(u)[source]#

This is invoked when a vertex is encountered for the first time.

edge_not_relaxed(e)[source]#

Upon examination, if the edge is not relaxed (see edge_relaxed()) then this method is invoked.

edge_relaxed(e)[source]#

Upon examination, if the following condition holds then the edge is relaxed (its distance is reduced), and this method is invoked.

(u, v) = tuple(e)
assert compare(combine(d[u], weight[e]), d[v])
examine_edge(e)[source]#

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

examine_vertex(u)[source]#

This is invoked on a vertex as it is popped from the queue. This happens immediately before examine_edge() is invoked on each of the out-edges of vertex u.

finish_vertex(u)[source]#

This invoked on a vertex after all of its out edges have been added to the search tree and all of the adjacent vertices have been discovered (but before their out-edges have been examined).

initialize_vertex(u)[source]#

This is invoked on every vertex of the graph before the start of the graph search.