dynetworkx.ImpulseGraph.number_of_nodes

ImpulseGraph.number_of_nodes(begin=None, end=None, inclusive=(True, True))

Return the number of nodes in the impulse graph between the given interval.

Parameters:
  • begin (int or float, optional (default= beginning of the entire impulse graph)) –
  • end (int or float, optional (default= end of the entire impulse graph)) – Must be bigger than or equal begin.
  • inclusive (2-tuple boolean that determines inclusivity of begin and end) –
Returns:

nnodes – The number of nodes in the impulse graph.

Return type:

int

See also

__len__()

Examples

>>> G = dnx.ImpulseGraph()
>>> G.add_edges_from([(1, 2, 5), (3, 4, 11)])
>>> len(G)
4
>>> G.number_of_nodes()
4
>>> G.number_of_nodes(begin=6)
2
>>> G.number_of_nodes(begin=5, end=8)
2
>>> G.number_of_nodes(end=11)
4