Definition · Bridge and cut vertexAn edge of a connected undirected graph is a bridge if deleting it leaves a graph with more components. A vertex is a cut vertex if deleting it, and every edge at it, does the same. Neither definition mentions an algorithm, and the slow method is a direct transcription of them: delete, recount, restore.
That slow method costs one walk per candidate, so Θ(E(V + E)) for the edges. It is also completely reliable, which is why the lab runs it as an independent answer beside the fast one rather than as a fallback. On the opening graph both report the single bridge between 3 and 4 and the two cut vertices 3 and 4, and the panel prints the comparison rather than the agreement it expects.
Definition · The low-link valueFor a vertex v of a depth-first forest on an undirected graph, low[v] is the minimum of d[v], of low[c] over the children c of v, and of d[w] over every vertex w joined to v by a non-tree edge. Equivalently it is the smallest discovery time reachable from v using tree edges downwards and then at most one non-tree edge.
The recursive form is what makes it computable in the walk: low[v] is finished exactly when v closes, because by then every child has closed and every edge at v has been examined. So the cost is the walk's cost and nothing more. On the opening graph the panel counts 6 vertex visits and 18 edge reads, against Θ(V + E) — 18 rather than 7 because each edge is considered from both of its ends, the adjacency index holds it at each end both as leaving and as entering, and the one arc the walk arrived on is skipped at every vertex but the root.
Theorem · The bridge testLet (u, v) be a tree edge with v the child. Then (u, v) is a bridge if and only if low[v] > d[u].
Suppose low[v] > d[u]. Every vertex in the subtree at v has all its edges going either inside that subtree or upwards to a vertex discovered no earlier than v — if any went to something discovered before u or to u itself, low[v] would be at most d[u]. So the only edge leaving the subtree is (u, v), and deleting it separates the subtree from the rest.
Conversely, suppose low[v] ≤ d[u]. Then some vertex x in the subtree at v has a non-tree edge to a vertex discovered at or before u, which in an undirected walk means an ancestor of v at or above u. The tree path from v down to x, that edge, and the tree path back down to v form a cycle through (u, v), and no edge on a cycle is a bridge.
□
Example · Two triangles joined by one edgeThe lab opens on 1-2, 2-3, 3-1, 3-4, 4-5, 5-6, 6-4. The walk discovers the vertices in order, so d is 1, 2, 3, 4, 5, 6, and the low values are 1, 1, 1, 4, 4, 4. The tree edge from 3 to 4 has low[4] = 4 > d[3] = 3, so it is a bridge; every other tree edge fails the test because its child sits on a triangle and can climb back. Cut vertices: 3, because its child 4 has low[4] >= d[3], and 4, because its child 5 has low[5] = 4 >= d[4] = 4. Delete-and-recount returns the same three answers.
The two tests are nearly the same and differ by one comparison
The bridge test is low[v] > d[u] and the cut-vertex test is low[v] >= d[u]. Equality is the case where the subtree can climb back to u itself but no higher: then the edge (u, v) lies on a cycle and is not a bridge, while u is still the only way in and out, so u is a cut vertex. The lab's opening graph has both endpoints of its bridge as cut vertices; its path preset has four bridges and three cut vertices, because the two ends of a path are on a bridge without being cut vertices.
And in the other direction, a cut vertex need not be on a bridge at all. Two triangles sharing a single vertex have that vertex as a cut vertex and no bridge anywhere, because every edge is on a triangle. Neither concept implies the other, and a reader who has only seen the opening graph will believe they come in pairs.
Exclusion is by arc, and that is not a technicality
The walk must not follow the edge it arrived on, and the way to enforce that is to remember the EDGE and not the parent vertex. With two edges between the same pair, remembering the parent vertex would ignore both, and the graph would be reported as having a bridge that it does not have. The lab ships this as a preset: on 1-2, 1-2, 2-3 the only bridge is the one between 2 and 3, whereas with a single edge between 1 and 2 the same three vertices give two bridges.
That preset is also where the independent check stops. The delete-and-recount oracle works on an adjacency matrix, which holds one entry per pair of vertices and therefore cannot represent two edges between the same pair at all. The panel says so, in those words, rather than comparing against a different graph and reporting agreement. A checker that quietly answers a question you did not ask is worse than one that declines.
Put the two figures side by side one last time. On the opening graph: 6 visits and 18 reads for the one-pass method, against a delete-and-recount that runs a fresh traversal for each of the 7 edges. Those are measurements on that graph. The bound is that the one-pass method is Θ(V + E) on every graph, and the reason is that low is completed at the moment a vertex closes, so no vertex and no edge is revisited.