I know Dijkstra's algorithm to find the shortest way between 2 nodes, but is there a way to find the shortest path between 3 nodes among $n$ nodes? Here are the details:
I have $n$ nodes, some of which are connected directly and some of which are connected indirectly, and I need to find the shortest path between 3 of them.
For example, given $n = 6$ nodes labelled A through F, and the following graph:
A-->B-->C A-->D-->E D-->F
How can I find the shortest path between the three nodes (A,E,F)?
I am looking for a solution similar to Dijkstra's shortest path algorithm, but for 3 nodes instead of 2.
Please Note :
1- The Starting Node is A
2- The Sequential is not important just the path needs to cover all these Nodes
3- Their is no return back to A
Please find the diagram Image Regards & Thanks