(at, parent, bridges, id_)
| 78 | visited = [False] * n |
| 79 | |
| 80 | def dfs(at, parent, bridges, id_): |
| 81 | visited[at] = True |
| 82 | low[at] = id_ |
| 83 | id_ += 1 |
| 84 | for to in graph[at]: |
| 85 | if to == parent: |
| 86 | pass |
| 87 | elif not visited[to]: |
| 88 | dfs(to, at, bridges, id_) |
| 89 | low[at] = min(low[at], low[to]) |
| 90 | if id_ <= low[to]: |
| 91 | bridges.append((at, to) if at < to else (to, at)) |
| 92 | else: |
| 93 | # This edge is a back edge and cannot be a bridge |
| 94 | low[at] = min(low[at], low[to]) |
| 95 | |
| 96 | bridges: list[tuple[int, int]] = [] |
| 97 | for i in range(n): |
no test coverage detected