diff --git a/md/Breadth-First-Search.md b/md/Breadth-First-Search.md index 684d655..2d2d8dc 100644 --- a/md/Breadth-First-Search.md +++ b/md/Breadth-First-Search.md @@ -6,17 +6,18 @@ __function__ BREADTH-FIRST-SEARCH(_problem_) __returns__ a solution, or failure  __if__ problem's initial state is a goal __then return__ empty path to initial state  _frontier_ ← a FIFO queue initially containing one path, for the _problem_'s initial state  _reached_ ← a set of states; initially empty - _solution_ ← failure  __while__ _frontier_ is not empty __do__ -   _parent_ ← the first node in _frontier_ +   _path_ ← the first path in _frontier_ +   _parent_ ← the last node in _path_    __for__ _child_ __in__ successors(_parent_) __do__      _s_ ← _child_.state      __if__ _s_ is a goal __then__ -       __return__ _child_ +       __return__ _path_      __if__ _s_ is not in _reached_ __then__        add _s_ to _reached_ -       add _child_ to the end of _frontier_ - __return__ _solution_ +       add _child_ to the end of _path_ +       add _path_ to the end of _frontier_ + __return__ _None_ --- __Figure 3.9__ Breadth-first search algorithm.