Tracing and Returning a Path in Depth First Search

前端 未结 4 1962
青春惊慌失措
青春惊慌失措 2021-01-30 09:19

So I have a problem that I want to use depth first search to solve, returning the first path that DFS finds. Here is my (incomplete) DFS function:

    start = pr         


        
4条回答
  •  一向
    一向 (楼主)
    2021-01-30 09:45

    this link should help you alot ... It is a lengthy article that talks extensively about a DFS search that returns a path... and I feel it is better than any answer I or anyone else can post

    http://www.python.org/doc/essays/graphs/

提交回复
热议问题