dynetx.DynDiGraph.out_degree

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

Return the out degree of a node or nodes at time t.

The node degree is the number of interaction outgoing from that node in a given time frame.

Parameters

nbunchiterable container, optional (default=all nodes)

A container of nodes. The container will be iterated through once.

tsnapshot id (default=None)

If None will be returned the degree of nodes on the flattened graph.

Returns

nddictionary, or number

A dictionary with nodes as keys and degree as values or a number if a single node is specified.

Examples

>>> import dynetx as dn
>>> G = dn.DynDiGraph()
>>> G.add_interactions(0,1, t=0)
>>> G.add_interactions(1,2, t=0)
>>> G.add_interactions(2,3, t=0)
>>> G.out_degree(0, t=0)
1
>>> G.out_degree([0,1], t=1)
{0: 0, 1: 0}
>>> list(G.out_degree([0,1], t=0).values())
[1, 2]