Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ k shortest paths algorithm

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.

like image 631
Yippie-Ki-Yay Avatar asked Jul 15 '11 15:07

Yippie-Ki-Yay


People also ask

What is K shortest path algorithm?

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.

What is meant by shortest path algorithm?

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.

Which is the fastest shortest path algorithm?

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.


1 Answers

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/

like image 113
A. K. Avatar answered Sep 19 '22 17:09

A. K.