def connected_components(graph):
recursionlimit = getrecursionlimit()<EOL>setrecursionlimit(max(len(graph.nodes())*<NUM_LIT:2>,recursionlimit))<EOL>visited = {}<EOL>count = <NUM_LIT:1><EOL>for each in graph:<EOL><INDENT>if (each not in visited):<EOL><INDENT>_dfs(graph, visited, count, each)<EOL>count = count + <NUM_LIT:1><EOL><DEDENT><DEDENT>setrecursionlimit(recursionlimit)<EOL>return visited<EOL>
Connected components.

@type  graph: graph, hypergraph
@param graph: Graph.

@rtype:  dictionary
@return: Pairing that associates each node to its connected component.