Returns dictionary of predecessors for the path from source to all nodes in G.
Parameters: | G : NetworkX graph source : node label
target : node label, optional
cutoff : integer, optional
|
---|
Examples
>>> G=nx.path_graph(4)
>>> print G.nodes()
[0, 1, 2, 3]
>>> nx.predecessor(G,0)
{0: [], 1: [0], 2: [1], 3: [2]}