<｜begin▁of▁sentence｜>### Instruction:
Given a graph whose edge set is [(1, 2), (1, 5), (1, 8), (2, 3), (2, 8), (3, 4), (3, 6), (4, 5), (4, 7), (5, 6), (6, 7), (7, 8)], how do you compute the subgraph centrality for each node using NetworkX's subgraph_centrality_exp function, which sums weighted closed walks of all lengths starting and ending at each node?
### Response:
import networkx as nx

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

# Calculate subgraph centrality for each node
subgraph_centralities = nx.subgraph_centrality_exp(G)

# Print the subgraph centrality for each node
for node, centrality in sorted(subgraph_centralities.items()):
    print(f'Node {node}: {centrality:.2f}')
<|EOT|>
