[pgrouting-users] TSP weridness in development version of postgres matrix TSP

Stephen Woodbridge woodbri at swoodbridge.com
Tue Jun 25 04:22:15 PDT 2013


On 6/25/2013 6:55 AM, Dave Potts wrote:
>
> According to the web page
> http://docs.pgrouting.org/dev/src/tsp/doc/index.html
>
> The  first parmeter 'start' in the distance matrix version, is the
> starting node, so in the following examples,  I assume that the first
> entry in the results set would be the same as the 'start' parmeter.  It
> 'works' fine in Example1 and Example2, but Example3 and Example4 start
> off from node 1 and 0,  I was assuming that they would be starting off
> from node 2 and 3.
>
> Is there any reason for this?

It might be a bug. I will look at it closer as soon as I get a chance. I 
have to do some reordering of the list to deal with start and end 
vertices and might have messed something up doing that. Can you stick 
this in a bug ticket for me.

Thanks,
   -Steve

> Dave.
> ==============================================
>
> Example1
> tsp=# SELECT seq, id FROM
> pgr_tsp('{{0,1,3,3},{1,0,2,2},{3,2,0,2},{3,2,2,0}}',0);
>   seq | id
> -----+----
>     0 |  0
>     1 |  1
>     2 |  3
>     3 |  2
> (4 rows)
> Example2
> tsp=# SELECT seq, id FROM
> pgr_tsp('{{0,1,3,3},{1,0,2,2},{3,2,0,2},{3,2,2,0}}',1);
>   seq | id
> -----+----
>     0 |  1
>     1 |  3
>     2 |  2
>     3 |  0
> (4 rows)
> Example3
> tsp=# SELECT seq, id FROM
> pgr_tsp('{{0,1,3,3},{1,0,2,2},{3,2,0,2},{3,2,2,0}}',2);
>   seq | id
> -----+----
>     0 |  1
>     1 |  3
>     2 |  2
>     3 |  0
> (4 rows)
> Example4
> tsp=# SELECT seq, id FROM
> pgr_tsp('{{0,1,3,3},{1,0,2,2},{3,2,0,2},{3,2,2,0}}',3);
>   seq | id
> -----+----
>     0 |  0
>     1 |  1
>     2 |  3
>     3 |  2
> (4 rows)
>
> _______________________________________________
> 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