Fixed overflow in dynamic algorithm for extremely large problem instances