Skip to content

Commit 885da60

Browse files
authored
Merge pull request #452 from wifiBlack/week-3-king-minDegree-ordering
Week 3 king and minimumdegree ordering
2 parents 85a7621 + ce42f3a commit 885da60

26 files changed

+186
-307
lines changed

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ Standardize output columns of functions with different output columns within ove
101101

102102
* Output columns standardized to ``(seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)``
103103

104+
* [#2908](https://github.com/pgRouting/pgrouting/issues/2908)
105+
pgr_binaryBreadthFirstSearch
106+
107+
* Output columns standardized to ``(seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)``
108+
104109
* [#2910](https://github.com/pgRouting/pgrouting/issues/2910)
105110
pgr_edwardMoore
106111

doc/src/migration.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ types.
8181
- `Migration of single path functions`_
8282
* - .. versionchanged:: 4.0.0 :doc:`pgr_bellmanFord` [3]_
8383
- `Migration of single path functions`_
84+
* - .. versionchanged:: 4.0.0 :doc:`pgr_binaryBreadthFirstSearch` [3]_
85+
- `Migration of single path functions`_
8486
* - .. versionchanged:: 4.0.0 :doc:`pgr_dagShortestPath` [3]_
8587
- `Migration of single path functions`_
8688
* - .. versionchanged:: 4.0.0 :doc:`pgr_edwardMoore` [3]_

doc/src/release_notes.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ Standardize output columns of functions with different output columns within ove
122122
:start-after: Version 4.0.0
123123
:end-before: .. rubric
124124

125+
* `#2908 <https://github.com/pgRouting/pgrouting/issues/2908>`__
126+
pgr_binaryBreadthFirstSearch
127+
128+
.. include:: pgr_binaryBreadthFirstSearch.rst
129+
:start-after: Version 4.0.0
130+
:end-before: .. rubric
131+
125132
* `#2910 <https://github.com/pgRouting/pgrouting/issues/2910>`__
126133
pgr_edwardMoore
127134

doc/traversal/pgr_binaryBreadthFirstSearch.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,19 @@ non-negative integer, is termed as a 'binary graph'.
2929

3030
.. rubric:: Availability
3131

32-
* Version 3.2.0
32+
.. rubric:: Version 4.0.0
3333

34-
* New experimental signature:
34+
* Output columns standardized to |short-generic-result|
3535

36-
* pgr_binaryBreadthFirstSearch(Combinations)
36+
.. rubric:: Version 3.2.0
3737

38-
* Version 3.0.0
38+
* New experimental signature:
3939

40-
* New experimental function.
40+
* pgr_binaryBreadthFirstSearch(Combinations)
41+
42+
.. rubric:: Version 3.0.0
43+
44+
* New experimental function.
4145

4246
Description
4347
-------------------------------------------------------------------------------
@@ -47,7 +51,7 @@ vertices can be found using Breadth First Search in :math:`O(|E|)` in an
4751
unweighted graph, i.e. the distance is the minimal number of edges that you
4852
need to traverse from the source to another vertex. We can interpret such a
4953
graph also as a weighted graph, where every edge has the weight :math:`1`.
50-
If not alledges in graph have the same weight, that we need a more general
54+
If not all edges in graph have the same weight, that we need a more general
5155
algorithm, like Dijkstra's Algorithm which runs in :math:`O(|E|log|V|)` time.
5256

5357
However if the weights are more constrained, we can use a faster algorithm.
@@ -87,7 +91,7 @@ Signatures
8791
| pgr_binaryBreadthFirstSearch(`Edges SQL`_, **start vids**, **end vids**, [``directed``])
8892
| pgr_binaryBreadthFirstSearch(`Edges SQL`_, `Combinations SQL`_, [``directed``])
8993
90-
| Returns set of |old-generic-result|
94+
| Returns set of |short-generic-result|
9195
| OR EMPTY SET
9296
9397
**Note:** Using the :doc:`sampledata` Network as all weights are same (i.e
@@ -104,7 +108,7 @@ One to One
104108

105109
| pgr_binaryBreadthFirstSearch(`Edges SQL`_, **start vid**, **end vid**, [``directed``])
106110
107-
| Returns set of |result-1-1|
111+
| Returns set of |short-generic-result|
108112
| OR EMPTY SET
109113
110114
:Example: From vertex :math:`6` to vertex :math:`10` on a **directed** graph
@@ -124,7 +128,7 @@ One to Many
124128

125129
| pgr_binaryBreadthFirstSearch(`Edges SQL`_, **start vid**, **end vids**, [``directed``])
126130
127-
| Returns set of |result-1-m|
131+
| Returns set of |short-generic-result|
128132
| OR EMPTY SET
129133
130134
:Example: From vertex :math:`6` to vertices :math:`\{10, 17\}` on a **directed**
@@ -145,7 +149,7 @@ Many to One
145149

146150
| pgr_binaryBreadthFirstSearch(`Edges SQL`_, **start vids**, **end vid**, [``directed``])
147151
148-
| Returns set of |result-m-1|
152+
| Returns set of |short-generic-result|
149153
| OR EMPTY SET
150154
151155
:Example: From vertices :math:`\{6, 1\}` to vertex :math:`17` on a **directed**
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- CopyRight(c) pgRouting developers
2+
-- Creative Commons Attribution-Share Alike 3.0 License : https://creativecommons.org/licenses/by-sa/3.0/
3+
/* -- q1 */
4+
SELECT * FROM pgr_kingOrdering(
5+
'SELECT id, source, target, cost, reverse_cost FROM edges'
6+
);
7+
/* -- q2 */

docqueries/ordering/kingOrdering.result

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- CopyRight(c) pgRouting developers
2+
-- Creative Commons Attribution-Share Alike 3.0 License : https://creativecommons.org/licenses/by-sa/3.0/
3+
/* -- q1 */
4+
SELECT * FROM pgr_minDegreeOrdering(
5+
'SELECT id, source, target, cost, reverse_cost FROM edges'
6+
);
7+
/* -- q2 */

docqueries/ordering/minDegreeOrdering.result

Whitespace-only changes.

docqueries/ordering/test.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
'files' => [qw(
66
cuthillMckeeOrdering.pg
77
topologicalSort.pg
8+
minDegreeOrdering.pg
9+
kingOrdering.pg
810
)]
911
},
1012

docqueries/traversal/binaryBreadthFirstSearch.result

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,52 @@ SET
66
SELECT * FROM pgr_binaryBreadthFirstSearch(
77
'SELECT id, source, target, cost, reverse_cost from edges',
88
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
1717
(6 rows)
1818

1919
/* -- q2 */
2020
SELECT * FROM pgr_binaryBreadthFirstSearch(
2121
'SELECT id, source, target, cost, reverse_cost from edges',
2222
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
3636
(11 rows)
3737

3838
/* -- q3 */
3939
SELECT * FROM pgr_binaryBreadthFirstSearch(
4040
'SELECT id, source, target, cost, reverse_cost from edges',
4141
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
5555
(11 rows)
5656

5757
/* -- q4 */

0 commit comments

Comments
 (0)