File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1- # GENERIC -SEARCH
1+ # GRAPH -SEARCH
22
33## AIMA4e
44
55
6- __ function__ GENERIC -SEARCH(_ problem_ ) __ returns__ a solution, or failure
6+ __ function__ GRAPH -SEARCH(_ problem_ ) __ returns__ a solution, or failure
77&emsp ; _ frontier_ &larr ; a queue initially containing one path, for the _ problem_ 's initial state
88&emsp ; _ reached_ &larr ; a table of {_ state_ : the best path that reached _ state_ }; initially empty
99&emsp ; _ solution_ &larr ; failure
1010&emsp ; __ while__ _ frontier_ is not empty __ and__ _ solution_ can possibly be improved __ do__
1111&emsp ;&emsp ;&emsp ; _ parent_ &larr ; some node that we choose to remove from _ frontier_
12- &emsp ;&emsp ;&emsp ; __ for__ _ child_ __ in__ successors (_ parent_ ) __ do__
12+ &emsp ;&emsp ;&emsp ; __ for__ _ child_ __ in__ Expand (_ parent_ ) __ do__
1313&emsp ;&emsp ;&emsp ;&emsp ;&emsp ; _ s_ &larr ; _ child_ .state
1414&emsp ;&emsp ;&emsp ;&emsp ;&emsp ; __ if__ _ s_ is not in _ reached_ __ or__ _ child_ is a cheaper path than _ reached_ [ _ s_ ] __ then__
1515&emsp ;&emsp ;&emsp ;&emsp ;&emsp ;&emsp ;&emsp ; _ reached_ [ _ s_ ] &larr ; _ child_
You can’t perform that action at this time.
0 commit comments