V3 Djikstras algorithm Find reachable vertices (origid=X) returns weight=0 instead of weight=count of hops

Bug #1196036 reported by Andrew McDonnell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OQGRAPH
Fix Committed
Undecided
OQgraph developers

Bug Description

As per http://openquery.com/graph/doc

Dijkstra's shortest path algorithm (latch=1)
Find reachable vertices:
SELECT * FROM foo WHERE latch = 1 AND origid = 1;
  Results:
    latch, origid, destid are same as input.
    vertex id in linkid column.
    aggregate of weights in weight column.

INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1);
INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1);
INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3);
INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5);

SELECT * FROM graph WHERE latch='dijkstras' AND origid=1;
latch origid destid weight seq linkid
dijkstras 1 NULL 0 4 4
dijkstras 1 NULL 0 3 3
dijkstras 1 NULL 0 2 2
dijkstras 1 NULL 0 1 1

weight is incorrct, should be 2 1 1 0

Changed in oqgraph:
assignee: nobody → OQgraph developers (oqgraph-dev)
Revision history for this message
Andrew McDonnell (andymc73) wrote :

Found a typo:

=== modified file 'storage/oqgraph/graphcore.cc'
--- storage/oqgraph/graphcore.cc 2013-06-29 13:57:17 +0000
+++ storage/oqgraph/graphcore.cc 2013-08-09 11:20:16 +0000
@@ -823,7 +823,8 @@
                 EdgeWeight(),
                 make_dijkstra_visitor(
                     make_oqgraph_visit_dist(
- boost::make_assoc_property_map(p), d,
+ boost::make_assoc_property_map(p),
+ boost::make_assoc_property_map(d),
                         static_cast<stack_cursor*>(cursor)
                     )
                 ),

Changed in oqgraph:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.