dynetx.DynGraph.number_of_nodes

DynGraph.number_of_nodes(t=None)

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

Parameters:t (snapshot id (default=None)) – If None return the number of nodes in the flattened graph.
Returns:nnodes – The number of nodes in the graph.
Return type:int

See also

order()

Examples

>>> import dynetx as dn
>>> G = dn.DynGraph()
>>> G.add_path([0,1,2], t=0)
>>> G.number_of_nodes(0)
3