dynetworkx.ImpulseGraph.remove_node

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

Remove the presence of a node n within the given interval.

Removes the presence node n and all adjacent edges within the given interval.

If interval is specified, all the edges of n will be removed within that interval.

Quiet if n is not in the impulse graph.

Parameters:
  • n (node) – A node in the graph
  • 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 to begin.
  • inclusive (2-tuple boolean that determines inclusivity of begin and end) –

Examples

>>> G.add_edges_from([(1, 2, 10), (2, 4, 11), (6, 4, 19), (2, 4, 15)])
>>> G.add_nodes_from([(1, {'time': '1pm'}), (2, {'time': '2pm'}), (4, {'time': '4pm'})])
>>> G.nodes(begin=10, end=19)
[1, 2, 4, 6]
>>> G.remove_node(6, begin=10, end=20)
>>> G.nodes()
[1, 2, 4]
>>> G.nodes(data=True)
[(1, {'time': '1pm'}), (2, {'time': '2pm'}), (4, {'time': '4pm'})]
>>> G.remove_node(2)
>>> G.nodes(data=True)
[(1, {'time': '1pm'}), (4, {'time': '4pm'})]