Reference solution to Dijkstra's algorithm running as a server