Skip to content

Commit

Permalink
[bipartite] renamed output column to vertex_id and color_id
Browse files Browse the repository at this point in the history
  • Loading branch information
prakashupes authored and cvvergara committed Aug 24, 2020
1 parent 584bd47 commit ef00f57
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
54 changes: 27 additions & 27 deletions docqueries/coloring/doc-bipartite.result
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,45 @@ INSERT 0 5
SELECT * FROM pgr_bipartite(
$$SELECT id,source,target,cost,reverse_cost FROM edge_table$$
);
node | color
------+-------
1 | 0
2 | 1
3 | 0
4 | 1
5 | 0
6 | 1
7 | 0
8 | 1
9 | 0
10 | 1
11 | 0
12 | 1
13 | 0
14 | 0
15 | 1
16 | 0
17 | 1
vertex_id | color_id
-----------+----------
1 | 0
2 | 1
3 | 0
4 | 1
5 | 0
6 | 1
7 | 0
8 | 1
9 | 0
10 | 1
11 | 0
12 | 1
13 | 0
14 | 0
15 | 1
16 | 0
17 | 1
(17 rows)

--q2
SELECT * FROM pgr_bipartite(
$$SELECT id,source,target,cost,reverse_cost FROM edge_table WHERE id IN (8, 10, 11, 12)$$
);
node | color
------+-------
5 | 0
6 | 1
10 | 1
11 | 0
vertex_id | color_id
-----------+----------
5 | 0
6 | 1
10 | 1
11 | 0
(4 rows)

--q3
SELECT * FROM pgr_bipartite(
$$SELECT id,source,target,cost,reverse_cost FROM five_vertices_table$$
);
node | color
------+-------
vertex_id | color_id
-----------+----------
(0 rows)

--q4
Expand Down
6 changes: 3 additions & 3 deletions sql/coloring/bipartite.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
CREATE OR REPLACE FUNCTION pgr_bipartite(
TEXT, -- edges_sql (required)

OUT node BIGINT,
OUT color BIGINT)
OUT vertex_id BIGINT,
OUT color_id BIGINT)
RETURNS SETOF RECORD AS
$BODY$
BEGIN
Expand All @@ -53,4 +53,4 @@ IS 'pgr_bipartite
- Edges SQL with columns: id, source, target, cost [,reverse_cost]
- Documentation:
- ${PGROUTING_DOC_LINK}/pgr_bipartite.html
';
';

0 comments on commit ef00f57

Please sign in to comment.