AWS Builder Center
Routing is harder than Google Maps makes it look

Routing is harder than Google Maps makes it look

Building toward AWS Builder Center's 21-badge challenge - here's a logistics route optimizer I built along the way, using Dijkstra, TSP optimization, and Yen's k-shortest-paths.

I built a logistics route optimizer and learned that "shortest route" and "best stop order" are two completely different problems.
Stack: React (Vite) + Tailwind + react-leaflet, Express + MongoDB Atlas, real road data via OSRM API.
Algorithms used:
  • Dijkstra for shortest path
  • TSP-style optimization for best stop order
  • Yen's k-shortest-paths for route comparisons
Fun bug: worked perfectly on localhost, silently failed on MongoDB Atlas after deploy -turned out to be an ISP-specific DNS issue, fixed by forcing Google DNS.
🔗 Demo: logistics-route-optimizer.netlify.app 💻 Code: github.com/Ansh-san/logistics-route-optimizer
Anyone else combine multiple algorithms for routing, or find a cleaner single approach?
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article