Updating distances in dynamic graphs