Solving Traveling Salesmen Problem  using arcobjects.

6005
12
03-15-2012 06:04 AM
saitdemir
New Contributor
I have to find solitions of TSP problem using arcobjects but I don't have any ideas. How can � deal with this problem.
Any body can help me to find Tsp solitions network analayst
Tags (2)
0 Kudos
12 Replies
mastersamy
New Contributor
or Is there any way to make an executable like the one I referred to ?
0 Kudos
AlexeyTereshenkov
Regular Contributor III
Those are samples that you have to build manually with MS Visual Studio or other IDE you prefer.

See here: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_use_ArcGIS_sampl...

When you build the solution, you are ready to compile your sample into an .exe which you can use for performing network analysis.
0 Kudos
PatrickStevens
Esri Contributor
Hello!

The FindBestSequence property of INARouteSolver is what activates the Traveling Salesperson Problem algorithm in the solver.  Once TSP is active, you set INARouteSolver to PreserveFirstStop and/or PreserveLastStop to force the solver not to resequence the first and last stops.  For example, if you want a route to start at your home, visit a few stops, then return to your home, you would add your home as the first and last stop in the Stops class, then set both PreserveFirstStop and PreserveLastStop to true.

Setting up the route solver in ArcObjects can be seen in a few different samples:

   Here is some ArcObjects code for setting up, solving, and saving a Route analysis.
 
   Here is a sample that uses the Closest Facility solver, but has some UI elements, to help you along with the interface.

   Here is the NAEngine application that works like a mini-standalone version of ArcMap, complete with an NAWindow, etc.

   Here is a sample that opens a network dataset, creates a Route layer and saves it out to disk.


If you have any issues using the samples, just ask a question here and I'll help you work it out.  Good luck!
0 Kudos