Last active
August 29, 2015 14:21
-
-
Save kartikkukreja/ba07e7a78cec0b884406 to your computer and use it in GitHub Desktop.
General Tree Search Algorithm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def TreeSearch(problem, strategy): | |
Initialize search tree using the state state of problem | |
while True: | |
if there are no candidates for expansion: | |
return failure | |
choose a leaf node for expansion according to strategy | |
if the node contains a goal state: | |
return the corresponding solution | |
else: | |
expand the node and add its successors to the search tree |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment