At every junction the bee must choose which branch to fly. Each choice has a learned "memory strength" — after a successful trip to the flower, every branch taken on that trip is reinforced; a wrong turn is not.
choose branch with probability proportional to memory strength
(with exploration_rate chance of picking a random branch instead)
on success: strength(edge) += learning_rate * (1 - strength(edge)) for every edge used
efficiency = optimal_steps / steps_taken_this_trial
- Learning rate — how strongly a successful trip reinforces the branches it used.
- Exploration rate — chance of trying an untested branch instead of the current best-known one; mirrors real foraging bees occasionally scouting new routes.
- Forget (reset) — clears all learned branch strengths back to naive/uniform.
This is a simplified but real model of insect route learning: honeybees are known to memorize efficient multi-flower routes ("trap-lining") using very similar trial-and-reinforcement dynamics, despite a brain smaller than a grain of rice.