graph_tool.search.AStarVisitor#
- class graph_tool.search.AStarVisitor[source]#
Bases:
objectA visitor object that is invoked at the event-points inside the
astar_search()algorithm. By default, it performs no action, and should be used as a base class in order to be useful.Methods
black_target(e)This is invoked when a vertex that is on the
CLOSEDlist is "rediscovered" via a more efficient path, and is re-added to theOPENlist.This is invoked when a vertex is first discovered and is added to the
OPENlist.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 examined.
This is invoked on a vertex as it is popped from the queue (i.e. it has the lowest cost on the
OPENlist).This is invoked on a vertex when it is added to the CLOSED list, which happens after all of its out edges have been examined.
This is invoked on every vertex of the graph before the start of the graph search.
- black_target(e)[source]#
This is invoked when a vertex that is on the
CLOSEDlist is “rediscovered” via a more efficient path, and is re-added to theOPENlist.
- discover_vertex(u)[source]#
This is invoked when a vertex is first discovered and is added to the
OPENlist.
- 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_vertex(u)[source]#
This is invoked on a vertex as it is popped from the queue (i.e. it has the lowest cost on the
OPENlist). This happens immediately before examine_edge() is invoked on each of the out-edges of vertex u.