Return oriented tree constructed from a depth-first-search from source.
Parameters: | G : NetworkX graph source : node, optional
|
---|---|
Returns: | T : NetworkX DiGraph
|
Examples
>>> G = nx.Graph()
>>> G.add_path([0,1,2])
>>> T = nx.dfs_tree(G,0)
>>> print(T.edges())
[(0, 1), (1, 2)]