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

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

# Define multiple source nodes
sources = {0, 4}

# Run multi-source dijkstra algorithm
length, path = nx.multi_source_dijkstra(G, sources)

# Print the shortest path from any of the sources to all other nodes
for node in G:
  print(f"{node}: {length[node]} with path {path[node]}")
<|EOT|>
