Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct Recursive-Best-First-Search.md #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions md/Recursive-Best-First-Search.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# RECURSIVE-BEST-FIRST-SEARCH

## AIMA4e
__function__ RECURSIVE-BEST-FIRST-SEARCH(_problem_) __returns__ a solution, or failure
 __return__ RBFS(_problem_,MAKE\-NODE(_problem_.INITIAL\-STATE),∞)

__function__ RBFS(_problem_,_node_,_f\_limit_) __returns__ a solution, or failure and a new _f_\-cost limit
 __if__ _problem_.GOAL-TEST(_node_.STATE) __then return__ _node_
 _successors_ ← EXPAND(_node_)
 __if__ _successors_ is empty __then return__ _failure_,∞
 __for__ _s_ __in__ _successors_ __do__ /\* update _f_ with value from previous search, if any \*/
   _s.f_ ← max(_s.g_ + _s.h_, _node.f_)
 __loop do__
   _best_ ← lowest _f_\-value node in _successors_
   __if__ _best.f_ > _f\_limit_ __then return__ _failure, best.f_
   _alternative_ ← the second-lowest _f_\-value among _successors_
   _result,best.f_ ← RBFS(_problem_,_best_,min(_f\_limit_,_alternative_))
   __if__ _result_ ≠ _failure_ __then return__ _result, best.f_

---
__Figure__ 3.5 The algorithm for recursive best\-first search.


## AIMA3e
__function__ RECURSIVE-BEST-FIRST-SEARCH(_problem_) __returns__ a solution, or failure
 __return__ RBFS(_problem_,MAKE\-NODE(_problem_.INITIAL\-STATE),∞)
Expand Down