<｜begin▁of▁sentence｜>### Instruction:
Given a requirement to create a connected Watts-Strogatz small-world graph with 10 nodes, where each node is initially connected to 4 nearest neighbors in a ring topology, and there is a 50% probability to rewire each edge, can you generate such a graph and list out its nodes and edges?
### Response:
import networkx as nx

# Create a connected Watts-Strogatz small-world graph
G = nx.connected_watts_strogatz_graph(n=10, k=4, p=0.5, tries=100, seed=42)

# Print nodes and edges
echo = G.nodes()
print(f'Nodes: {echo}')
echo = G.edges()
print(f'Edges: {echo}')
<|EOT|>
