removeRandomEdges

directedNetwork.removeRandomEdges(fraction, edge) undirectedNetwork.removeRandomEdges(fraction, edge)

Removes a fraction of edges of a certain kind from the network which are chosen randomly.

Parameters

fraction: float
fraction of edges which are removed.
edge: edge template
Remove edges that match this template.

Example (python-conedy)

import conedy as co

N=co.undirectedNetwork()

N.cycle(100, 4, co.node(), co.weightedEdge(0.1))
N.rewire(0.3)
print "Initial mean degree:" + str(N.meanDegree())

N.removeRandomEdges(0.5, co.weightedEdge(0.1))
print "Should have changed:" + str(N.meanDegree())

Example (conedy)

network N;

N.cycle(100, 4, node(), weightedEdge(0.1));
N.rewireUndirected(0.3);
print "Initial mean degree:" + N.meanDegree() + newline;

N.removeRandomEdges(0.5, weightedEdge(0.1));
print "Should be close to 4:" + N.meanDegree() + newline;

Table Of Contents

Previous topic

removeNodes

Next topic

replaceEdges