MCPcopy
hub / github.com/networkx/networkx / degree

Method degree

networkx/algorithms/approximation/kcomponents.py:316–352  ·  view source on GitHub ↗

Returns an iterator for (node, degree) and degree for single node. The node degree is the number of edges adjacent to the node. Parameters ---------- nbunch : iterable container, optional (default=all nodes) A container of nodes. The container will be i

(self)

Source from the content-addressed store, hash-verified

314
315 @cached_property
316 def degree(self):
317 """Returns an iterator for (node, degree) and degree for single node.
318
319 The node degree is the number of edges adjacent to the node.
320
321 Parameters
322 ----------
323 nbunch : iterable container, optional (default=all nodes)
324 A container of nodes. The container will be iterated
325 through once.
326
327 weight : string or None, optional (default=None)
328 The edge attribute that holds the numerical value used
329 as a weight. If None, then each edge has weight 1.
330 The degree is the sum of the edge weights adjacent to the node.
331
332 Returns
333 -------
334 deg:
335 Degree of the node, if a single node is passed as argument.
336 nd_iter : an iterator
337 The iterator returns two-tuples of (node, degree).
338
339 See Also
340 --------
341 degree
342
343 Examples
344 --------
345 >>> G = nx.path_graph(4)
346 >>> G.degree(0) # node 0 with degree 1
347 1
348 >>> list(G.degree([0, 1]))
349 [(0, 1), (1, 2)]
350
351 """
352 return self.AntiDegreeView(self)
353
354 def adjacency(self):
355 """Returns an iterator of (node, adjacency set) tuples for all nodes

Callers 15

_extrema_boundingFunction · 0.45
is_isolateFunction · 0.45
isolatesFunction · 0.45
core_numberFunction · 0.45
onion_layersFunction · 0.45
predictFunction · 0.45
directed_edge_swapFunction · 0.45
double_edge_swapFunction · 0.45
s_metricFunction · 0.45
is_regularFunction · 0.45

Calls

no outgoing calls