vidhan13j07 / pgrouting

Repository contains pgRouting library. Development branch is "develop", stable branch is "master"
http://www.pgrouting.org
GNU General Public License v2.0
0 stars 0 forks source link

Add more pgtap tests for empty set. #8

Closed vidhan13j07 closed 7 years ago

vidhan13j07 commented 7 years ago
cvvergara commented 7 years ago
\i setup.sql

SELECT plan(34);

------------
-- testing from an existing starting vertex to an non-existing destination
-----------

- in directed graph
- with restrictions
PREPARE q1 AS  ....

- in indirected graph
- with restrictions
PREPARE q2 AS  ....

- in directed graph
- without restrictions
PREPARE q3 AS  ....

- in indirected graph
- without restrictions
PREPARE q4 AS  ....
cvvergara commented 7 years ago

@woodbri mentions

A common issue with routing that returns an empty set is when you have a graph that has two+ disconnected networks like: n1-n2 and n3-n4 and you try to route from n1 to n4.

there is no path given the data there is no path so EMPTY SET is this case covered in the unit tests?

I answered: currently the unit tests involve a subset of edges of the sample data, mainly edges 4 & 7 But, I will ask @vidhan13j07 to add edge 17, and make those as unit tests because yes, the unit test also must consider when the graph has more than one component

vidhan13j07 commented 7 years ago

@cvvergara, Should I create 16 more tests including edge id 17 in the edge set. I think you meant edge id 18 as it is a part of different component http://docs.pgrouting.org/2.2/en/doc/src/developer/sampledata.html

cvvergara commented 7 years ago

(using edges ids in my comment) the graph you are using is G{4, 7} , so the set edges that you can not use are: {1,2,8,6,10} because those would belong to the same component any other edge is going to be on a different component. Remember you are not using the whole graph for this initial unit tests.