def _cut_dfs(graph, spanning_tree, pre, low, reply, node):
pre[node] = pre[None]<EOL>low[node] = pre[None]<EOL>pre[None] = pre[None] + <NUM_LIT:1><EOL>for each in graph[node]:<EOL><INDENT>if (each not in pre):<EOL><INDENT>spanning_tree[each] = node<EOL>_cut_dfs(graph, spanning_tree, pre, low, reply, each)<EOL>if (low[node] > low[each]):<EOL><INDENT>low[node] = low[each]<EOL><DEDENT>if (low[each] == pre[each]):<EOL><INDENT>reply.append((node, each))<EOL><DEDENT><DEDENT>elif (low[node] > pre[each] and spanning_tree[node] != each):<EOL><INDENT>low[node] = pre[each]<EOL><DEDENT><DEDENT>
Depth first search adapted for identification of cut-edges and cut-nodes.

@type  graph: graph, digraph
@param graph: Graph

@type  spanning_tree: dictionary
@param spanning_tree: Spanning tree being built for the graph by DFS.

@type  pre: dictionary
@param pre: Graph's preordering.

@type  low: dictionary
@param low: Associates to each node, the preordering index of the node of lowest preordering
accessible from the given node.

@type  reply: list
@param reply: List of cut-edges.

@type  node: node
@param node: Node to be explored by DFS.