It looks like you need the shortest path for the same source and target
every time. And you change a single weight each time.
topology.shortest_path return a list of edges. Why not check if the edge
weight increased or decreased?
There should be two cases where you don't have to recompute. One is where
the edge weight decrease and that edge belongs to the list. The other case
is where one weight increase and don't belong to the list.