<｜begin▁of▁sentence｜>### Instruction:
Given a complete graph with 5 nodes, can you compute a random graph by swapping edges while preserving connectivity, using the NetworkX random_reference function?
### Response:
import networkx as nx

# Create a graph
G = nx.complete_graph(5)

# Compute a random graph by swapping edges of the original graph
randomized_graph = nx.random_reference(G, niter=5, seed=42)

print('Edges of the original graph:', G.edges())
print('Edges of the randomized graph:', randomized_graph.edges())
<|EOT|>
