<｜begin▁of▁sentence｜>### Instruction:
Given an undirected graph with vertices 0 to 4 and edges [(0, 1), (1, 2), (2, 3), (3, 4)], how do you calculate its diameter using igraph's diameter function?
### Response:
from igraph import Graph

# Creating a graph with 5 vertices and a few edges
g = Graph(edges=[(0, 1), (1, 2), (2, 3), (3, 4)], directed=False)

# Calculating the diameter of the graph
diameter = g.diameter(directed=False, unconn=True, weights=None)

print('Diameter of the graph:', diameter)
<|EOT|>
