<｜begin▁of▁sentence｜>### Instruction:
Given a weighted undirected graph with nodes {0, 1, 2, 3, 4, 5} and weighted edges [(0, 1, 4), (0, 2, 2), (2, 1, 1), (1, 3, 2), (1, 4, 2), (4, 5, 1)], how can you calculate and sort the Laplacian centrality of each node?
### Response:
import networkx as nx
from networkx.algorithms.centrality import laplacian_centrality

# Define a weighted graph
G = nx.Graph()
edges = [(0, 1, 4), (0, 2, 2), (2, 1, 1), (1, 3, 2), (1, 4, 2), (4, 5, 1)]
G.add_weighted_edges_from(edges)

# Calculate Laplacian centrality
lap_cent = laplacian_centrality(G, normalized=True)

# Sort nodes by Laplacian centrality
sorted_lap_cent = sorted((v, f"{c:0.2f}") for v, c in lap_cent.items())
print(sorted_lap_cent)
<|EOT|>
