dynetworkx.ImpulseGraph.has_node

ImpulseGraph.has_node(n, begin=None, end=None, inclusive=(True, True))

Return True if the impulse graph contains the node n, during the given interval.

Identical to n in G when ‘begin’ and ‘end’ are not defined.

Parameters:
  • n (node) –
  • 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) –

Examples

>>> G = dnx.ImpulseGraph()
>>> G.add_node(1)
>>> G.has_node(1)
True

It is more readable and simpler to use

>>> 1 in G
True

With interval query:

>>> G.add_edge(3, 4, 5)
>>> G.has_node(3)
True
>>> G.has_node(3, begin=2)
True
>>> G.has_node(3, end=2)
False