'"Cutoff" values in iterative deepening search
I am trying to finish my AI assignment with iterative deepening search. But when I expand the code, I can't understand what value "cutoff" variable has so I can't continue my homework. My teacher refers and teaches us the algorithm from "Russell 2016 Artificial intelligence a modern approach". Please help me. Thank everyone.

`def depth_limited_search(problem, limit=50):
"""See [Figure 3.17] for the algorithm"""
return recursive_dls(Node(problem.initial), problem, limit)
def recursive_dls(node, problem, limit) :
cutoff = ??? ;
if problem.goal_test(node.state) :
return node
elif limit == 0 :
return cutoff
else :
cutoff_occurred = False
for child in node.expand(problem) :
result = recursive_dls(child, problem, limit - 1)
if result == cutoff :
cutoff_occurred = True
elif result != None :
return result
if cutoff_occurred :
return cutoff
else :
return None
''' IMPLEMENT THE FOLLOWING FUNCTION '''
def iterative_deepening_search(problem):
"""See [Figure 3.18] for the algorithm"""
depth = 0
while depth <= float('inf') :
result = depth_limited_search(problem, depth)
if result != cutoff :
return result`
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
