<｜begin▁of▁sentence｜>### Instruction:
As a School Counselor, I help students navigate academic, career, and personal development. In my role, I provide counseling services to address a range of academic, behavioral, and emotional issues, working closely with educators and community agencies to support students' well-being and success.

One of the methods I use to support students is through network analysis, which can help identify social connections and support networks. Suppose we have a school with several students and we want to understand the connected components within their social network. We can use the 'clusters' method in the igraph API to identify the groups of students who are closely connected to each other. This information can help us better understand the social dynamics within the school and provide targeted support to individual students.

Given an undirected graph with edges (0, 1), (1, 2), (3, 4), I would like to use the 'clusters' method in the igraph API to find the connected components and list the node indices for each component. This will allow me to understand the social connections among the students and provide more personalized support where needed.
### Response:
import igraph as ig
import json

# Create a graph
g = ig.Graph(edges=[(0, 1), (1, 2), (3, 4)])

# Find the connected components - using the deprecated 'clusters' method
clusters = g.clusters()

# Convert the clusters to a list of node indices for each component
cluster_list = clusters.subgraphs()

# Print the node indices for each connected component
for i, cluster in enumerate(cluster_list):
    print(f'Connected component {i}:', cluster.vs['name'])
<|EOT|>
