search.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:Pacman-AI 作者: ryanshrott 项目源码 文件源码
def breadthFirstSearch(problem):
    """
    Search the shallowest nodes in the search tree first.
    """

    # Use the genericSearch method, with the fringe maintained with a Queue so 
    # that all nodes on the same level are explored before the next level is 
    # explored. This will find the optimal solution, because each level is 
    # explored before the next, so the first time the goal is reached will be
    # the shortest path to the goal.
    return genericSearch(problem, util.Queue())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号