Dijkstra pathfinding for venue navigation (seating-tracker)
The problem
Seating-tracker is a web app I built for managing event check-ins. The main feature people actually cared about was "I just checked in, where do I sit?" — and the venue was big enough that just giving someone a table number wasn't helpful. They needed actual directions.
So I needed some kind of pathfinding. The venue has entrances, tables, stages, buffet areas, and a bunch of open floor space. People can't walk through tables. I needed to find the shortest walkable path from an entrance to any given seat and then turn that into human-readable directions like "walk straight, turn left at the stage."
How I modeled it
I treated the venue as a graph. Each important location — entrances, table centers, buffet stations, stage corners — is a node with x/y coordinates. Edges connect nodes that have a walkable path between them, weighted by Euclidean distance.
The tricky part was preventing paths from cutting through non-walkable areas. If you just connect every node to every other node, the shortest path might go straight through a table. I solved this by adding "edge nodes" along the walkable corridors. These are invisible waypoints that define where people can actually walk. The graph only has edges between nodes that have a clear line of sight along these corridors.
The pathfinding
I used Dijkstra's algorithm with a priority queue. Nothing fancy — the venue graph is small enough that performance isn't really a concern. The algorithm finds the shortest path from the nearest entrance to the guest's assigned seat.
The more interesting part was translating the coordinate path into text directions. I calculate the angle between consecutive path segments and convert that into "turn left," "turn right," or "continue straight." The directions reference landmarks ("turn left at the stage") instead of raw coordinates, which makes them actually usable.
What I learned
The edge-node system was the key insight. Without it, paths would clip through obstacles and the directions would be nonsensical. With it, the pathfinding stays clean and the directions actually match what you'd tell someone in person. The venue also supports multiple layout templates — standard tables, VIP sections, conference halls — and the graph gets rebuilt dynamically based on which template is active.