I'm looking for a java algorithm to find the shortest path in a directed graph from the vertex 1 to vertex n and through k vertices. This last condition that I have a problem. I thought of course use the Dijkstra algorithm. What do you think? And how to modify it to pass through k vertices?
Bookmarks