Update graph and path