This documents the development version of NetworkX. Documentation for the current release can be found here.
Returns all nodes having a path to source in G.
G (NetworkX DiGraph) – A directed acyclic graph (DAG)
source (node in G)
The ancestors of source in G