[pgrouting-users] Different results - pgr_dijkstra/pgr_kdijkstrapath/cost/pgr_ksp
woodbri at swoodbridge.com
Tue Mar 25 09:23:04 PDT 2014
On 3/25/2014 10:45 AM, Omar Fernando Pessôa wrote:
> I have a city roads data base witch is returning different values from
> this 'selects'.
> select sum(cost) from pgr_Dijkstra('SELECT id, source, target, cost,
> reverse_cost FROM ruas',3423, 3839, true, true);
> select sum(cost) from pgr_kdijkstraPath('SELECT id, source, target,
> cost, reverse_cost FROM ruas',3423, array, true, true);
> select sum(cost) from pgr_ksp('SELECT id, source, target, cost,
> reverse_cost FROM ruas', 3423, 3839, 1, true);
> Manually I have seen that the pgr_Dijkstra has the correct path.
> And the others has passed from edges who is not the shortest path.
> Is it an alghorithm error?
It would seem that these all should return the same basic result, or at
least a result where the total cost is the same in all cases.
I know there were some fixes made at some point to correct a problem of
multiple parallel paths where a non-short path was getting returned. It
is possible that this fix may need to be applied to these other
Please open a ticket and if possible add a simple example that
reproduces the problem.
If you can did into the code, we would be happy to get a pull request
against the "develop" branch.
More information about the Pgrouting-users