Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Functions promoted to official
* Output columns standardized to ``(seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)``
* Function promoted to official.

* [#TBD](https://github.com/pgRouting/pgrouting/issues/2798) pgr_withPointsCost
* [#2905](https://github.com/pgRouting/pgrouting/issues/2905) pgr_withPointsCost

* Output columns standardized to ``(start_vid, end_vid, agg_cost)``
* Function promoted to official.
Expand All @@ -51,6 +51,14 @@ Functions promoted to official
* pgr_maxFlow(Combinations)
* pgr_pushRelabel(Combinations)

SQL signatures modification on functions
...............................................................................

* [#2906](https://github.com/pgRouting/pgrouting/issues/2906) pgr_bdDijkstra

* Output columns standardized to ``(seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)``
* Combinations signature promoted to official.


Removal of SQL deprecated signatures
...............................................................................
Expand Down
43 changes: 22 additions & 21 deletions doc/bdDijkstra/pgr_bdDijkstra.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,38 @@ algorithm.

.. rubric:: Availability:

* Version 4.0.0
.. rubric:: Version 4.0.0

* Combinations signature promoted to official.
* Output columns standardized to |short-generic-result|
* Combinations signature promoted to official.

* Version 3.2.0
.. rubric:: Version 3.2.0

* New proposed signature:
* New proposed signature:

* pgr_bdDijkstra(Combinations)
* pgr_bdDijkstra(Combinations)

* Version 3.0.0
.. rubric:: Version 3.0.0

* Function promoted to official.
* Function promoted to official.

* Version 2.5.0
.. rubric:: Version 2.5.0

* New proposed signatures:
* New proposed signatures:

* pgr_bdDijkstra(One to Many)
* pgr_bdDijkstra(Many to One)
* pgr_bdDijkstra(Many to Many)
* pgr_bdDijkstra(One to Many)
* pgr_bdDijkstra(Many to One)
* pgr_bdDijkstra(Many to Many)

* Version 2.4.0
.. rubric:: Version 2.4.0

* Signature change on pgr_bdDijsktra(One to One)
* Signature change on pgr_bdDijsktra(One to One)

* Old signature no longer supported
* Old signature no longer supported

* Version 2.0.0
.. rubric:: Version 2.0.0

* New official function.
* New official function.


Description
Expand Down Expand Up @@ -79,7 +80,7 @@ Signatures
| pgr_bdDijkstra(`Edges SQL`_, **start vids**, **end vids**, [``directed``])
| pgr_bdDijkstra(`Edges SQL`_, `Combinations SQL`_, [``directed``])

| Returns set of |old-generic-result|
| Returns set of |short-generic-result|
| OR EMPTY SET

.. index::
Expand All @@ -93,7 +94,7 @@ One to One

| pgr_bdDijkstra(`Edges SQL`_, **start vid**, **end vid**, [``directed``])

| Returns set of |result-1-1|
| Returns set of |short-generic-result|
| OR EMPTY SET

:Example: From vertex :math:`6` to vertex :math:`10` on a **directed** graph
Expand All @@ -113,7 +114,7 @@ One to Many

| pgr_bdDijkstra(`Edges SQL`_, **start vid**, **end vids**, [``directed``])

| Returns set of |result-1-m|
| Returns set of |short-generic-result|
| OR EMPTY SET

:Example: From vertex :math:`6` to vertices :math:`\{10, 17\}` on a **directed**
Expand All @@ -134,7 +135,7 @@ Many to One

| pgr_bdDijkstra(`Edges SQL`_, **start vids**, **end vid**, [``directed``])

| Returns set of |result-m-1|
| Returns set of |short-generic-result|
| OR EMPTY SET

:Example: From vertices :math:`\{6, 1\}` to vertex :math:`17` on a **directed**
Expand Down
88 changes: 88 additions & 0 deletions doc/src/migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,97 @@ If you have SFCGAL, which you can install using
* For PostGIS 3.5+ use the old name ``ST_AlphaShape``

Other PostGIS options are

* `ST_ConvexHull <https://postgis.net/docs/ST_ConvexHull.html>`__
* `ST_ConcaveHull <https://postgis.net/docs/ST_ConcaveHull.html>`__

Migration of ``pgr_bdDijkstra``
-------------------------------------------------------------------------------

Starting from `v4.0.0 <https://docs.pgrouting.org/4.0/en/migration.html>`__
:doc:`pgr_bdDijkstra` result columns are being standardized.

:from: |old-generic-result|
:to: |short-generic-result|

Signatures to be migrated:

* ``pgr_bdDijkstra`` (One to One)
* ``pgr_bdDijkstra`` (One to Many)
* ``pgr_bdDijkstra`` (Many to One)

.. rubric:: Before Migration

Output columns were |old-generic-result|

.. rubric:: Migration

Output columns are |short-generic-result|

To get the old version column names, depending on the signature:

* Filter out the columns: ``start_vid`` and/or ``end_vid``

``pgr_bdDijkstra`` (`One to One`)
...............................................................................

Using
`this <https://docs.pgrouting.org/3.8/en/pgr_bdDijkstra.html#one-to-one>`__
example.

:from: |result-1-1|
:to: |short-generic-result|

.. literalinclude:: migration.queries
:start-after: --bdDijkstra-1-to-1
:end-before: --bdDijkstra-1-to-1-filter

Get the old signature columns by filtering out the extra columns.

.. literalinclude:: migration.queries
:start-after: --bdDijkstra-1-to-1-filter
:end-before: --bdDijkstra-1-to-m

``pgr_bdDijkstra`` (`One to Many`)
...............................................................................

Using
`this <https://docs.pgrouting.org/3.8/en/pgr_bdDijkstra.html#one-to-many>`__
example.

:from: |result-1-m|
:to: |short-generic-result|

.. literalinclude:: migration.queries
:start-after: --bdDijkstra-1-to-m
:end-before: --bdDijkstra-1-to-m-filter

Get the old signature columns by filtering out the extra columns.

.. literalinclude:: migration.queries
:start-after: --bdDijkstra-1-to-m-filter
:end-before: --bdDijkstra-m-to-1

``pgr_bdDijkstra`` (`Many to One`)
...............................................................................

Using
`this <https://docs.pgrouting.org/3.8/en/pgr_bdDijkstra.html#many-to-one>`__
example.

:from: |result-m-1|
:to: |generic-result|

.. literalinclude:: migration.queries
:start-after: --bdDijkstra-m-to-1
:end-before: --bdDijkstra-m-to-1-filter

Get the old signature columns by filtering out the extra columns.

.. literalinclude:: migration.queries
:start-after: --bdDijkstra-m-to-1-filter
:end-before: --bdDijkstra-END

Migration of ``pgr_nodeNetwork``
-------------------------------------------------------------------------------

Expand Down
11 changes: 10 additions & 1 deletion doc/src/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Functions promoted to official
:start-after: Version 4.0.0
:end-before: .. rubric

* `#TBD <https://github.com/pgRouting/pgrouting/issues/2798>`__ pgr_withPointsCost
* `#2905 <https://github.com/pgRouting/pgrouting/issues/2905>`__ pgr_withPointsCost

.. include:: pgr_withPointsCost.rst
:start-after: Version 4.0.0
Expand All @@ -83,6 +83,15 @@ Functions promoted to official
* pgr_maxFlow(Combinations)
* pgr_pushRelabel(Combinations)

SQL signatures modification on functions
...............................................................................

* `#2906 <https://github.com/pgRouting/pgrouting/issues/2906>`__ pgr_bdDijkstra

.. include:: pgr_bdDijkstra.rst
:start-after: Version 4.0.0
:end-before: .. rubric


Removal of SQL deprecated signatures
...............................................................................
Expand Down
68 changes: 34 additions & 34 deletions docqueries/bdDijkstra/bdDijkstra.result
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,52 @@ SET
SELECT * FROM pgr_bdDijkstra(
'select id, source, target, cost, reverse_cost from edges',
6, 10, true);
seq | path_seq | node | edge | cost | agg_cost
-----+----------+------+------+------+----------
1 | 1 | 6 | 4 | 1 | 0
2 | 2 | 7 | 8 | 1 | 1
3 | 3 | 11 | 9 | 1 | 2
4 | 4 | 16 | 16 | 1 | 3
5 | 5 | 15 | 3 | 1 | 4
6 | 6 | 10 | -1 | 0 | 5
seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost
-----+----------+-----------+---------+------+------+------+----------
1 | 1 | 6 | 10 | 6 | 4 | 1 | 0
2 | 2 | 6 | 10 | 7 | 8 | 1 | 1
3 | 3 | 6 | 10 | 11 | 9 | 1 | 2
4 | 4 | 6 | 10 | 16 | 16 | 1 | 3
5 | 5 | 6 | 10 | 15 | 3 | 1 | 4
6 | 6 | 6 | 10 | 10 | -1 | 0 | 5
(6 rows)

/* -- q3 */
SELECT * FROM pgr_bdDijkstra(
'select id, source, target, cost, reverse_cost from edges',
6, ARRAY[10, 17]);
seq | path_seq | end_vid | node | edge | cost | agg_cost
-----+----------+---------+------+------+------+----------
1 | 1 | 10 | 6 | 4 | 1 | 0
2 | 2 | 10 | 7 | 8 | 1 | 1
3 | 3 | 10 | 11 | 9 | 1 | 2
4 | 4 | 10 | 16 | 16 | 1 | 3
5 | 5 | 10 | 15 | 3 | 1 | 4
6 | 6 | 10 | 10 | -1 | 0 | 5
7 | 1 | 17 | 6 | 4 | 1 | 0
8 | 2 | 17 | 7 | 8 | 1 | 1
9 | 3 | 17 | 11 | 11 | 1 | 2
10 | 4 | 17 | 12 | 13 | 1 | 3
11 | 5 | 17 | 17 | -1 | 0 | 4
seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost
-----+----------+-----------+---------+------+------+------+----------
1 | 1 | 6 | 10 | 6 | 4 | 1 | 0
2 | 2 | 6 | 10 | 7 | 8 | 1 | 1
3 | 3 | 6 | 10 | 11 | 9 | 1 | 2
4 | 4 | 6 | 10 | 16 | 16 | 1 | 3
5 | 5 | 6 | 10 | 15 | 3 | 1 | 4
6 | 6 | 6 | 10 | 10 | -1 | 0 | 5
7 | 1 | 6 | 17 | 6 | 4 | 1 | 0
8 | 2 | 6 | 17 | 7 | 8 | 1 | 1
9 | 3 | 6 | 17 | 11 | 11 | 1 | 2
10 | 4 | 6 | 17 | 12 | 13 | 1 | 3
11 | 5 | 6 | 17 | 17 | -1 | 0 | 4
(11 rows)

/* -- q4 */
SELECT * FROM pgr_bdDijkstra(
'select id, source, target, cost, reverse_cost from edges',
ARRAY[6, 1], 17);
seq | path_seq | start_vid | node | edge | cost | agg_cost
-----+----------+-----------+------+------+------+----------
1 | 1 | 1 | 1 | 6 | 1 | 0
2 | 2 | 1 | 3 | 7 | 1 | 1
3 | 3 | 1 | 7 | 8 | 1 | 2
4 | 4 | 1 | 11 | 11 | 1 | 3
5 | 5 | 1 | 12 | 13 | 1 | 4
6 | 6 | 1 | 17 | -1 | 0 | 5
7 | 1 | 6 | 6 | 4 | 1 | 0
8 | 2 | 6 | 7 | 8 | 1 | 1
9 | 3 | 6 | 11 | 11 | 1 | 2
10 | 4 | 6 | 12 | 13 | 1 | 3
11 | 5 | 6 | 17 | -1 | 0 | 4
seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost
-----+----------+-----------+---------+------+------+------+----------
1 | 1 | 1 | 17 | 1 | 6 | 1 | 0
2 | 2 | 1 | 17 | 3 | 7 | 1 | 1
3 | 3 | 1 | 17 | 7 | 8 | 1 | 2
4 | 4 | 1 | 17 | 11 | 11 | 1 | 3
5 | 5 | 1 | 17 | 12 | 13 | 1 | 4
6 | 6 | 1 | 17 | 17 | -1 | 0 | 5
7 | 1 | 6 | 17 | 6 | 4 | 1 | 0
8 | 2 | 6 | 17 | 7 | 8 | 1 | 1
9 | 3 | 6 | 17 | 11 | 11 | 1 | 2
10 | 4 | 6 | 17 | 12 | 13 | 1 | 3
11 | 5 | 6 | 17 | 17 | -1 | 0 | 4
(11 rows)

/* -- q5 */
Expand Down
16 changes: 8 additions & 8 deletions docqueries/contraction/contractionHierarchies.result
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ SELECT * FROM pgr_bdDijkstra(
'SELECT id, source, target, cost, reverse_cost FROM edges',
1, 17
);
seq | path_seq | node | edge | cost | agg_cost
-----+----------+------+------+------+----------
1 | 1 | 1 | 6 | 1 | 0
2 | 2 | 3 | 7 | 1 | 1
3 | 3 | 7 | 8 | 1 | 2
4 | 4 | 11 | 11 | 1 | 3
5 | 5 | 12 | 13 | 1 | 4
6 | 6 | 17 | -1 | 0 | 5
seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost
-----+----------+-----------+---------+------+------+------+----------
1 | 1 | 1 | 17 | 1 | 6 | 1 | 0
2 | 2 | 1 | 17 | 3 | 7 | 1 | 1
3 | 3 | 1 | 17 | 7 | 8 | 1 | 2
4 | 4 | 1 | 17 | 11 | 11 | 1 | 3
5 | 5 | 1 | 17 | 12 | 13 | 1 | 4
6 | 6 | 1 | 17 | 17 | -1 | 0 | 5
(6 rows)

/* -- q9 */
Expand Down
32 changes: 32 additions & 0 deletions docqueries/src/migration.pg
Original file line number Diff line number Diff line change
Expand Up @@ -490,3 +490,35 @@ FROM pgr_withPointsCost(
'SELECT * FROM (VALUES (-1, 10), (6, -3)) AS combinations(source, target)',
driving_side => 'r');
/* --withPointsCost-END */

-- bdDijkstra
/* --bdDijkstra-1-to-1 */
SELECT * FROM pgr_bdDijkstra(
'select id, source, target, cost, reverse_cost from edges',
6, 10, true);
/* --bdDijkstra-1-to-1-filter */
SELECT seq, path_seq, node, edge, cost, agg_cost
FROM pgr_bdDijkstra(
'select id, source, target, cost, reverse_cost from edges',
6, 10, true);
/* --bdDijkstra-1-to-m */
SELECT * FROM pgr_bdDijkstra(
'select id, source, target, cost, reverse_cost from edges',
6, ARRAY[10, 17]);
/* --bdDijkstra-1-to-m-filter */
SELECT seq, path_seq, end_vid AS end_pid, node, edge, cost, agg_cost
FROM pgr_bdDijkstra(
'select id, source, target, cost, reverse_cost from edges',
6, ARRAY[10, 17]);
/* --bdDijkstra-m-to-1 */
SELECT * FROM pgr_bdDijkstra(
'select id, source, target, cost, reverse_cost from edges',
ARRAY[6, 1], 17);
/* --bdDijkstra-m-to-1-filter */
SELECT seq, path_seq, start_vid AS start_pid, node, edge, cost, agg_cost
FROM pgr_bdDijkstra(
'select id, source, target, cost, reverse_cost from edges',
ARRAY[6, 1], 17);
/* --bdDijkstra-END */


Loading