← Amelia Zhang
05·C++·Jan–Apr 2025

The Traveller

A C++ routing engine over real map data. The competition scored path quality under a hard per-query runtime limit — you could win on either axis in isolation and still lose overall.

6 / 74
Teams, final ranking
A*
Custom heuristics
ACO + SA
Multi-stop tours
C++
Bare metal
Problem

Given a real street graph, answer routing and multi-stop tour queries under a hard wall-clock cap per query. Score is a function of path quality — a shorter path wins, but a timed-out query wins nothing at all. Every optimization is a bet against the deadline.

Classical shortest-path is only half the problem. The multi-stop leg is TSP-shaped and doesn't have an exact solution inside the budget.

Approach

Two-tier routing. Point-to-point queries use A* with a custom admissible heuristic tuned to the map's geometry, falling back to Dijkstra only where the heuristic would degrade to worse than uniform.

Multi-stop tours use an anytime hybrid: ant colony optimization to build strong initial tours quickly, then simulated annealing to refine under the remaining budget. Both are anytime — the current best is always ready to return the instant the timer expires.

Most of the ranking wasn't algorithm choice, it was constant factors. Cache-friendly adjacency layout, tight priority-queue implementation, avoiding allocation on the hot path. The algorithm textbook picks the family; the profiler picks the winner.

Result

6th of 74 teams in the course-wide competition. The teams above weren't doing categorically different algorithms — they were tighter on the constant-factor work, which is exactly where I'd spend the next iteration.

The lesson worth carrying: under a hard runtime cap, anytime algorithms and a tight profile-guided inner loop beat a cleaner algorithm that occasionally times out.

Stack
C++·A*·Dijkstra·Ant colony optimization·Simulated annealing·EZGL / GTK