dynetx.DynGraph.has_node

DynGraph.has_node(n, t=None)

Return True if the graph, at time t, contains the node n.

Parameters:
  • n (node) –
  • t (snapshot id (default None)) – If None return the presence of the node in the flattened graph.

Examples

>>> G = dn.DynGraph()   # or DiGraph, MultiGraph, MultiDiGraph, etc
>>> G.add_path([0,1,2], t=0)
>>> G.has_node(0, t=0)
True

It is more readable and simpler to use

>>> 0 in G
True