Second shortest path

2142
4
03-22-2011 07:58 AM
JoannaLaroussi
New Contributor
Is any option in Network Analyst to create not only the shortest path between points, but also second and third shortest path?
Tags (2)
0 Kudos
4 Replies
JaySandhu
Esri Regular Contributor
Can you describe what would be an acceptable second or third shortest path for your application?

Jay Sandhu
0 Kudos
JoannaLaroussi
New Contributor
As a second/third shortest path I mean a route between my points, which is a little longer than the standard shortest path. I would like to be able to prepare 3 possible routes connecting my points, where I can say something like: you can go from point A to point B by route 1 and this will take 5 minutes, by route 2 and this will take 6 minutes or by a route 3 and this will take 7 minutes.
0 Kudos
JaySandhu
Esri Regular Contributor
You can do this by a simple process:
First solve the shortest path between the two locations.
Save/export the results.
Now in the NA Window, right click on the Line Barriers and select Load Locations
In the "Load From:", pick the existing route layer's Routes sub layer and click OK.
The current shortest path will now be loaded in as restriction!
Double-click on the newly added line restriction to open it's properties.
Change the "BarrierType" from Restriction to Scaled Cost and in the next column,
some thing like Attr_Time (or what ever your impedance attribute was), change the value to be 1.2
Solve. You should get a new path. Save/export this.
Now repeate the above process to load the new path as a scaled cost restriction and solve again.

The 1.2 means you are penalizing the current path by 20 percent. So it may find another path.
You can change the penalty factor as needed for your area. e.g., 1.1 may work better.

So what we did was to use the existing shortest path to penalize the underlying roads a little bit and force the solver to find an alternate solution.

Regards,
Jay Sandhu
0 Kudos
JoannaLaroussi
New Contributor
Thank you. I hoped for some out of the box solution, but this will also work for me.
0 Kudos