|
6 | 6 | SELECT * FROM pgr_binaryBreadthFirstSearch( |
7 | 7 | 'SELECT id, source, target, cost, reverse_cost from edges', |
8 | 8 | 6, 10, true); |
9 | | - seq | path_seq | node | edge | cost | agg_cost |
10 | | ------+----------+------+------+------+---------- |
11 | | - 1 | 1 | 6 | 4 | 1 | 0 |
12 | | - 2 | 2 | 7 | 8 | 1 | 1 |
13 | | - 3 | 3 | 11 | 9 | 1 | 2 |
14 | | - 4 | 4 | 16 | 16 | 1 | 3 |
15 | | - 5 | 5 | 15 | 3 | 1 | 4 |
16 | | - 6 | 6 | 10 | -1 | 0 | 5 |
| 9 | + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost |
| 10 | +-----+----------+-----------+---------+------+------+------+---------- |
| 11 | + 1 | 1 | 6 | 10 | 6 | 4 | 1 | 0 |
| 12 | + 2 | 2 | 6 | 10 | 7 | 8 | 1 | 1 |
| 13 | + 3 | 3 | 6 | 10 | 11 | 9 | 1 | 2 |
| 14 | + 4 | 4 | 6 | 10 | 16 | 16 | 1 | 3 |
| 15 | + 5 | 5 | 6 | 10 | 15 | 3 | 1 | 4 |
| 16 | + 6 | 6 | 6 | 10 | 10 | -1 | 0 | 5 |
17 | 17 | (6 rows) |
18 | 18 |
|
19 | 19 | /* -- q2 */ |
20 | 20 | SELECT * FROM pgr_binaryBreadthFirstSearch( |
21 | 21 | 'SELECT id, source, target, cost, reverse_cost from edges', |
22 | 22 | 6, ARRAY[10, 17]); |
23 | | - seq | path_seq | end_vid | node | edge | cost | agg_cost |
24 | | ------+----------+---------+------+------+------+---------- |
25 | | - 1 | 1 | 10 | 6 | 4 | 1 | 0 |
26 | | - 2 | 2 | 10 | 7 | 8 | 1 | 1 |
27 | | - 3 | 3 | 10 | 11 | 9 | 1 | 2 |
28 | | - 4 | 4 | 10 | 16 | 16 | 1 | 3 |
29 | | - 5 | 5 | 10 | 15 | 3 | 1 | 4 |
30 | | - 6 | 6 | 10 | 10 | -1 | 0 | 5 |
31 | | - 7 | 1 | 17 | 6 | 4 | 1 | 0 |
32 | | - 8 | 2 | 17 | 7 | 8 | 1 | 1 |
33 | | - 9 | 3 | 17 | 11 | 11 | 1 | 2 |
34 | | - 10 | 4 | 17 | 12 | 13 | 1 | 3 |
35 | | - 11 | 5 | 17 | 17 | -1 | 0 | 4 |
| 23 | + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost |
| 24 | +-----+----------+-----------+---------+------+------+------+---------- |
| 25 | + 1 | 1 | 6 | 10 | 6 | 4 | 1 | 0 |
| 26 | + 2 | 2 | 6 | 10 | 7 | 8 | 1 | 1 |
| 27 | + 3 | 3 | 6 | 10 | 11 | 9 | 1 | 2 |
| 28 | + 4 | 4 | 6 | 10 | 16 | 16 | 1 | 3 |
| 29 | + 5 | 5 | 6 | 10 | 15 | 3 | 1 | 4 |
| 30 | + 6 | 6 | 6 | 10 | 10 | -1 | 0 | 5 |
| 31 | + 7 | 1 | 6 | 17 | 6 | 4 | 1 | 0 |
| 32 | + 8 | 2 | 6 | 17 | 7 | 8 | 1 | 1 |
| 33 | + 9 | 3 | 6 | 17 | 11 | 11 | 1 | 2 |
| 34 | + 10 | 4 | 6 | 17 | 12 | 13 | 1 | 3 |
| 35 | + 11 | 5 | 6 | 17 | 17 | -1 | 0 | 4 |
36 | 36 | (11 rows) |
37 | 37 |
|
38 | 38 | /* -- q3 */ |
39 | 39 | SELECT * FROM pgr_binaryBreadthFirstSearch( |
40 | 40 | 'SELECT id, source, target, cost, reverse_cost from edges', |
41 | 41 | ARRAY[6, 1], 17); |
42 | | - seq | path_seq | start_vid | node | edge | cost | agg_cost |
43 | | ------+----------+-----------+------+------+------+---------- |
44 | | - 1 | 1 | 1 | 1 | 6 | 1 | 0 |
45 | | - 2 | 2 | 1 | 3 | 7 | 1 | 1 |
46 | | - 3 | 3 | 1 | 7 | 8 | 1 | 2 |
47 | | - 4 | 4 | 1 | 11 | 11 | 1 | 3 |
48 | | - 5 | 5 | 1 | 12 | 13 | 1 | 4 |
49 | | - 6 | 6 | 1 | 17 | -1 | 0 | 5 |
50 | | - 7 | 1 | 6 | 6 | 4 | 1 | 0 |
51 | | - 8 | 2 | 6 | 7 | 8 | 1 | 1 |
52 | | - 9 | 3 | 6 | 11 | 11 | 1 | 2 |
53 | | - 10 | 4 | 6 | 12 | 13 | 1 | 3 |
54 | | - 11 | 5 | 6 | 17 | -1 | 0 | 4 |
| 42 | + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost |
| 43 | +-----+----------+-----------+---------+------+------+------+---------- |
| 44 | + 1 | 1 | 1 | 17 | 1 | 6 | 1 | 0 |
| 45 | + 2 | 2 | 1 | 17 | 3 | 7 | 1 | 1 |
| 46 | + 3 | 3 | 1 | 17 | 7 | 8 | 1 | 2 |
| 47 | + 4 | 4 | 1 | 17 | 11 | 11 | 1 | 3 |
| 48 | + 5 | 5 | 1 | 17 | 12 | 13 | 1 | 4 |
| 49 | + 6 | 6 | 1 | 17 | 17 | -1 | 0 | 5 |
| 50 | + 7 | 1 | 6 | 17 | 6 | 4 | 1 | 0 |
| 51 | + 8 | 2 | 6 | 17 | 7 | 8 | 1 | 1 |
| 52 | + 9 | 3 | 6 | 17 | 11 | 11 | 1 | 2 |
| 53 | + 10 | 4 | 6 | 17 | 12 | 13 | 1 | 3 |
| 54 | + 11 | 5 | 6 | 17 | 17 | -1 | 0 | 4 |
55 | 55 | (11 rows) |
56 | 56 |
|
57 | 57 | /* -- q4 */ |
|
0 commit comments