<｜begin▁of▁sentence｜>### Instruction:
Imagine you're working on a brochure layout to visually represent a community's connectedness, and we're using a series of lines and dots to symbolize the pathways between different landmarks. We've got a set of connections outlined: between Landmark 1 and 2, Landmark 2 and 3, Landmark 3 and 4, Landmark 4 and 5, and then back from Landmark 5 to 1, forming a loop. To bring out the essence of the community's interconnected synergies, we want to highlight the longest direct route one could travel between any two landmarks in our graphic network. Could you determine what this longest stretch would be within our visual concept using NetworkX to ensure our design communicates the vast reach of the community's linkage?
### Response:
import networkx as nx

# Create an undirected graph
G = nx.Graph()
G.add_edges_from([(1, 2), (2, 3), (3, 4), (4, 5), (5, 1)])

# Compute the diameter of the graph
try:
    diameter = nx.diameter(G)
    print('Diameter of the graph:', diameter)
except nx.NetworkXError as e:
    print(e)
<|EOT|>
