BaseDijkstra: working version and tests