degree

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

Notes

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 = co.network()

N.addNode (co.node())

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

Example (conedy)

network N;


N.addNode (node());

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

Table Of Contents

Previous topic

closenessCentrality

Next topic

degreeCentrality