<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with edge set [(0, 1), (1, 2), (2, 3), (3, 4)], how can we compute the trophic levels of each node using NetworkX?
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph()
G.add_edges_from([(0, 1), (1,2), (2, 3), (3, 4)])

# Compute the trophic levels
levels = nx.trophic_levels(G)
print('Trophic levels:', levels)
<|EOT|>
