5 ms·
This is a lovely article, and I feel there's a lifetime of lessons to be learned from any colony behaviour. I've recently submitted a thesis on a swarm intellig
by AndrewOMartin 8y ago
This is a lovely article, and I feel there's a lifetime of lessons to be learned from any colony behaviour. I've recently submitted a thesis on a swarm intelligence algorithm which exhibits some of these qualities, and the parallels between the two was a core component of the contribution.
This effect, where something is globally stable, even though all the individuals that make it happen are unstable is sometimes described as "a forest whose contours remain the same, as the trees all change".
Consider this algorithm for an ant colony foraging for a good source of food (this behaviour has also been observed in ants searching for a new nest site):
for each ant in the swarm
if the ant is unhappy
run to a random ant
if the random ant is happy
follow it to its location
if the random ant is unhappy
select a location at random
if the ant is happy
the ant continues to search its current location
for each ant in the swarm
the ant searches a tiny of its location, at random
if the ant finds food
the ant becomes happy
if the ant doesn't find food
the ant becomes unhappy
If you run this algorithm you will find a "clusters" of ants form, which is a number of ants who share the same foraging location. Importantly, and this is mathematically proven, the largest cluster will form in the location with the best probability for finding food. This algorithm works even when the locations change over time and, as in the article, even when the ants which found the location are replaced with ants who have simply followed other ants to get there.
The aspect which captured my attention is that there are tiny changes to individual lines of the algorithm which implement diverse behaviours such as hill climbing, optimise for exploitation or exploration, and global optimisation.
The algorithm is called Stochastic Diffusion Search and I'm in the process of polishing a Python library which implements it and its many variants for a Show HN :) The repo is here https://github.com/AndrewOwenMartin/sds https://github.com/AndrewOwenMartin/sds some info and an explanatory animation here http://www.aomartin.co.uk/sds-animation/ http://www.aomartin.co.uk/sds-animation/ and an beta version is already on PyPi here https://pypi.org/project/sds/ https://pypi.org/project/sds/.
Contact me (email address on my profile) if you're interested in using this algorithm or contributing to the library, it needs snappy C implementations, and a better explanatory animation!
- newman8r 8y agoCould you model this as a cellular automaton? Kind of reminds me of that. Sounds cool.
- AndrewOMartin 8y agoEach ant, or "agent", just needs to store its "activity" (whether its happy or unhappy) and its "hypothesis" (its current location). You don't even need to store the hypothesis of inactive agents, so it's pretty minimal as it is, it's not clear how you would make it a cellular automaton. I have some ideas, but what did you have in mind?
- newman8r 8y agoTake a look at this visualization https://www.youtube.com/watch?v=VsHc91IhzdI https://www.youtube.com/watch?v=VsHc91IhzdI There's a repo in the description. Might not be specifically relevant to your project though
- cgh 8y agoSeems as good a time as any to mention this excellent book: https://mitpress.mit.edu/books/ant-colony-optimization https://mitpress.mit.edu/books/ant-colony-optimization Really interesting stuff. There is code online somewhere. It's possible ant colony optimisation is dated now, I don't really know, but it's still fascinating.
- blixt 8y agoThese emergent behaviors from relatively simple rules fascinate me. Have you seen https://pixling.world https://pixling.world ? It’s basically a tool to build systems with rules for both a grid (environments) and agents on that grid (pixlings). It’s quite advanced - every agent can have a neural network that is mutated to choose what rules to run instead of you hard coding it, and agents can split which causes a slight mutation in the new agent (evolution).
- zachguo 8y agoIt reminds me my old days playing with NetLogo. Multi-agent modeling and complex system.