BFSVisitor#

class graph_tool.search.BFSVisitor[source]#

Bases: object

A visitor object that is invoked at the event-points inside the bfs_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 on the subset of non-tree edges whose target vertex is colored black at the time of examination.

discover_vertex(u)

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

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 the out-edges of the adjacent vertices have been examined).

gray_target(e)

This is invoked on the subset of non-tree edges whose target vertex is colored gray at the time of examination.

initialize_vertex(u)

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

non_tree_edge(e)

This is invoked on back or cross edges for directed graphs and cross edges for undirected graphs.

tree_edge(e)

This is invoked on each edge as it becomes a member of the edges that form the search tree.

black_target(e)[source]#

This is invoked on the subset of non-tree edges whose target vertex is colored black at the time of examination. The color black indicates that the vertex has been removed from the queue.

discover_vertex(u)[source]#

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

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 the out-edges of the adjacent vertices have been examined).

gray_target(e)[source]#

This is invoked on the subset of non-tree edges whose target vertex is colored gray at the time of examination. The color gray indicates that the vertex is currently in the queue.

initialize_vertex(u)[source]#

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

non_tree_edge(e)[source]#

This is invoked on back or cross edges for directed graphs and cross edges for undirected graphs.

tree_edge(e)[source]#

This is invoked on each edge as it becomes a member of the edges that form the search tree.