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
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ Summary of changes by function

* Output columns standardized to ``(seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)``

* pgr_bipartite

* Output columns standardized to ``(node, color)``

* pgr_contraction

.. Breaking change
Expand Down Expand Up @@ -267,6 +271,11 @@ Standardize output columns of functions with different output columns within ove
* [#2924](https://github.com/pgRouting/pgrouting/issues/2924)
pgr_edgeColoring

**Standardized to ``(node, color)``**

* [#2924](https://github.com/pgRouting/pgrouting/issues/2924)
pgr_bipartite

Removal of SQL deprecated signatures

* [#2798](https://github.com/pgRouting/pgrouting/issues/2798):
Expand Down
16 changes: 16 additions & 0 deletions doc/coloring/coloring-family.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@ Column Type Description

.. result-edge-color-end

.. result-node-color-start

Returns set of |result_node_color|

============ =========== =====================================
Column Type Description
============ =========== =====================================
``node`` ``BIGINT`` Identifier of the node.
``color`` ``BIGINT`` Color of the node.

- The minimum value of color is 1.

============ =========== =====================================

.. result-node-color-end

.. result columns start

Returns set of ``(vertex_id, color_id)``
Expand Down
14 changes: 9 additions & 5 deletions doc/coloring/pgr_bipartite.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ the same set are adjacent.

.. rubric:: Availability

* Version 3.2.0
.. rubric:: Version 4.0.0

* New experimental function.
* Output columns standardized to |result_node_color|

.. rubric:: Version 3.2.0

* New experimental function.

Description
-------------------------------------------------------------------------------
Expand Down Expand Up @@ -56,7 +60,7 @@ Signatures

| pgr_bipartite(`Edges SQL`_)

| Returns set of |result-node-color|
| Returns set of |result_node_color|
| OR EMPTY SET

:Example: When the graph is bipartite
Expand Down Expand Up @@ -86,8 +90,8 @@ Result columns
-------------------------------------------------------------------------------

.. include:: coloring-family.rst
:start-after: result columns start
:end-before: result columns end
:start-after: result-node-color-start
:end-before: result-node-color-end

Additional Example
--------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions doc/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ rst_epilog="""
.. |result-1-1-no-seq| replace:: ``(seq, node, edge, cost, agg_cost)``
.. |result-m-1-no-seq| replace:: ``(seq, start_vid, node, edge, cost, agg_cost)``
.. |result-node-color| replace:: ``(vertex_id, color_id)``
.. |result_node_color| replace:: ``(node, color)``
.. |result_edge_color| replace:: ``(edge, color)``
.. |result-node| replace:: ``(node)``
.. |result-edge| replace:: ``(edge)``
Expand Down
14 changes: 14 additions & 0 deletions doc/src/migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Migration to standardized columns
.. |pid-m-m| replace:: ``(seq, path_seq, start_pid, end_pid, node, edge, cost, agg_cost)``
.. |matrix-pid| replace:: ``(start_pid, end_pid, agg_cost)``
.. |old-edge-color| replace:: ``(edge_id, color_id)``
.. |old-node-color| replace:: ``(vertex_id, color_id)``

There has been an effort to standardize function output columns names and
types.
Expand Down Expand Up @@ -84,6 +85,8 @@ types.
- `Migration of single path functions`_
* - .. versionchanged:: 4.0.0 :doc:`pgr_binaryBreadthFirstSearch` [3]_
- `Migration of single path functions`_
* - .. versionchanged:: 4.0.0 :doc:`pgr_bipartite` [3]_
- `Migration of output column name change`_
* - .. versionchanged:: 4.0.0 :doc:`pgr_dagShortestPath` [3]_
- `Migration of single path functions`_
* - .. versionchanged:: 4.0.0 :doc:`pgr_edgeColoring` [3]_
Expand Down Expand Up @@ -854,6 +857,17 @@ Before update:
* To get the old version column names: in the ``SELECT`` clause use ``edge AS
edge_id`` and ``color AS color_id``

.. rubric:: :doc:`pgr_bipartite`

From: |old-node-color|
To: |result-node-color|

Before update:

* Rename ``vertex_id`` to ``node`` and ``color_id`` to ``color``.
* To get the old version column names: in the ``SELECT`` clause use ``node AS
vertex_id`` and ``color AS color_id``

Migration of deleted functions
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Expand Down
11 changes: 11 additions & 0 deletions doc/src/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ Summary of changes by function
:start-after: Version 4.0.0
:end-before: .. rubric

* pgr_bipartite

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

* pgr_contraction

.. include:: pgr_contraction.rst
Expand Down Expand Up @@ -299,6 +305,11 @@ Standardize output columns of functions with different output columns within ove
* `#2924 <https://github.com/pgRouting/pgrouting/issues/2924>`__
pgr_edgeColoring

.. rubric:: Standardized to |result_node_color|

* `#2924 <https://github.com/pgRouting/pgrouting/issues/2924>`__
pgr_bipartite

Removal of SQL deprecated signatures
...............................................................................

Expand Down
2 changes: 1 addition & 1 deletion docqueries/coloring/bipartite.pg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* --q1 */
SELECT * FROM pgr_bipartite(
$$SELECT id, source, target, cost, reverse_cost FROM edges$$
) ORDER BY vertex_id;
) ORDER BY node;
/* --q2 */
INSERT INTO edges (source, target, cost, reverse_cost) VALUES
(5, 1, 1, 1);
Expand Down
44 changes: 22 additions & 22 deletions docqueries/coloring/bipartite.result
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ SET
/* --q1 */
SELECT * FROM pgr_bipartite(
$$SELECT id, source, target, cost, reverse_cost FROM edges$$
) ORDER BY vertex_id;
vertex_id | color_id
-----------+----------
1 | 0
2 | 0
3 | 1
4 | 1
5 | 0
6 | 1
7 | 0
8 | 1
9 | 0
10 | 0
11 | 1
12 | 0
13 | 0
14 | 1
15 | 1
16 | 0
17 | 1
) ORDER BY node;
node | color
------+-------
1 | 0
2 | 0
3 | 1
4 | 1
5 | 0
6 | 1
7 | 0
8 | 1
9 | 0
10 | 0
11 | 1
12 | 0
13 | 0
14 | 1
15 | 1
16 | 0
17 | 1
(17 rows)

/* --q2 */
Expand All @@ -35,8 +35,8 @@ INSERT 0 1
SELECT * FROM pgr_bipartite(
$$SELECT id, source, target, cost, reverse_cost FROM edges$$
);
vertex_id | color_id
-----------+----------
node | color
------+-------
(0 rows)

/* --q4 */
Expand Down
13 changes: 6 additions & 7 deletions pgtap/coloring/bipartite/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
********************************************************************PGR-GNU*/
BEGIN;

SELECT CASE WHEN NOT min_version('3.2.0') THEN plan(1) ELSE plan(5) END;
SELECT CASE WHEN min_version('4.0.0') THEN plan(5) ELSE plan(1) END;

CREATE OR REPLACE FUNCTION types_check()
RETURNS SETOF TEXT AS
$BODY$
BEGIN

IF NOT min_version('3.2.0') THEN
IF NOT min_version('4.0.0') THEN
RETURN QUERY
SELECT skip(1, 'Function is new on 3.2.0');
SELECT skip(1, 'pgr_bipartite: testing only signatures standardaized in v4.0.0.');
RETURN;
END IF;

Expand All @@ -38,15 +38,14 @@ BEGIN

RETURN QUERY
SELECT function_args_eq('pgr_bipartite',
$$SELECT '{"","vertex_id","color_id"}'::TEXT[] $$
$$SELECT '{"","node","color"}'::TEXT[] $$
);

RETURN QUERY
SELECT function_types_eq('pgr_bipartite',
$$VALUES
('{text,int8,int8}'::TEXT[])
$$
$$SELECT '{text,int8,int8}'::TEXT[] $$
);

END;
$BODY$
LANGUAGE plpgsql;
Expand Down
12 changes: 3 additions & 9 deletions sql/coloring/bipartite.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,19 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

********************************************************************PGR-GNU*/
---------------
-- pgr_bipartite
---------------

--v3.2
CREATE FUNCTION pgr_bipartite(
TEXT, -- edges_sql (required)

OUT vertex_id BIGINT,
OUT color_id BIGINT)
OUT node BIGINT,
OUT color BIGINT)
RETURNS SETOF RECORD AS
$BODY$
BEGIN
RETURN QUERY
SELECT node, color
FROM _pgr_bipartite(_pgr_get_statement($1));
END;
$BODY$
LANGUAGE plpgsql VOLATILE STRICT;
LANGUAGE SQL VOLATILE STRICT;

-- COMMENTS

Expand Down
1 change: 1 addition & 0 deletions sql/scripts/build-extension-update-files.pl
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ sub generate_upgrade_script {
# Out parameters changed names on v4.0.0
# Experimental functions
push @commands, drop_special_case_function("pgr_dagshortestpath(text,text)");
push @commands, drop_special_case_function("pgr_bipartite(text)");
}

if ($old_minor >= "3.3") {
Expand Down