Skip to content

Commit 2bc8f16

Browse files
committed
update query
1 parent aa4d7ef commit 2bc8f16

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docqueries/ordering/sloanOrdering.pg

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,41 @@ SELECT * FROM pgr_sloanOrdering(
66
);
77
/* -- q2 */
88

9+
CREATE TABLE example_edges1 (
10+
id SERIAL PRIMARY KEY,
11+
source INTEGER,
12+
target INTEGER,
13+
cost DOUBLE PRECISION,
14+
reverse_cost DOUBLE PRECISION
15+
);
16+
/* --q3 */
17+
INSERT INTO example_edges1 (source, target, cost, reverse_cost) VALUES
18+
(4, 7, 1, 1),
19+
(7, 4, 1, 1),
20+
(7, 9, 1, 1),
21+
(9, 7, 1, 1),
22+
(7, 0, 1, 1),
23+
(0, 7, 1, 1),
24+
(0, 2, 1, 1),
25+
(2, 0, 1, 1),
26+
(2, 5, 1, 1),
27+
(5, 2, 1, 1),
28+
(5, 9, 1, 1),
29+
(9, 5, 1, 1),
30+
(9, 8, 1, 1),
31+
(8, 9, 1, 1),
32+
(9, 1, 1, 1),
33+
(1, 9, 1, 1),
34+
(5, 1, 1, 1),
35+
(1, 5, 1, 1),
36+
(9, 6, 1, 1),
37+
(6, 9, 1, 1),
38+
(6, 3, 1, 1),
39+
(3, 6, 1, 1),
40+
(1, 3, 1, 1),
41+
(3, 1, 1, 1);
42+
/* --q4 */
43+
SELECT * FROM pgr_sloanOrdering(
44+
'SELECT id, source, target, cost, reverse_cost FROM example_edges1'
45+
);
46+
/* --q5 */

0 commit comments

Comments
 (0)