Does someone know if there is any production-ready K-shortest-paths
algorithm for C++
?
The only available implementation (k-shortest-paths), unfortunately, leaks memory, has counter-intuitive interfaces and another "reinvented wheel" - the Graph
class.
I'm looking for something better, probably, boost::graph
-based.
There are two possible algorithms available - simple Yen's algorithm
and optimized Yen's algorithm
, both would suit me.
Thanks in advance.
Yen's Shortest Path algorithm computes a number of shortest paths between two nodes. The algorithm is often referred to as Yen's k-Shortest Path algorithm, where k is the number of shortest paths to compute. The algorithm supports weighted graphs with positive relationship weights.
Definition of Shortest Path Algorithm. The shortest path algorithm is given a weighted graph or digraph G = (V,E,W) and two specified vertices v and w; the algorithm finds a shortest path from v to w. The distance from a vertex v to a vertex w (denoted d(v,w)) is the weight of a shortest path from v to w.
Dijkstra's algorithm is used for our fastest path algorithm because it can find the shortest path between vertices in the graph. The coordinates on the arena are considered as the vertices in the graph.
There is another one, but you'll have to check if this also leaks memory.
http://sourceforge.net/projects/ksp/files/ksp/ksp-1.0/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With