[pgrouting-dev] Building some tools to work with TSP
Helder Alves
helderalvespt at gmail.com
Sun Dec 22 08:15:14 PST 2013
Hi Steve,
I'm back to the TSP work.
select * from pgr_tsp(
> (select dmatrix::float8[]
> from pgr_vidstodmatrix(
> 'select id, source, target, cost, reverse_cost from ways',
> pgr_pointstovids(
>
> pgr_texttopoints('-8.6637,40.6403;-8.6406,40.6539;-8.6923,40.6312;-8.7411,40.6312',
> 4326),
> 'ways'),
> true, true, true) as dmatrix),
> 1
> );
The query above return the following results:
seq;id
0;1
1;0
2;3
3;2
Computing pgr_dijkstra for that sequence (i.e., 1 >> 0 >> 3 >> 2) I get:
1975.82193954407
7098.18548705077
6299.05064340774
However, this is not the right sequence, which I can prove computing
pgr_dijkstra for the sequence 1 >> 0 >> 2 >> 3:
1975.82193954407
2723.3692284753
4374.81625857547
Do you have any idea of whatever might be wrong here?
Thanks for you help! :-)
--
Helder Alves
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-dev/attachments/20131222/3df441bf/attachment.html>
More information about the pgrouting-dev
mailing list