<｜begin▁of▁sentence｜>### Instruction:
Imagine we're choreographing an intricate dance number that involves a sequence of moves where each dancer passes a baton to the next. The dancers are positioned in a line and each move from one dancer to the next has been given a difficulty rating. We have our dancers arranged as points 0 through 4, and the moves between them with their corresponding difficulty scores are as follows: a move between dancers 0 and 1 has a difficulty of 1, between 1 and 2 is a 2, between 2 and 3 is a 3, and the move between 3 and 4 has a difficulty of 4.

To ensure that our dance flows as gracefully as possible, we need to figure out the sequence of moves that results in the lowest combined difficulty score for each dancer to reach every other dancer. Using the framework of Dijkstra's algorithm, much like a choreographer would plan out the steps to minimize the risk of a misstep, could you devise a plan to determine these sequences along with the total difficulty score for each sequence? Keep in mind, we'd like to calculate these for every possible pairing in our line of dancers, ensuring the transitions are as smooth as possible.
### Response:
import networkx as nx

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

# Compute shortest paths and lengths using Dijkstra's algorithm
paths = dict(nx.all_pairs_dijkstra(G))
for source, (distances, paths) in paths.items():
    print(f'Source {source} has shortest paths and distances:')
    for target in distances:
        print(f' - To {target} with distance {distances[target]} via {paths[target]}')
<|EOT|>
