nw:generate-preferential-attachment
nw:generate-preferential-attachment turtle-breed link-breed num-nodes min-degree optional-command-block
Generates a new network using a version of the Barabási–Albert algorithm. This network will have the property of being “scale free”: the distribution of degrees (i.e. the number of links for each turtle) should follow a power law.
Generation works as follows turtles are added, one by one, each forming min-degree
links to a previously added turtles, until num-nodes
is reached. The more links a turtle already has, the greater the probability that new turtles form links with it when they are added.
If you specify an optional-command-block
, it is executed for each turtle in the newly created network. For example:
nw:generate-preferential-attachment turtles links 100 1 [ set color red ]
Take me to the full Networks Extension Dictionary