You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
While developing I found that there is a small bug on the Path class, and the total cost is not updated properly
As far as I can see affects some functions:
bellman_ford_driver.cpp
dijkstra_driver.cpp
pgr_ksp.hpp
To Reproduce
Very difficult to reproduce, but from this test execution:
"SELECT seq, path_seq, node, edge, cost, agg_cost FROM pgr_turnrestrictedpath($$SELECT id, source, target, cost, reverse_cost FROM edge_table$$, $$SELECT * FROM new_restrictions WHERE id > 10$$, 12, 13, 3, false)"
# Extra records:
# (2,2,11,12,1.144,1.1689999999999998)
# Missing records:
# (2,2,11,12,1.144,1.169)
(2,2,11,12,1.144,1.169) ss expected as result of dijkstra
But this is obtained: (2,2,11,12,1.144,1.1689999999999998)
and 1.169 compared with 1689999999999998 is "almost" the same value so there is floating point arithmetic issue.
Expected behavior
"SELECT seq, path_seq, node, edge, cost, agg_cost FROM pgr_turnrestrictedpath($$SELECT id, source, target, cost, reverse_cost FROM edge_table$$, $$SELECT * FROM new_restrictions WHERE id > 10$$, 12, 13, 3, false)"
# Extra records:
# (2,2,11,12,1.144,1.169)
# Missing records:
# (2,2,11,12,1.144,1.169)
To get the expected results
Sample Data
Using the sample data of the documentation
Specifications (please complete the following information):
Fix & release:
3.0.3 version
3.1.1 version
and fix:
3.2.0-dev
The text was updated successfully, but these errors were encountered:
Describe the bug
While developing I found that there is a small bug on the Path class, and the total cost is not updated properly
As far as I can see affects some functions:
To Reproduce
Very difficult to reproduce, but from this test execution:
(2,2,11,12,1.144,1.169)
ss expected as result of dijkstraBut this is obtained:
(2,2,11,12,1.144,1.1689999999999998)
and 1.169 compared with 1689999999999998 is "almost" the same value so there is floating point arithmetic issue.
Expected behavior
To get the expected results
Sample Data
Using the sample data of the documentation
Specifications (please complete the following information):
Fix & release:
and fix:
The text was updated successfully, but these errors were encountered: