dynetx.DynDiGraph.stream_interactions

DynDiGraph.stream_interactions()

Generate a temporal ordered stream of interactions. Only incoming interactions are returned.

Returns:nd_iter – The iterator returns a 4-tuples of (node, node, op, timestamp).
Return type:an iterator

Examples

>>> G = dn.DynDiGraph()
>>> G.add_interaction(0,1, t=0)
>>> G.add_interaction(1,2, t=0)
>>> G.add_interaction(2,3, t=0)
>>> G.add_interaction(3,4, t=1)
>>> G.add_interaction(4,5, t=1)
>>> G.add_interaction(5,6, t=1)
>>> list(G.stream_interactions())
[(0, 1, '+', 0), (1, 2, '+', 0), (2, 3, '+', 0), (3, 4, '+', 1), (4, 5, '+', 1), (5, 6, '+', 1)]