<｜begin▁of▁sentence｜>### Instruction:
Given a simple undirected graph with edges (1, 2), (2, 3), (3, 4), and (4, 5), how can you perform two double edge swaps where each pair of edges is disconnected and reconnected with other nodes to create a small variation of the original graph while keeping the node degrees the same?
### Response:
import networkx as nx

# Create a graph
G = nx.Graph()

# Add edges to the graph
G.add_edges_from([(1, 2), (2, 3), (3, 4), (4, 5)])

# Perform 2 double edge swaps with maximum 10 tries
nx.double_edge_swap(G, nswap=2, max_tries=10)

# Print the modified graph
print(G.edges())
<|EOT|>
