dynetx.DynGraph.nodes_iter

DynGraph.nodes_iter(t=None, data=False)

Return an iterator over the nodes with respect to a given temporal snapshot.

Parameters

tsnapshot id (default=None).

If None the iterator returns all the nodes of the flattened graph.

data: node data(default=False)

Returns

niteriterator

An iterator over nodes. If data=True the iterator gives two-tuples containing (node, node data, dictionary)

Examples

>>> import dynetx as dn
>>> G = dn.DynGraph()   # or DiGraph, MultiGraph, MultiDiGraph, etc
>>> G.add_path([0,1,2], 0)
>>> [n for n, d in G.nodes_iter(t=0)]
[0, 1, 2]