Yes.
You have a "do not use the flow path at all", which consists of vertices with numbers 0, 1, 3, 5, 6, 7, 11, 14, 17, 19, 21, 22, 24. edges that connect to each of these peaks, they have a "weight" of 50 * distances - therefore, edge 0-> 1 is weighted 50, edge 1> 3 is weighted 100, etc.
Then you have additional ribs representing the stream of jets - one of 0-> 5, weighted 10, one of 1-> 3 weighted 5, etc.
Together they form a directed acyclic graph (DAG).
Now that you have it, you can use the usual graph traversal methods to find the “cheapest” route from vertex 0 to vertex 24.
source share