Free tools & games for everyone
Free · No sign-up · No accounts
Watch ants find food with scent trails: searching, carrying and following pheromone on a grid, plus the classic double-bridge shortest-path experiment.
| Tab | Move between tabs, boxes and buttons |
|---|---|
| Enter in a box | Start a new colony or run the bridge experiment |
| Click or tap the field | Drop food (with a keyboard, use the two food piles already there) |
Many ants find food together without a plan: each one follows simple rules about scent, called pheromone. This page models that on a grid of 100 by 60 cells. Each step an ant looks at the three cells ahead of it (left, straight, right) and picks one with a weight of (0.02 + scent) squared, doubled for going straight; with the wandering chance it picks at random instead. The scent an ant lays starts at 1 at the nest or the food and weakens by 1.5 % with every step it walks, so trails get stronger near their source and point the way. Scents fade by the set percentage every step. It is a teaching model, not a copy of any real species.
The double bridge follows the experiments of Jean-Louis Deneubourg, Simon Goss and colleagues with Argentine ants (1989-1990) and their choice formula with k = 20 and n = 2: the chance of the short bridge is (k + A)2 / ((k + A)2 + (k + B)2), where A and B count the marks ants have left at that end of each bridge (an ant marks the end it enters and the end it leaves). Ants on the short bridge reach the food first, so the food end of the short bridge gets marked first and returning ants pick it; with a bridge twice as long, the short one wins in about three colonies out of four here. The same idea inspired "ant colony optimisation" algorithms for routing problems. Runs are seeded, so the same settings and seed always give the same result. Everything runs in your browser.
A fresh daily puzzle every morning, and new tools added every month.
Browse every product