Traversal#

rustworkx.dfs_edges(graph[, source])

Get an edge list of the tree edges from a depth-first traversal

rustworkx.dfs_search(graph, source, visitor)

Depth-first traversal of a directed/undirected graph.

rustworkx.bfs_successors(graph, node, /)

Return successors in a breadth-first-search from a source node.

rustworkx.bfs_predecessors(graph, node, /)

Return predecessors in a breadth-first-search from a source node.

rustworkx.bfs_search(graph, source, visitor)

Breadth-first traversal of a directed/undirected graph.

rustworkx.dijkstra_search(graph, source, ...)

Dijkstra traversal of a graph.

rustworkx.topological_sort(graph, /)

Return the topological sort of node indices from the provided graph

rustworkx.lexicographical_topological_sort(...)

Get the lexicographical topological sorted nodes from the provided DAG

rustworkx.descendants(graph, node, /)

Return the descendants of a node in a graph.

rustworkx.ancestors(graph, node, /)

Return the ancestors of a node in a graph.

rustworkx.collect_runs(graph, filter_fn)

Collect runs that match a filter function

rustworkx.collect_bicolor_runs(graph, ...)

Collect runs that match a filter function given edge colors.

rustworkx.visit.DFSVisitor()

A visitor object that is invoked at the event-points inside the dfs_search() algorithm.

rustworkx.visit.BFSVisitor()

A visitor object that is invoked at the event-points inside the bfs_search() algorithm.

rustworkx.visit.DijkstraVisitor()

A visitor object that is invoked at the event-points inside the dijkstra_search() algorithm.

rustworkx.TopologicalSorter

Provides functionality to topologically sort a directed graph.