Returns the degree of a node.
nodeNumber: integer
The number of the node whose degree shall be returned.


If n is the number of nodes in the network and A is its adjacency matrix (i.e. A_{ij} = 1, if there is an edge connecting node i to node j, and A_{ij} = 0 otherwise), the degree is of node i is defined as:

\sum_{j=1}^{n} A_{ij}

See also: degreeCentrality

Example (python-conedy)

import conedy as co

N =

N.addNode (co.node())

print "Should be 0:" + str(
N.addEdge (0,0)
print "Should be 1:" + str(

Example (conedy)

network N;

N.addNode (node());

print "Should be 0:" + + newline;
N.addEdge (0,0);
print "Should be 1:" + + newline;

Table Of Contents

Previous topic


Next topic