I'm trying to find the shortest path from A to Z in an undirectional weighted graph. However, the resulting path should also go through a set of unordered vertices (let's just say B, C and D).
I haven't found any answers to this exact problem but I've encountered similar questions which defined the problem as NP-Hard (so not really solvable for every graph as far as I understand).
So is there still an algorithm that atleast attempts to find a path which visits all of these vertices and breaks in case it can't find a path after exhausting a reasonable amount of options?
If not, the alternative approach in my case would be to have these must-visit vertices ordered. Is there a better approach to finding a path than just splitting the path up and calculating the best path for every segment (A->B,B->C, etc)?