Dijkstra’s Routing Algorithm

ThinkGeo+open+street+mapping+with+options.jpg

One of the most commonly used routing algorithms is Dijkstra’s algorithm. Dijkstra’s algorithm finds the shortest path between two nodes by building a shortest-path tree, and stopping once the destination node has been reached. Normally in routing applications, Dijkstra’s algorithm is used to find the shortest route between 2 locations. This is the case with Map Suite Routing’s built-in Dijkstra routing algorithm. However, there may be instances where you may want to find the shortest path from a single source node to several destination nodes. With a few small modifications, you can use Dijkstra’s algorithm in order to efficiently get multiple route results from a single location to multiple destinations.

Usually with Dijkstra’s algorithm you would pass in a single source node (point A) and a single destination node (point B). The algorithm would find the shortest path between point A and each intermediate node, until it eventually finds the shortest path between point A and point B.

routing1.png

If desired, you can get the shortest path from a source node (point A) to multiple destination nodes (points B, C, D) by allowing the algorithm to continue building the shortest-path tree until all of the desired routes have been covered. Once this is done, you can get all of the desired routes, while only having to perform the routing once.

routing2.png

If desired, you can get the shortest path from a source node (point A) to multiple destination nodes (points B, C, D) by allowing the algorithm to continue building the shortest-path tree until all of the desired routes have been covered. Once this is done, you can get all of the desired routes, while only having to perform the routing once.

Previous
Previous

New Code Sample: Label Point with Circle Symbol and Mask Description

Next
Next

Getting Features from ArcGIS Server