<｜begin▁of▁sentence｜>### Instruction:
{'Description': "Given a directed graph with a cycle that includes the nodes [0, 1, 2], and an additional edge from node 2 back to node 0, this Python code uses NetworkX's recursive_simple_cycles function to find all the simple cycles (elementary circuits) within that directed graph. The example provided computes these cycles and prints them out.", 'Problem_Solved': 'The code identifies each distinct cycle where no node appears twice, thereby listing all elementary circuits in the directed graph.'}
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph()
G.add_cycle([0, 1, 2])
G.add_edge(2, 0)

# Find simple cycles in the graph using the recursive algorithm
all_cycles = list(nx.recursive_simple_cycles(G))

print('All simple cycles found:', all_cycles)
<|EOT|>
