weighted directed added with dijkstra's algorithm