Shortest path algorithms
An implementation of some shortest path algorithms, including Dijkstra’s algorithm, bidirectional Dijkstra’s algorithm, A algorithm, and bidirectional A algorithm.
The A* algorithm implemented here is a special case that uses Euclidean distance from a vertex to the target vertex as the potential function. To guarantee that this is a valid potential function, the weight of each edge should be greater than the Euclidean distance from the start vertex to the end vertex.
Build with CMake:
cmake .
cmake --build .
Usage: shotrestpah [option] [file]
Options:
All vertices should be labeled using one-based indexing.
For each query, the program prints the shortest distance and the vertices on the path in the next line (if -p).