Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a set of N coordinates (addresses). My goal is to compute the shortest driving route through the set of coordinates, where the algorithm (not the user) decides which of the N coordinates should be the start point and which of the N - 1 coordinates (excluding the start point) should be the end point.

Can this be done and which algorithms are used for this kind of routing?

By assuming that the routing can be done using the arial distance between the coordinates instead of roads, how could I then solve my problem?

At this stage of my questioning, I am trying to determine how to solve the problem in theory but the tools at hand are a PostGIS database and anything I can implement my self in C# .NET. If any free libraries can help me, then they can be considered too :)

share|improve this question
up vote 6 down vote accepted

Travelling Salesman is supported by pgRouting:, so no need to implement something yourself if you alread have PostGIS at hand.

share|improve this answer

This is known as the Travelling Salesman Problem. To do want you want, you would probably first calculate all your driving distances between the N points, then use one of the known algorithms to solve the problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.