<｜begin▁of▁sentence｜>### Instruction:
Imagine you are creating an intricate illustration to demonstrate the network of pathways by which signals travel within a complex anatomical system. In this representation, you have pathways or connections that can vary in efficiency, and it's essential to depict the most direct routes possible. You're working with a dataset detailing the connections as follows: pathway A connects to B with a signal delay of 2 units, B to C with a delay of 1 unit, C to D with another delay of 1 unit, and finally D to E with a 1-unit delay.

For the purpose of educational clarity, you need to find the most expedient routes between all components in this biological network, mirroring the concept of computing the shortest path lengths in a graph. How would you go about determining these optimal paths using your knowledge of biological systems alongside computational tools like NetworkX?
### Response:
import networkx as nx

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

# Compute shortest path lengths between all nodes
lengths = dict(nx.all_pairs_dijkstra_path_length(G))

# Print the shortest path lengths from node 2 to other nodes
print('Shortest path lengths from node 2 to other nodes:')
for target, distance in lengths[2].items():
    print(f'2 - {target}: {distance}')
<|EOT|>
