Skip to content

pgr_topologicalSort GSOC-2019 week 4 #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 23, 2019
Merged
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
41 changes: 21 additions & 20 deletions test/topologicalSort/doc-topologicalSort.test.sql
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@

\echo -- q1
SELECT * FROM pgr_topologicalSort(
'SELECT id, source, target, cost FROM edge_table',
1, 6
CREATE TABLE edge_table1 (
id serial,
source integer,
target integer,
cost double precision,
reverse_cost double precision
);
INSERT INTO edge_table1 (source,target,cost,reverse_cost) VALUES ( 1, 2,0,0);
INSERT INTO edge_table1 (source,target,cost,reverse_cost) VALUES (2,3,0,0);

\echo -- q2
SELECT * FROM pgr_topologicalSort(
'SELECT id, source, target, cost FROM edge_table',
1, ARRAY[5,6]
);
\echo -- q3
SELECT * FROM pgr_topologicalSort(
'SELECT id, source, target, cost FROM edge_table',
ARRAY[1,3], 6
);

\echo -- q4
SELECT * FROM pgr_topologicalSort(
'SELECT id, source, target, cost FROM edge_table',
ARRAY[1, 4],ARRAY[12,6]
SELECT * FROM pgr_topologicalsort(
'SELECT id,
source,
target,
cost,
reverse_cost
FROM edge_table1'

);
\echo -- q5

SELECT * FROM pgr_topologicalsort(
'SELECT id, source, target, cost, reverse_cost FROM edge_table1'
);

\echo -- q1