dynetworkx.SnapshotGraph.has_node

SnapshotGraph.has_node(n, sbunch=None)

Gets boolean list of if a snapshot in ‘sbunch’ contains node ‘n’.

Parameters:
  • n (node) – Node to be checked for in requested snapshots.
  • sbunch (container of snapshot indexes, optional (default= None)) – Each snapshot index in this list will be included in the returned list of if the snapshot graph includes the node. It is highly recommended that this list is sequential, however it can be out of order.
Returns:

Return type:

List of boolean values if index in sbunch contains n.

Examples

>>> G = dnx.SnapshotGraph()
>>> G.add_snapshot([(1, 2), (1, 3)])
>>> G.add_snapshot([(1, 4), (1, 3)])
>>> G.has_node(1, sbunch=[1])
[True]
>>> G.has_node(1)
[True, True]