The Mind Wanders (2018)
The nodes of the network are things stored in memory—ideas, facts, events—and the links are various kinds of associations between them. Reproducing this effect in a computer model would require some mechanism for dynamically adjusting the probabilities of entire categories of nodes, depending on which other nodes have been visited lately. Assume that the data structure representing a node of the network includes a list of links to other nodes and a corresponding list of weights. In code—specifically in the Julia programming language—the node selection procedure looks like this:
I have slogged through these tedious details of cumulative sums and pseudorandom numbers as a way of emphasizing that the graph-walking algorithm is not as simple as it seems on first glance. In the computational model, inserting a node for babochka is easy enough, but the new node also needs to be linked to all the other butterfly nodes already present.
Source: bit-player.org