<｜begin▁of▁sentence｜>### Instruction:
Given a weighted undirected graph with edge set [(0, 1, {'weight': 2}), (1, 2, {'weight': 1}), (2, 3, {'weight': 1}), (3, 4, {'weight': 1})], can you compute the shortest path from node 0 to all other nodes, and provide the shortest path to node 4 specifically using NetworkX?
### Response:
import networkx as nx

# Create a weighted graph
G = nx.Graph()
G.add_weighted_edges_from([(0, 1, {'weight': 2}), (1, 2, {'weight': 1}), (2, 3, {'weight': 1}), (3, 4, {'weight': 1})])

# Specify the source node
source = 0

# Find the shortest paths from source to all other nodes
paths = nx.single_source_dijkstra_path(G, source)

# Output the shortest path to node 4
print(paths[4])
<|EOT|>
