meanDegree

meanDegree()
Returns the mean degree of the network as a float.

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 mean degree is defined as:

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

Example (python-conedy)

import conedy as co


N = co.network()

N.completeNetwork(10)  # creates a network of 10 nodes, where every pair is connected by an unweighted edge
print "Should be 9: " + str (N.meanDegree())


N.clear()
N.cycle(50, 3, co.node(), co.weightedEdge())
N.rewire(0.9)
print "Should be 6: " + str (N.meanDegree())

Example (conedy)

network N;

setRandomSeed(0);

N.completeNetwork (10, node(), edge());
print "Should be 9: " + N.meanDegree() + newline;

N.clear();

N.cycle(50, 3, node(), weightedEdge());
N.rewire(0.9);
print "Should be 6: " + N.meanDegree() + newline;

Table Of Contents

Previous topic

meanClustering

Next topic

meanPathLength