search.py 文件源码

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

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

    Your search algorithm needs to return a list of actions that reaches
    the goal.  Make sure to implement a graph search algorithm

    To get started, you might want to try some of these simple commands to
    understand the search problem that is being passed in:

    print "Start:", problem.getStartState()
    print "Is the start a goal?", problem.isGoalState(problem.getStartState())
    print "Start's successors:", problem.getSuccessors(problem.getStartState())
    """

    # Use the genericSearch method, with the fringe maintained using a Stack
    # so that the search proceeds in the order of exploring from the node last
    # discovered
    return genericSearch(problem, util.Stack())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号