Arranging for dynamic programming heuristic