<｜begin▁of▁sentence｜>### Instruction:
As a network analyst, you're likely familiar with representing complex relationships between entities. Imagine you're tasked with organizing a city's transportation network, where each road between two neighborhoods is represented as an edge with a specific weight. For instance, Road A connects Neighborhood 1 to Neighborhood 2 with a distance of 5 kilometers, while Road B links Neighborhood 2 to Neighborhood 3 spanning 8 kilometers.

Now, let's say you're using NetworkX, a powerful tool in your arsenal, to streamline this data into a more manageable format. You might utilize the `to_dict_of_dicts` function, akin to a legislative process, where various components come together to form a cohesive policy. This function transforms your intricate road network into a structured dictionary of dictionaries, reflecting the connections between neighborhoods and their respective distances.
### Response:
import networkx as nx

# Create a NetworkX graph instance
g = nx.Graph()
# Add edges with attributes
g.add_edge(1, 2, weight=5)
g.add_edge(2, 3, weight=8)
# Export the graph to a dictionary of dictionaries
dict_of_dicts = nx.to_dict_of_dicts(g)
# Print the dictionary representation of the graph
print(dict_of_dicts)
<|EOT|>
