You can use the 'neighbors' method like this:
In [1]: import networkx as nx
In [2]: G = nx.path_graph(4)
In [3]: G.edges()
Out[3]: [(0, 1), (1, 2), (2, 3)]
In [4]: nbr = G.neighbors(0)
In [5]: nbr
Out[5]: [1]
Then find the neighbors of all of those nodes (in this case only node
1 is in the list).
Aric
> --
> You received this message because you are subscribed to the Google Groups
> "networkx-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
networkx-discu...@googlegroups.com.
> To post to this group, send email to
networkx...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/networkx-discuss.
> For more options, visit
https://groups.google.com/d/optout.