nw:generate-random
nw:generate-random turtle-breed link-breed num-nodes connection-probability optional-command-block
Generates a new random network of num-nodes turtles in which each one has a connection-probability (between 0 and 1) of being connected to each other turtles. The algorithm uses the G(n, p) variant of the Erdős–Rényi model.
The algorithm is O(n²) for directed networks and O(n²/2) for undirected networks, so generating more than a couple thousand nodes will likely take a very long time.
If you specify an optional-command-block, it is executed for each turtle in the newly created network. For example:
nw:generate-random turtles links 100 0.5 [ set color red ]
Take me to the full Networks Extension Dictionary