dynetworkx.SnapshotGraph.size

SnapshotGraph.size(sbunch=None, weight=None)

Returns the size of each graph index as specified in sbunch as a list.

Parameters:
  • sbunch (container of snapshot indexes, optional (default= None)) – Each snapshot index in this list will be included in the returned list of sizes. It is highly recommended that this list is sequential, however it can be out of order.
  • weight (string, optional (default=None)) – The edge attribute that holds the numerical value used as a weight. If None, then each edge has weight 1.
Returns:

size_list – List of sizes of each graph indexed in sbunch.

Return type:

list

Examples

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