Previous topic

create

Next topic

attributeCount

This Page

neighbors_data_iter

nepidemix.utilities.networkxtra.neighbors_data_iter(graph, n)

As networkX does not provide any good support o getting a nearest neighbour iterator with node data this is a utility function for doing just that.

Parameters :

graph :netwokx.Graph :

The graph

n : networkx node

A node in the graph.

Returns :

iter : list iterator

Iterator in the list of tuples (node, data) where node is a nearest neighbour of n, and data is its associated attribute dictionary.

Notes

Is there a more efficient way of doing this?