<｜begin▁of▁sentence｜>### Instruction:
Given a weighted graph with edge set [(1, 2, 10), (2, 3, 5), (3, 4, 10)], how do you compute the spectral ordering of its nodes, where the nodes in the same weakly connected components appear contiguous and ordered by their corresponding elements in the Fiedler vector of the component, using NetworkX?
### Response:
import networkx as nx
import numpy as np

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

# Compute the spectral ordering
ordering = nx.spectral_ordering(G, weight='weight', normalized=True, tol=1e-8, method='tracemin_pcg', seed=None)

print('The spectral ordering of the nodes is:', ordering)
<|EOT|>
