Is there any optimal algorithm for finding the shortest path in an undirected weighted graph?