Skip to content

Commit a383e93

Browse files
Casusonorvig
authored andcommitted
Remove unnecessary goal test in search.py (aimacode#953)
Remove unnecessary initial goal test in best_first_graph_search. The loop will catch that case immediately.
1 parent ad429c1 commit a383e93

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

search.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,6 @@ def best_first_graph_search(problem, f):
263263
a best first search you can examine the f values of the path returned."""
264264
f = memoize(f, 'f')
265265
node = Node(problem.initial)
266-
if problem.goal_test(node.state):
267-
return node
268266
frontier = PriorityQueue('min', f)
269267
frontier.append(node)
270268
explored = set()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy