Commit 0cd1f495 authored by Andrew McDonnell's avatar Andrew McDonnell

Fix for breadth_first originating vertices returning no result.

parents 6f12d8b3 d1650f82
This diff is collapsed.
...@@ -226,6 +226,8 @@ SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4; ...@@ -226,6 +226,8 @@ SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4;
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5; SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5;
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6; SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6;
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7; SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7;
#-- FIXME This is returning one result set, suspect this is a bug...?
#-- https://bugs.launchpad.net/oqgraph/+bug/1196020
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8; SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8;
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9; SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9;
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10; SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10;
...@@ -354,15 +356,66 @@ SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND (weight = 1 or weight ...@@ -354,15 +356,66 @@ SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND (weight = 1 or weight
SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND (weight = 1 or weight = 2); SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND (weight = 1 or weight = 2);
SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND (weight = 1 or weight = 2); SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND (weight = 1 or weight = 2);
SELECT * FROM graph WHERE latch = '2' AND destid = 1;
SELECT * FROM graph WHERE latch = '2' AND destid = 2;
SELECT * FROM graph WHERE latch = '2' AND destid = 3;
SELECT * FROM graph WHERE latch = '2' AND destid = 4;
SELECT * FROM graph WHERE latch = '2' AND destid = 5;
SELECT * FROM graph WHERE latch = '2' AND destid = 6;
SELECT * FROM graph WHERE latch = '2' AND destid = 7;
#-- FIXME This is returning one result set, suspect this is a bug...?
#-- https://bugs.launchpad.net/oqgraph/+bug/1196020
SELECT * FROM graph WHERE latch = '2' AND destid = 8;
SELECT * FROM graph WHERE latch = '2' AND destid = 9;
SELECT * FROM graph WHERE latch = '2' AND destid = 10;
SELECT * FROM graph WHERE latch = '2' AND destid = 11;
SELECT * FROM graph WHERE latch = '2' AND destid = 12;
SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 1;
SELECT * FROM graph WHERE latch = '2' AND destid = 2 and weight = 1;
SELECT * FROM graph WHERE latch = '2' AND destid = 3 and weight = 1;
SELECT * FROM graph WHERE latch = '2' AND destid = 4 and weight = 1;
SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 1;
SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 1;
SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 1;
SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 1;
SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 1;
SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 1;
SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 1;
SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 1;
SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 2;
SELECT * FROM graph WHERE latch = '2' AND destid = 2 and weight = 2;
SELECT * FROM graph WHERE latch = '2' AND destid = 3 and weight = 2;
SELECT * FROM graph WHERE latch = '2' AND destid = 4 and weight = 2;
SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 2;
SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 2;
SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 2;
SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 2;
SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 2;
SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 2;
SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 2;
SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 2;
SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 3;
SELECT * FROM graph WHERE latch = '2' AND destid = 2 and weight = 3;
SELECT * FROM graph WHERE latch = '2' AND destid = 3 and weight = 3;
SELECT * FROM graph WHERE latch = '2' AND destid = 4 and weight = 3;
SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 3;
SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 3;
SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 3;
SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 3;
SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 3;
SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 3;
SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 3;
SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 3;
#-- These return empty sets - origid must be specified and non null to get a result set #-- These return empty sets - origid must be specified and non null to get a result set
SELECT * FROM graph WHERE latch = '2' AND origid = NULL; SELECT * FROM graph WHERE latch = '2' AND origid = NULL;
SELECT * FROM graph WHERE latch = '2' AND destid = 1; SELECT * FROM graph WHERE latch = '2' AND destid = NULL;
SELECT * FROM graph WHERE latch = '2' AND weight = 1; SELECT * FROM graph WHERE latch = '2' AND weight = 1;
SELECT * FROM graph WHERE latch = '2'; SELECT * FROM graph WHERE latch = '2';
--echo # Dijkstras algorithm tests --echo # Dijkstras algorithm tests
#-- We ask 'What is the path (if any) between 'origid' and 'destid' #-- We ask 'What is the shortest path (if any) between 'origid' and 'destid'
#-- This returns the number of directed hops +1 (for the starting node) #-- This returns the number of directed hops +1 (for the starting node)
#-- 'weight' is NULL for the starting point, or 1 #-- 'weight' is NULL for the starting point, or 1
#-- 'linkid' is the way point id #-- 'linkid' is the way point id
...@@ -396,6 +449,41 @@ SELECT * FROM graph WHERE latch='dijkstras' AND origid=11 AND destid=12; ...@@ -396,6 +449,41 @@ SELECT * FROM graph WHERE latch='dijkstras' AND origid=11 AND destid=12;
SELECT * FROM graph WHERE latch='dijkstras' AND origid=12 AND destid=10; SELECT * FROM graph WHERE latch='dijkstras' AND origid=12 AND destid=10;
SELECT * FROM graph WHERE latch='dijkstras' AND origid=12 AND destid=11; SELECT * FROM graph WHERE latch='dijkstras' AND origid=12 AND destid=11;
#-- reachable vertices
SELECT * FROM graph WHERE latch='dijkstras' AND origid=1;
SELECT * FROM graph WHERE latch='dijkstras' AND origid=2;
SELECT * FROM graph WHERE latch='dijkstras' AND origid=3;
SELECT * FROM graph WHERE latch='dijkstras' AND origid=4;
SELECT * FROM graph WHERE latch='dijkstras' AND origid=5;
SELECT * FROM graph WHERE latch='dijkstras' AND origid=6;
SELECT * FROM graph WHERE latch='dijkstras' AND origid=7;
#-- FIXME This is returning one result set, suspect this is a bug...?
#-- https://bugs.launchpad.net/oqgraph/+bug/1196020
SELECT * FROM graph WHERE latch='dijkstras' AND origid=8;
SELECT * FROM graph WHERE latch='dijkstras' AND origid=9;
SELECT * FROM graph WHERE latch='dijkstras' AND origid=10;
SELECT * FROM graph WHERE latch='dijkstras' AND origid=11;
SELECT * FROM graph WHERE latch='dijkstras' AND origid=12;
#-- FIXME This is returning one result set, suspect this is a bug...?
#-- https://bugs.launchpad.net/oqgraph/+bug/1196020
SELECT * FROM graph WHERE latch='dijkstras' AND origid=666;
#-- originating vertices
SELECT * FROM graph WHERE latch='dijkstras' AND destid=1;
SELECT * FROM graph WHERE latch='dijkstras' AND destid=2;
SELECT * FROM graph WHERE latch='dijkstras' AND destid=3;
SELECT * FROM graph WHERE latch='dijkstras' AND destid=4;
SELECT * FROM graph WHERE latch='dijkstras' AND destid=5;
SELECT * FROM graph WHERE latch='dijkstras' AND destid=6;
SELECT * FROM graph WHERE latch='dijkstras' AND destid=7;
#-- FIXME This is returning one result set, suspect this is a bug...?
#-- https://bugs.launchpad.net/oqgraph/+bug/1196020
SELECT * FROM graph WHERE latch='dijkstras' AND destid=8;
SELECT * FROM graph WHERE latch='dijkstras' AND destid=9;
SELECT * FROM graph WHERE latch='dijkstras' AND destid=10;
SELECT * FROM graph WHERE latch='dijkstras' AND destid=11;
SELECT * FROM graph WHERE latch='dijkstras' AND destid=12;
--echo # legacy string number --echo # legacy string number
SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=1; SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=1;
SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=2; SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=2;
......
...@@ -856,10 +856,10 @@ namespace open_query ...@@ -856,10 +856,10 @@ namespace open_query
} }
} }
break; break;
#if 0
case BREADTH_FIRST | HAVE_DEST: case BREADTH_FIRST | HAVE_DEST:
#ifdef FIXME
case DIJKSTRAS | HAVE_DEST: case DIJKSTRAS | HAVE_DEST:
#endif
if ((cursor= new (std::nothrow) stack_cursor(share)) && (orig || dest)) if ((cursor= new (std::nothrow) stack_cursor(share)) && (orig || dest))
{ {
boost::unordered_map<Vertex, Vertex> p; boost::unordered_map<Vertex, Vertex> p;
...@@ -870,6 +870,7 @@ namespace open_query ...@@ -870,6 +870,7 @@ namespace open_query
d[ *dest ] = EdgeWeight(); d[ *dest ] = EdgeWeight();
switch (ALGORITHM & op) switch (ALGORITHM & op)
{ {
#ifdef FIXME
case DIJKSTRAS: case DIJKSTRAS:
dijkstra_shortest_paths_no_init(share->g, *dest, dijkstra_shortest_paths_no_init(share->g, *dest,
make_lazy_property_map(p, identity_initializer<Vertex>()), make_lazy_property_map(p, identity_initializer<Vertex>()),
...@@ -891,6 +892,7 @@ namespace open_query ...@@ -891,6 +892,7 @@ namespace open_query
), ),
make_two_bit_judy_map(get(vertex_index, share->g))); make_two_bit_judy_map(get(vertex_index, share->g)));
break; break;
#endif
case BREADTH_FIRST: case BREADTH_FIRST:
breadth_first_visit(share->g, *dest, Q, breadth_first_visit(share->g, *dest, Q,
make_bfs_visitor( make_bfs_visitor(
...@@ -918,7 +920,6 @@ namespace open_query ...@@ -918,7 +920,6 @@ namespace open_query
} }
} }
break; break;
#endif
default: default:
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment