Unlike breadth-first search, whose predecessor subgraph forms a tree, the predecessor subgraph produced by a depth-first search may be composed of several trees, because the search may repeat from multiple sources.

对这里的理解可能会出一些问题。

首先,是对前驱子图的理解,

前驱子图(predecessor subgraph)指的是在搜索算法中,从初始节点开始,搜索过程中访问的所有节点及其与初始节点的关系所形成的子图。

然后,是对这一点的理解:bfs 只会形成一棵树,dfs 可能生成多棵树。理解这里的关键在于,dfs 可以有多个起始节点,而 bfs 一般只可以有一个起始节点,这是由 dfs 和 bfs 的性质决定的,dfs 可以往前回溯,而 bfs 则是一层一层涟漪一样向外扩展,并不会回溯到之前的回溯,而 dfs 则是可以一直回溯到起点的,回溯到起点的时候,也就是会创建其他的树的时机。

好吧,其实这一页下面的注释解释了这个问题:

It may seem arbitrary that breadth-first search is limited to only one source whereas depth-first search may search from multiple sources. Although conceptually, breadth-first search could proceed from multiple sources and depth-first search could be limited to one source, our approach reflects how the results of these searches are typically used. Breadth-first search usually serves to find shortestpath distances (and the associated predecessor subgraph) from a given source. Depth-first search is often a subroutine in another algorithm, as we shall see later in this chapter.