The Python implementation of the Dijkstra algorithm