degreeCentrality

degreeCentrality(filename)
Writes the degree of each individual node to a text file. The file contains the degrees written in order of the node number. The redundant name was only chosen to distinguish this function from degree.

Parameters

filename: string
Name of the file to which the degrees will be written

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: degree

Example (python-conedy)

import conedy as co

N = co.network()

i = N.cycle(20, 1, co.node(), co.weightedEdge())

N.addEdge(i + 1, i + 7, co.weightedEdge(1.0))
N.addEdge(i + 7, i + 1, co.weightedEdge(2.0))
N.addEdge(i + 1, i +11, co.weightedEdge(3.0))
N.addEdge(i +11, i + 1, co.weightedEdge(4.0))


N.degreeCentrality("output/degreeCentrality.py.out")

Example (conedy)

network N;

int i = N.cycle(20, 1, kuramoto());

N.addEdge(i+ 1, i+ 7, weightedEdge(1.0));
N.addEdge(i+ 7, i+ 1, weightedEdge(2.0));
N.addEdge(i+ 1, i+11, weightedEdge(3.0));
N.addEdge(i+11, i+ 1, weightedEdge(4.0));

N.closenessCentrality( "output/degreeCentrality.co.out" );

Table Of Contents

Previous topic

degree

Next topic

getParam