Note

This documents the development version of NetworkX. Documentation for the current release can be found here.

networkx.algorithms.traversal.breadth_first_search.descendants_at_distance

descendants_at_distance(G, source, distance)[source]

Returns all nodes at a fixed distance from source in G.

Parameters
GNetworkX DiGraph

A directed graph

sourcenode in G
distancethe distance of the wanted nodes from source
Returns
set()

The descendants of source in G at the given distance from source