This code demonstrates stigmergy in ants in a discrete graph. Animation is implemented using the Tkinter library. The ants lay a "To Home" pheromone while foraging for food and lay a "To Food" pheromone while assimilating food at the nest.
The initial foraging is random, but the ants are made to maintain their direction of travel for at least two passes. This ensures better area exploration and avoids wasteful waggle around one point.