IDA*’s Contour Procedure
function Contour(current, limit)
cost Cost(current) + Heuristic(current)
if limit < cost then return null, cost
if Goal(current) then return solution, cost
new-limit 1
for each next in Expand(current)
do result, cost Contour(next, limit)
if result then return solution, cost
new-limit min(new-limit, cost)
return failure, new-limit
function Contour(current, limit)
cost Cost(current) + Heuristic(current)
if limit < cost then return null, cost
if Goal(current) then return solution, cost
new-limit 1
for each next in Expand(current)
do result, cost Contour(next, limit)
if result then return solution, cost
new-limit min(new-limit, cost)
return failure, new-limit
No comments:
Post a Comment