dynetworkx.IntervalGraph.degree¶
-
IntervalGraph.
degree
(node=None, begin=None, end=None, delta=False)¶ Return the degree of a specified node between time begin and end.
Parameters: - node (Nodes can be, for example, strings or numbers, optional.) – Nodes must be hashable (and not None) Python objects.
- begin (int or float, optional (default= beginning of the entire interval graph)) – Inclusive beginning time of the edge appearing in the interval graph.
- end (int or float, optional (default= end of the entire interval graph)) – Non-inclusive ending time of the edge appearing in the interval graph.
Returns: - Integer value of degree of specified node.
- If no node is specified, returns float mean degree value of graph.
- If delta is True, return list of tuples. – First indicating the time a degree change occurred, Second indicating the degree after the change occured
Examples
>>> G = IntervalGraph() >>> G.add_edge(1, 2, 3, 5) >>> G.add_edge(2, 3, 8, 11) >>> G.degree(2) 2 >>> G.degree(2,2) 2 >>> G.degree(2,end=8) 1 >>> G.degree() 1.33333 >>> G.degree(2,delta=True) [(3, 1), (5, 0), (8, 1)]