<｜begin▁of▁sentence｜>### Instruction:
How can you combine two separate graphs, where the first graph has edges between nodes 1-2 and 2-3, and the second graph has edges between nodes 3-4 and 4-5, into a single graph that includes all edges?
### Response:
import networkx as nx

# Create two graphs
g1 = nx.Graph()
g1.add_edges_from([(1, 2), (2, 3)])
g2 = nx.Graph()
g2.add_edges_from([(3, 4), (4, 5)])

# Compose the two graphs
g_combined = nx.compose(g1, g2)

# Print the composed graph's edges
print(g_combined.edges())
<|EOT|>
