pgRouting / pgrouting

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

Add predecessor column dd and withpoints dd #2570

Closed cvvergara closed 1 year ago

cvvergara commented 1 year ago

predecessor column

As the pgr_withPointsDD and pgr_drivingDistance were modified and added the column depth on the results, this PR adds an aditional column pred on the results.

SELECT * FROM pgr_drivingDistance(
  'SELECT id, source, target, cost, reverse_cost FROM edges',
  array[11, 16], 3.0, equicost => true);
 seq | depth | start_vid | pred | node | edge | cost | agg_cost
-----+-------+-----------+------+------+------+------+----------
   1 |     0 |        11 |   11 |   11 |   -1 |    0 |        0
   2 |     1 |        11 |   11 |    7 |    8 |    1 |        1
   3 |     1 |        11 |   11 |   12 |   11 |    1 |        1
   4 |     2 |        11 |    7 |    3 |    7 |    1 |        2
   5 |     2 |        11 |    7 |    6 |    4 |    1 |        2
   6 |     2 |        11 |    7 |    8 |   10 |    1 |        2
   7 |     3 |        11 |    3 |    1 |    6 |    1 |        3
   8 |     3 |        11 |    6 |    5 |    1 |    1 |        3
   9 |     3 |        11 |    8 |    9 |   14 |    1 |        3
  10 |     0 |        16 |   16 |   16 |   -1 |    0 |        0
  11 |     1 |        16 |   16 |   15 |   16 |    1 |        1
  12 |     1 |        16 |   16 |   17 |   15 |    1 |        1
  13 |     2 |        16 |   15 |   10 |    3 |    1 |        2
(13 rows)

Some standardization

Renaming new internal functions and not using default values on them:

TODO:

@pgRouting/admins

cvvergara commented 1 year ago

@aryan1010 @squarege thanks, I love that you like the changes :-) still have work to do.

cvvergara commented 1 year ago

Update test:

https://github.com/cvvergara/pgrouting/actions/runs/6340845911

cvvergara commented 1 year ago

Additionally

_pgr_v4drivingDistance -> _pgr_drivingDistancev4 _pgr_v4withPointsDD -> _pgr_withPointsDDv4 _v4pgr_ksp -> _pgr_kspv4 _pgr_v4withPointsKSP -> _pgr_withPointsKSPv4 _trsp -> _pgr_trspv4