<｜begin▁of▁sentence｜>### Instruction:
Given a graph with the edge set [(1, 2), (1, 3), (2, 4), (3, 4)], how can you represent the adjacency of the graph as a dictionary of lists for a subset of nodes [1, 2, 3] using NetworkX?
### Response:
import networkx as nx

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

# Convert to dictionary of lists
node_list = [1, 2, 3]
dict_of_lists = nx.to_dict_of_lists(G, nodelist=node_list)

print(dict_of_lists)
<|EOT|>
