Warning
The documentation for retworkx has migrated to:
https://qiskit.org/documentation/retworkx
These docs will no longer be updated.
retworkx.descendants¶
- descendants(graph, node, /)¶
Return the descendants of a node in a graph.
This differs from
PyDiGraph.successors()
method in thatsuccessors`
returns only nodes with a direct edge out of the provided node. While this function returns all nodes that have a path from the provided node.- Parameters
graph (PyDiGraph) – The graph to get the descendants from
node (int) – The index of the graph node to get the descendants for
- Returns
A list of node indexes of descendants of provided node.
- Return type
list