This was my Master's thesis in 2008. I investigated an extreme in distributed algorithms: how to program thousands of small, cheap, locally connected devices. For example, devices could be built into every floor or ceiling tile of a building, and be able to direct people to the nearest exit in an emergency. I showed how a simple algorithm could indicate the way out, and even route around threats, without any central computer.
This is a small, toy simulation to demonstrate the idea.