[pgrouting-dev] Building some tools to work with TSP

Helder Alves helderalvespt at gmail.com
Thu Dec 12 16:13:30 PST 2013


Hi again Steve!

You got it right.

All the simple pgr_trsp queries you suggested returned:

*seq;id1;id2;cost*
0;-1;0;0

The result from pgr_analyzegraph check is "OK".

SELECT id1 as path,
> ST_Length_Spheroid(st_astext(st_linemerge(st_union(b.the_geom))),
> 'SPHEROID["GRS_1980",6378137,298.257222101]')
>   FROM pgr_kdijkstraPath(
>       'SELECT id, source, target, cost, reverse_cost FROM ways',
>       98306, array[146098], true, true) a,
>             ways b
> WHERE a.id3=b.id
> GROUP by id1
> ORDER by id1;


Definitely I think something is not OK. The output of the query above is
the following one:

*path;st_length_spheroid*
146098;4374.81625857547

As may be guessing already, this query for the other 2 pairs of vids (228347,
228369 and 228369,98306) also returned the expected distances.

What do you suggest as next step?

--
Helder Alves
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-dev/attachments/20131213/89404a14/attachment.html>


More information about the pgrouting-dev mailing list