A multigraph-based selective update method for the efficient solution of dynamic programming