Shortest path with limited number of edges used



Hi,

I'm looking for an algorithm to find the shortest path between to nodes in a graph *consistig of <= k edges*. If that helps, the graph I'm working with is fully connected, and k will be about 2--10 or so, so nothing really large.

I thought about using Dijkstra's and if it is possible to adapt it to my constraint; maybe saving for each node not only the distance from the start during the run, but the distances to the start for 0..k edges or something like that, but couldn't yet figure it out fully.

Does already such an algorithm exist? I'm quite sure it does...

Thank you very much,
Daniel

--
Done: Arc-Bar-Sam-Val-Wiz, Dwa-Elf-Gno-Hum-Orc, Law-Neu-Cha, Fem-Mal
Underway: Cav-Dwa-Law-Fem
To go: Cav-Hea-Kni-Mon-Pri-Ran-Rog-Tou
.