Write an efficient algorithm to find the shortest path in a dynamic grid network where edge weights can change over time.