<｜begin▁of▁sentence｜>### Instruction:
Imagine you're at the pool, and we're not talking about swimming lanes, but conceptual lanes in a competition of patterns. Consider two separate routines demonstrated by teams of synchronized swimmers. The first routine involves three swimmers--let's call them Swimmers 1, 2, and 3. They execute a sequence where Swimmer 1 pairs with Swimmer 2 and then Swimmer 2 pairs with Swimmer 3. In the second routine, there's a different trio--Swimmers 4, 5, and 6--and they mirror a similar sequence: Swimmer 4 pairs with Swimmer 5, followed by Swimmer 5 pairing with Swimmer 6.

From the pool deck, as a swim instructor known for attention to detail, you're curious whether these two routines show a deep resemblance in structure, despite involving different swimmers. We're not diving into the judgement just yet, but how would you go about confirming if these routines are, in a sense, synchronized swimming twins, with only the swimmers being interchangeable?
### Response:
import networkx as nx
from networkx.algorithms.isomorphism import is_isomorphic

# Create two graphs G1 and G2
G1 = nx.Graph()
G2 = nx.Graph()

# Add nodes and edges to the first graph G1
G1.add_nodes_from([1, 2, 3])
G1.add_edges_from([(1, 2), (2, 3)])

# Add nodes and edges to the second graph G2
G2.add_nodes_from([4, 5, 6])
G2.add_edges_from([(4, 5), (5, 6)])

# Check if the two graphs are isomorphic
result = is_isomorphic(G1, G2)
print('G1 and G2 are isomorphic:', result)
<|EOT|>
