dynetx.DynDiGraph.out_interactions

DynDiGraph.out_interactions(nbunch=None, t=None)

Return the list of out interaction present in a given snapshot.

Edges are returned as tuples in the order (node, neighbor).

Parameters:
  • nbunch (iterable container, optional (default= all nodes)) – A container of nodes. The container will be iterated through once.
  • t (snapshot id (default=None)) – If None the the method returns all the edges of the flattened graph.
Returns:

interaction_list – Interactions that are adjacent to any node in nbunch, or a list of all interactions if nbunch is not specified.

Return type:

list of interaction tuples

Notes

Nodes in nbunch that are not in the graph will be (quietly) ignored. For directed graphs this returns the out-interaction.

Examples

>>> G = dn.DynDiGraph()
>>> G.add_interaction(0, 1, t=0)
>>> G.add_interaction(2, 3, t=1)
>>> G.out_interactions(t=0)
[(0, 1)]
>>> G.out_interactions()
[(0, 1), (2, 3)]
>>> G.out_interactions([0,3], t=0)
[(0, 1)]