The provided statement about Tarjan's bridge-finding algorithm contains both correct and incorrect assertions.
First, let's address the initial part:
"Tarjan算法在无向连通图(V, E)上求割边,需要维护两个O(V)大小的数组:dfn[u]是DFS首次到达结点u的时间戳;low[u]是u及其在DFS树上的后代通过零或一条非树边所能到达的所有结点的dfn值中的最小值。" (Tarjan's algorithm for finding bridges in an undirected connected graph (V, E) needs to maintain two O(V) size arrays: dfn[u] is the timestamp when DFS first reaches node u; low[u] is the minimum of dfn values of all nodes reachable from u and its descendants in the DFS tree via zero or one non-tree edge.) This is generally correct for the standard Tarjan's algorithm for finding bridges. The algorithm typically uses dfn (discovery time or pre-order traversal number) and low (low-link value) arrays of size O(V)[1][2][3]. The definitions of dfn and low are also correct as described[10][3][4].
Now, let's evaluate the subsequent claims:
-
"下面将说明:算法仅需要一个数组。" (The following will explain: the algorithm only needs one array.) Based on standard implementations and descriptions found in the search results, Tarjan's algorithm for bridges requires both dfn and low arrays[1][2][3]. There's no indication in the standard algorithm or common variations that it can be done with just one array. Some descriptions mention using a stack, but that's in addition to dfn and low (often for finding strongly connected components in directed graphs, though related concepts apply)[10][12][13]. Therefore, this claim is incorrect for the standard algorithm.
-
"DFS是深度优先的,因此结点u的处理将在其所有后代的处理结束后结束。dfn[u]仅和u有关;low[u]仅和u及其后代有关。因此在对u的首次处理结束时,其dfn值和low值已确定。因此可以通过记忆化让DFS仅处理每个节点一次。则在u处理未结束时,其余的处理未结束的结点必为u的所有祖先。" (DFS is depth-first, so node u's processing will end after the processing of all its descendants ends. dfn[u] is only related to u; low[u] is only related to u and its descendants. Therefore, when the first processing of u ends, its dfn value and low value are determined. Thus, through memoization, DFS can process each node only once. Then, when u's processing is not finished, the remaining unprocessed nodes must be all ancestors of u.)
- DFS processing order and finishing after descendants is correct.
dfn[u] is determined upon first visit, true.
low[u] is determined after visiting all children and considering back edges from the subtree, true[10][3][5].
- Memoization (or using a
visited array/checking dfn) ensures each node is processed once, true[5][7].
- "则在u处理未结束时,其余的处理未结束的结点必为u的所有祖先。" (Then, when u's processing is not finished, the remaining unprocessed nodes must be all ancestors of u.) This part is incorrectly phrased or conceptually flawed. Nodes whose processing has not finished (i.e., currently on the recursion stack) are
u and its ancestors in the DFS tree. However, the term "处理未结束的结点" could also be interpreted as "not yet visited nodes," which would be nodes in parts of the graph not yet explored from the current component/DFS tree. If it means nodes in the call stack, then it's correct that they are ancestors. But the phrasing is ambiguous. Given the context, it likely refers to the call stack.
-
"无向图中结点之间的可达性是双向的,因此在结点u处理未结束时,通过一条非树边到达一个处理已结束的结点v,则v必为u的后代:若不然,则在v处理结束时DFS可以到达却尚未到达u,与深度优先矛盾。" (Reachability between nodes in an undirected graph is bidirectional, so when node u is not finished processing, reaching a finished processed node v through a non-tree edge, then v must be a descendant of u: otherwise, when v finished processing, DFS could reach u but hasn't reached it yet, which contradicts depth-first.) This reasoning is fundamentally incorrect for undirected graphs.
- In an undirected graph, a non-tree edge discovered during DFS from node
u (currently being processed) can only connect u to an already visited node v. If v is already visited, it is either the parent of u (which is usually handled as a special case not to be considered a back edge for low calculation, or its dfn is correctly used) or an ancestor of u[3][14][15]. Non-tree edges in an undirected graph DFS are always back edges connecting a node to one of its ancestors[10][3][14]. They never connect a node to a descendant (that would be a tree edge) or a node in a completely different, already finished subtree (cross edge, which doesn't exist in undirected DFS)[3][14].
- Therefore, if
u is processing and encounters an edge (u, v) where v is already processed and v is not u's immediate parent, v must be an ancestor of u, not a descendant.
- The reasoning provided ("若不然,则在v处理结束时DFS可以到达却尚未到达u,与深度优先矛盾") is based on the incorrect premise that
v would be a descendant.
Conclusion:
The initial description of Tarjan's algorithm using dfn and low arrays is correct. However, the claim that the algorithm only needs one array, and the subsequent reasoning provided to support this claim, are incorrect. The reasoning contains a critical error regarding the nature of non-tree edges in undirected graph DFS – a non-tree edge from a node u being processed to an already processed node v implies v is an ancestor of u, not a descendant.
Since the core premise and reasoning for needing only one array are flawed, the statement that the algorithm only needs one array is not justified by the provided text and contradicts the standard implementation of Tarjan's bridge-finding algorithm which uses two arrays (dfn and low).
Therefore, the statement """Tarjan算法在无向连通图(V, E)上求割边...下面将说明:算法仅需要一个数组...""" is incorrect because the standard algorithm requires two arrays, and the explanation provided for needing only one array contains fundamental errors regarding undirected graph DFS properties.