completeNetwork

network.complete(size, node=dynNode, edge=weightedEdge)
Adds a number of nodes such that there is an edge between every two nodes. In other words: every possible edge exists.

Parameters

size: integer
Number of nodes to be added.
node: node template
Every added node is a copy of this template.
edge: edge template
Every added edge is a copy of this template.

Returns

the number of the first added node. The following nodes have consecutive numbers.

Example (python-conedy)

import conedy as co


N = co.network()

N.completeNetwork(10) # adds 10 nodes, which are mutually connected by unweighted edges


print "should be 9:" + str(N.meanDegree())
print "should be 1.0:" + str(N.meanClustering())
print "should be 1.0:" + str(N.meanPathLength())

Example (conedy)

network N;


N.completeNetwork(10); # adds 10 nodes, which are mutually connected by unweighted edges


print "should be 9:" + N.meanDegree() + newline;
print "should be 1.0:" + N.meanClustering() + newline;
print "should be 1.0:" + N.meanPathLength() + newline;

Table Of Contents

Previous topic

clear

Next topic

createFromAdjacencyList