rewire

directedNetwork.rewire(probability, node) undirectedNetwork.rewire(probability, node)

Replaces connections in the network by connections between randomly chosen source and target nodes.

Parameters

probability: double (\in\left[ 0, 1 \right])
Replacement probability.
node: node template
Only consider edges for replacement if both, source and target node are of this type. If not specified, all edges are considered.

Example (python-conedy)

import conedy as co



N= co.network()
co.setRandomSeed(0);

node = co.roessler()
edge = co.weightedEdge(1.0)


N.cycle( 1000, 10, node,edge)


print "mean degree before rewiring:" + str( N.meanDegree())
print "should be close to 0.75:" + str( N.meanClustering())
N.rewire(1.0)
print "mean degree after rewiring:" + str( N.meanDegree())
print "should be close to 0.0:" + str( N.meanClustering())
#print n.meanDegree()

Example (conedy)

network N;


N.cycle ( 1000, 10, roessler(), weightedEdge(1.0));




print "mean degree before rewiring:" + N.meanDegree()+ newline;
print "should be close to 0.75:" +  N.meanClustering()+ newline;
N.rewire(1.0);
print "mean degree after rewiring:" +  N.meanDegree()+ newline;
print "should be close to 0.0:" +  N.meanClustering()+ newline;

Table Of Contents

Previous topic

replaceNode

Next topic

saveAdjacencyList