<｜begin▁of▁sentence｜>### Instruction:
Given a path graph with 5 nodes where the edge weight between two nodes u and v is the sum of their labels (u + v), compute the shortest path length from the source node 0 to all other nodes using NetworkX's single_source_bellman_ford_path_length function.
### Response:
import networkx as nx

# Create a weighted graph
G = nx.path_graph(5)
# Assign weights to the edges
for u, v in G.edges():
    G[u][v]['weight'] = u + v

# Compute the shortest path length from source to all other nodes
lengths = nx.single_source_bellman_ford_path_length(G, 0, weight='weight')

# Print the shortest path lengths to all nodes from the source
for target in lengths:
    print(f'Shortest path length from 0 to {target}: {lengths[target]}')
<|EOT|>
