<｜begin▁of▁sentence｜>### Instruction:
Given a path graph with 4 nodes, how can we compute the Katz centrality of each node using NetworkX, considering the attenuation factor alpha to be the inverse of the largest eigenvalue of the graph's adjacency matrix?
### Response:
import networkx as nx
import math

# Create a graph
G = nx.path_graph(4)

# Calculate the largest eigenvalue of the adjacency matrix
phi = (1 + math.sqrt(5)) / 2.0

# Compute the Katz centrality
centrality = nx.katz_centrality_numpy(G, 1/phi)

# Print the Katz centrality for each node
for n, c in sorted(centrality.items()):
    print(f"{n} {c:.2f}")
<|EOT|>
