Given a directed graph with vertices and weighted arcs, we wish to know the cost of the minimum-cost directed path between two given vertices, if there is one.
Input starts with and . Then follow 3-tuples , with , indicating an arc from to with weight . The following will be true: there are no repeated arcs, all weights are positive integers, and . Finally, there follows a pair , with and .
Write the total cost (sum of arc weights) of the path from to of least cost, if one exists; otherwise, write “no path”.
We are authorized to employ the NetworkX library.
Author: José Luis Balcázar, based on existing Jutge problems
Generation: 2026-01-25T13:50:10.406Z
© Jutge.org, 2006–2026.
https://jutge.org