Update Shortest Path algorithm