Ticket #110 (closed bug report: invalid)
Dijkstra fails on parrallel edges
Reported by: | erik_heinz | Owned by: | somebody |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Dijkstra | Version: | 1.01 |
Keywords: | Cc: |
Description
It seems to me that shortest_path() does not find the shortest path in the case where redundant edges having the same source and target nodes are involved. To illustrate the problem I created a table of only two parallel edges:
gisdata=# select * from edges; id | source | target | length ----+--------+--------+-------- 1 | 1 | 2 | 5.5 2 | 1 | 2 | 4.4 (2 rows)
When travelling from node 1 to node 2 shortest_path() should select edge 2 because of the lower cost. It selects edge 1 instead, probably since edge 1 is returned by Postgresql first:
gisdata=# select * from shortest_path('SELECT id, source, target, length AS cost FROM edges', 1, 2, false, false); vertex_id | edge_id | cost -----------+---------+------ 1 | 1 | 5.5 2 | -1 | 0 (2 rows)
This seems wrong to me or do I miss something?
Thank you, Erik
Change History
Note: See
TracTickets for help on using
tickets.