for my learning an algorithm of Dijkstra's one.