[pgrouting-dev] Error TSP requires four or more locations to optimize

Stephen Woodbridge woodbri at swoodbridge.com
Fri Jul 5 06:36:02 PDT 2013


On 7/5/2013 2:40 AM, Dave Potts wrote:
> On 05/07/13 08:34, Dave Potts wrote:
>> It seems the pgr_tsp requires four or more locations.
>>
>> I assume its required because pgr_tsp is attempting to rewrite a
>> result from the traveling salesman problem in to some optiminal version
>>
>> dave.
> Sorry slight keyboard problem :-O, what I should have sent is
>
>
> I assume its required because pgr_tsp is attempting to rewrite a result
> from the traveling salesman problem in to some optiminal version, is it
> possible to have access to the raw solution, just because I might have
> to deal with a case where I only have 3 nodes instead of the required 4?

You can't optimize 3 points they are by definition optimized in the 
symmetric case. This was throwing the code into an infinite loop so I 
think I checked in a check for this and return an error.

The code might be modified to just return the input as the results, but 
when I look at doing this it was not trivial to do so I just throw the 
error.

-Steve



More information about the pgrouting-dev mailing list