implement simple Dijkstra algorithm to find one shorest path