[pgrouting-users] TSP - the same source and destination point

Stephen Woodbridge woodbri at swoodbridge.com
Mon Mar 5 13:03:45 EST 2012


What happens if you do not include the the start node in the list of 
stops? For example:

SELECT * FROM tsp_dijkstra('ways','552,169,784,1567,314',272);

I have not used this function in pgRouting so I don't know what to expect.

-Steve

On 3/5/2012 12:56 PM, Dariusz Górski wrote:
> W dniu 2012-03-05 15:15, Stephen Woodbridge pisze:
>> On 3/5/2012 6:00 AM, Dariusz Gorski wrote:
>>> Hello List,
>>>
>>> First of all I'd like to say thanks to the pgrouting Team for this
>>> great project.
>>>
>>> I've build pgrouting with patch:
>>> https://github.com/pgRouting/pgrouting/pull/49
>>>
>>> It works fine, but only in case when source and destination are
>>> different points.
>>>
>>> My aim is to solve TSP problem, when start and end point are the same.
>>>
>>> Any help would be appreciated.
>>
>> The patch was for specifying a separate end point. But according to
>> the thread on the link above, just leave off the last parameter and it
>> should work as before. where you give it a list of ids that you want
>> it to visit and the source_id for the start which is also the end.
>>
>> -Steve
>> _______________________________________________
>> Pgrouting-users mailing list
>> Pgrouting-users at lists.osgeo.org <mailto:Pgrouting-users at lists.osgeo.org>
>> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>>
> Steve, thanks for your reply.
> I've tried it before, but even when I use standard TSP functions,
> e.g. SELECT * FROM tsp_dijkstra('ways','552,272,169,784,1567,314',272);
> I don't get the loops (attached image).
> This is the reason why I thought that in TSP functions only starting
> point is fixed, but endpoint calculates TSP solver.
> According to your hint, where source = destination, I would expect to
> receive loop.
> In my case it does not work in this way.
> What am I doing wrong or what am I missing?
>
> Darek
>
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users



More information about the Pgrouting-users mailing list