A dynamic programming algorithm for informative measurements and near-optimal path-planning