Let's say I have a simple graph:
G = graph([1,2,3,4,5],[2,3,4,5,1]);
I want to find the shortest path from 1 to 3. The shortestpath function would give me 1-2-3. But in my case, I have a list of nodes that I can travel on:
How can I find the shortest path between any two nodes in the graph that only takes the nodes in that list (which will be 1-5-4-3 in this case)?