Support a basic Dijkstra search algorithm.