<｜begin▁of▁sentence｜>### Instruction:
Given a weighted directed graph with nodes 0 through 4 and edges with certain weights ((0,1,4), (1,2,2), (2,3,3), (3,4,1), (1,3,5)), how can we use the NetworkX function 'single_source_bellman_ford_path' to find the shortest path from node 0 to all other nodes?
### Response:
import networkx as nx

# Create a weighted graph
G = nx.DiGraph()
G.add_edge(0, 1, weight=4)
G.add_edge(1, 2, weight=2)
G.add_edge(2, 3, weight=3)
G.add_edge(3, 4, weight=1)
G.add_edge(1, 3, weight=5)

# Compute shortest paths from source node 0 to all other nodes
paths = nx.single_source_bellman_ford_path(G, source=0)

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