From b88a3bc743f6ade7f49861ab437538b09b29801c Mon Sep 17 00:00:00 2001 From: Leandro Casuso Montero <32684478+casuso@users.noreply.github.com> Date: Sat, 15 Sep 2018 12:20:48 -0700 Subject: [PATCH] Remove unnecessary goal test in search.py Remove unnecessary initial goal test in best_first_graph_search. The loop will catch that case immediately. --- search.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/search.py b/search.py index 0504fba59..aa556c3a0 100644 --- a/search.py +++ b/search.py @@ -263,8 +263,6 @@ def best_first_graph_search(problem, f): a best first search you can examine the f values of the path returned.""" f = memoize(f, 'f') node = Node(problem.initial) - if problem.goal_test(node.state): - return node frontier = PriorityQueue('min', f) frontier.append(node) explored = set()