# Distance calculation between

Discussion created by thomazz on Mar 20, 2012
Latest reply on Apr 3, 2012 by nan-esristaff
Hello,

I will try to explain my problem by means of a the figurethat I attached in this post.

In the figure you can see the study area. Each small dot represents a biomass collection location. As you can see, the dots are divided in three different colors in order to create 3 subareas which each are visited by a truck to collect the biomass. The blue lines represents the existing road network in the study area. The large blue dot is the central biomass plant location, which is currently not relevant for the explanation of the problem.

For each of the 3 subareas, the biomass should be collected by a truck at each dot. This should be done in a way the distance to be traveled is as low as possible. Therefore, I would like to develop an algorithm which satisfies 2 important conditions:

1) After the first dot is visited, the next dot to be visited is the dot that is the closest to the first dot. The third dot, is the dot that is the clost to the second dot, and so on. In general, one could say that the next dot is the dot closest to the current dot, except dots that are already visited.
2) The sequence of the dots that are visited should afterwards be consultable for further analysis, just like the total distance and the distance that is traveled between each dot.

If possible, the distance over the existing road network should be calculated. However, since not all collection points are connected to a road network, Euclidian distance with also be satisfying.

I hope my explanation is clear !

Many thanks in advance...

Thomas Voets