<｜begin▁of▁sentence｜>### Instruction:
Imagine you're studying a series of vascular pathways in a patient's body, using state-of-the-art imaging techniques. Analogous to a network of arteries, you've constructed a directional flowchart where the pathways have certain flow 'weights'. Specifically, the chart includes passages with the following flow resistances: an artery from point A to B with a resistance of 100 units, from B to C with 200 units, from C to D with 300 units, and from D to E with 400 units.

Now, as a meticulous radiologic technologist, you're tasked with planning the optimal route for a contrast agent to travel from the entry artery (point A) to any other point within the vascular network. The agent has a safety threshold of 500 resistance units it can overcome before it starts deteriorating and becoming ineffective.

Using this health-imaging analogy, could you utilize a tool analogous to NetworkX to determine the most efficient trajectory for the contrast agent, ensuring that it doesn't exceed its resistance threshold from its starting point at artery A? Remember, the efficiency here is measured in the least cumulative resistance, while the resistance threshold acts as a crucial parameter for the agent's efficacy.
### Response:
import networkx as nx

# Create a weighted directed graph
G = nx.DiGraph()
G.add_weighted_edges_from([(0, 1, 100), (1, 2, 200), (2, 3, 300), (3, 4, 400)])

# Compute the shortest path length and predecessors
pred, dist = nx.dijkstra_predecessor_and_distance(G, source=0, cutoff=500, weight='weight')

print('Predecessors:', pred)
print('Distances:', dist)
<|EOT|>
