dynetx.DynDiGraph.number_of_nodes

DynDiGraph.number_of_nodes(t=None)

Return the number of nodes in the t snapshot of a dynamic graph.

Parameters

tsnapshot id (default=None)

If None return the number of nodes in the flattened graph.

Returns

nnodesint

The number of nodes in the graph.

See Also

order which is identical

Examples

>>> import dynetx as dn
>>> G = dn.DynDiGraph()
>>> G.add_interaction(0, 1, t=0)
>>> G.number_of_nodes(0)
2