I have an application where I need to calculate several different possible routes between origin and destination points on a road network. The best option that I can come up with at this time is what is commonly called the kth best route, which would return the shortest route, the second shortest, third shortest, etc. I've searched around on the web for a solution to this and have come up empty.

Does anyone have any experience with this, or do you know if it is possible to extract this information out of Network Analyst? Any help you can provide would be most appreciated.

Brian Frizzelle

Does anyone have any experience with this, or do you know if it is possible to extract this information out of Network Analyst? Any help you can provide would be most appreciated.

Brian Frizzelle

Therefore, to approximate k-shortest paths, you can do the following (this is essentially the same as what Bill suggests above, but I am providing specific steps using the newly-supported barrier functionality):

Note that by scaling the polyline barrier instead of restricting it, this will allow the next path to reuse some of the same edges along the previous path if necessary, but at a higher cost than in previous paths. Also note that when multiple line barriers apply to the same edge, the final scale factor for the cost of that edge becomes the product of their individual scale factors. For example, if there are two line barriers applied to some edge with scale factors x and y, respectively, the scaled cost of traversing that edge will be x*y*originalEdgeCost.

This means that the more an edge is reused across different paths, the less likely it will be to be used in any subsequent paths as the process discussed above continues to iterate. Does this make sense?

Let me know if there are any questions.