A computer science student's supermarket sweeping experiment reveals how optimizing for the wrong metrics creates impractical solutions, with profound implications for tech algorithms.
When Ties Petersen took a minimum-wage job sweeping floors at Albert Heijn supermarket, he encountered what appeared to be a straightforward task. But as a computer science student with optimization instincts, he saw an algorithmic challenge. His journey from grid-based pathfinding to simulated annealing reveals a critical flaw affecting technology far beyond supermarket aisles.

The core problem seemed simple: find the most efficient path to sweep every tile of the supermarket floor. Petersen converted the store layout into a grid graph
, treating each tile as a node. Using Processing for visualization, he mapped obstacles like walls and checkout counters before implementing a C++ optimizer based on simulated annealing.
His initial approach minimized total distance traveled – a mathematically sound objective. The algorithm produced Path A
, technically optimal but practically absurd. "That path has more sharp turns than a Christopher Nolan movie," Petersen observed. While mathematically efficient, the route was physically impossible for humans to navigate comfortably.

The breakthrough came when Petersen realized he was optimizing for the wrong metric. By adding a turn penalty to his cost function, he created Path B – slightly longer but actually walkable. Adjusting this penalty created a spectrum of solutions
, demonstrating the trade-off between theoretical efficiency and practical utility.
This experiment extends far beyond supermarket floors. Petersen draws disturbing parallels to technology ecosystems:
- Social media algorithms optimize for engagement metrics, amplifying outrage and misinformation despite negative user experiences
- Recommendation systems maximize watch time, trapping users in conspiracy rabbit holes
- Large language models prioritize confident-sounding responses over factual accuracy
- Businesses fixate on profit metrics while ignoring environmental and ethical costs
"Technical correctness is worthless if you're solving the wrong problem," Petersen concludes. The supermarket floor experiment demonstrates that flawlessly executed optimization toward misaligned objectives creates solutions that are mathematically perfect yet fundamentally broken.
The GitHub repository for Petersen's experiment provides a tangible case study in cost function design. As venture-backed companies deploy increasingly sophisticated optimization systems, his work underscores the importance of aligning algorithmic objectives with human values – before the annealing process begins.


Comments
Please log in or register to join the discussion