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.

DFSVisitor#

class DFSVisitor[source]#

Bases: object

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

Methods

back_edge

This is invoked on the back edges in the graph.

discover_vertex

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

finish_vertex

This is invoked on vertex v after finish_vertex has been called for all the vertices in the DFS-tree rooted at vertex v.

forward_or_cross_edge

This is invoked on forward or cross edges in the graph.

tree_edge

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