<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph represented as a list of edges [(1, 2), (2, 3), (3, 1), (4, 5)], how can you generate and print all the strongly connected components as well as identify the largest strongly connected component using NetworkX's strongly_connected_components_recursive function? How would you create subgraphs for each of these components?
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph()

# Add edges to the graph (nodes are added automatically)
G.add_edges_from([(1, 2), (2, 3), (3, 1), (4, 5)])

# Generate the strongly connected components
strongly_connected_components = list(nx.strongly_connected_components_recursive(G))

# Print the strongly connected components
print('Strongly connected components:', strongly_connected_components)

# If you only need the largest strongly connected component
largest_component = max(strongly_connected_components, key=len)
print('Largest strongly connected component:', largest_component)

# To create the induced subgraphs for each component
cocomponent_subgraphs = [G.subgraph(c).copy() for c in strongly_connected_components]
print('Subgraphs of each component:', cocomponent_subgraphs)
<|EOT|>
