forked from pgRouting/pgrouting
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboyerMyrvold.result
More file actions
104 lines (101 loc) · 3.28 KB
/
Copy pathboyerMyrvold.result
File metadata and controls
104 lines (101 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
BEGIN;
BEGIN
SET client_min_messages TO NOTICE;
SET
/* :file: This file is part of the pgRouting project.
:copyright: Copyright (c) 2018-2026 pgRouting developers
:license: Creative Commons Attribution-Share Alike 3.0 https://creativecommons.org/licenses/by-sa/3.0 */
/* -- q1 */
SELECT * FROM pgr_boyerMyrvold(
'SELECT id, source, target, cost, reverse_cost
FROM edges'
);
seq | source | target | cost
-----+--------+--------+------
1 | 1 | 3 | 1
2 | 3 | 7 | 1
3 | 6 | 7 | 1
4 | 10 | 11 | 1
5 | 7 | 11 | 1
6 | 8 | 12 | 1
7 | 11 | 12 | 1
8 | 7 | 8 | 1
9 | 2 | 4 | 1
10 | 8 | 9 | 1
11 | 13 | 14 | 1
12 | 12 | 17 | 1
13 | 16 | 17 | 1
14 | 15 | 16 | 1
15 | 11 | 16 | 1
16 | 15 | 10 | 1
17 | 5 | 6 | 1
18 | 10 | 6 | 1
(18 rows)
/* -- q2 */
INSERT INTO edges (source, target, cost, reverse_cost) VALUES
(1,3,1,-1),(1,4,1,-1),(1,5,1,-1),(2,4,1,-1),(2,5,1,-1),(3,5,1,-1),(4,5,1,-1);
INSERT 0 7
/* -- q3 */
SELECT * FROM pgr_boyerMyrvold(
'SELECT id, source, target, cost, reverse_cost
FROM edges'
);
seq | source | target | cost
-----+--------+--------+------
1 | 1 | 3 | 1
2 | 1 | 4 | 1
3 | 1 | 5 | 1
4 | 2 | 4 | 1
5 | 2 | 5 | 1
6 | 3 | 5 | 1
7 | 4 | 5 | 1
8 | 1 | 3 | 1
9 | 3 | 7 | 1
10 | 6 | 7 | 1
11 | 10 | 11 | 1
12 | 7 | 11 | 1
13 | 8 | 12 | 1
14 | 11 | 12 | 1
15 | 7 | 8 | 1
16 | 2 | 4 | 1
17 | 8 | 9 | 1
18 | 13 | 14 | 1
19 | 12 | 17 | 1
20 | 16 | 17 | 1
21 | 15 | 16 | 1
22 | 11 | 16 | 1
23 | 15 | 10 | 1
24 | 5 | 6 | 1
25 | 10 | 6 | 1
(25 rows)
/* -- q4 */
SELECT * FROM pgr_boyerMyrvold(
$$
SELECT id, source, target, cost, reverse_cost FROM edges
where source = any (ARRAY(SELECT node FROM pgr_connectedComponents(
'SELECT id, source, target, cost, reverse_cost FROM edges ')
WHERE component = 14)
)
OR
target = any (ARRAY(SELECT node FROM pgr_connectedComponents(
'SELECT id, source, target, cost, reverse_cost FROM edges ')
WHERE component = 14)
)
$$
);
ERROR: No edges found
HINT:
SELECT id, source, target, cost, reverse_cost FROM edges
where source = any (ARRAY(SELECT node FROM pgr_connectedComponents(
'SELECT id, source, target, cost, reverse_cost FROM edges ')
WHERE component = 14)
)
OR
target = any (ARRAY(SELECT node FROM pgr_connectedComponents(
'SELECT id, source, target, cost, reverse_cost FROM edges ')
WHERE component = 14)
)
CONTEXT: SQL function "pgr_boyermyrvold" statement 1
/* -- q5 */
ROLLBACK;
ROLLBACK