<｜begin▁of▁sentence｜>### Instruction:
Given a graph whose node set is [1, 2, 3] and edge set is [(1, 2), (2, 3)], how would you generate a dictionary representing the adjacency list that is ready for JSON serialization using NetworkX?
### Response:
import networkx as nx
from networkx.readwrite import json_graph

# Create a NetworkX graph
G = nx.Graph()
G.add_nodes_from([1, 2, 3])
G.add_edges_from([(1, 2), (2, 3)])

# Use adjacency_data to get a dictionary suitable for JSON serialization
data = json_graph.adjacency_data(G)

# To serialize with json
import json
json_data = json.dumps(data)
print(json_data)
<|EOT|>
