Skip to content

Commit be70aac

Browse files
committed
(bandwidth/doc) Adding test documentation for pgr_bandwidth
1 parent 1484c50 commit be70aac

5 files changed

Lines changed: 170 additions & 0 deletions

File tree

doc/_static/page_history.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var titles = [
1515

1616

1717
var newpages = [
18+
{v: '4.0', pages: ['pgr_bandwidth']},
1819
{v: '3.8', pages: ['pgr_contractionDeadEnd', 'pgr_contractionLinear', 'pgr_separateCrossing',
1920
'pgr_separateTouching']},
2021

doc/metrics/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ SET(LOCAL_FILES
33
metrics-family.rst
44
pgr_betweennessCentrality.rst
55
pgr_degree.rst
6+
pgr_bandwidth.rst
67
)
78

89
foreach (f ${LOCAL_FILES})

doc/metrics/metrics-family.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,16 @@ Metrics - Family of functions
3131
* :doc:`pgr_betweennessCentrality` - Calculates relative betweenness centrality
3232
using Brandes Algorithm
3333

34+
* :doc:`pgr_bandwidth` - Computes the bandwidth of a graph.
35+
3436
.. experimental-end
3537
3638
.. toctree::
3739
:hidden:
3840

3941
pgr_degree
4042
pgr_betweennessCentrality
43+
pgr_bandwidth
4144

4245
See Also
4346
-------------------------------------------------------------------------------

doc/metrics/pgr_bandwidth.rst

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
..
2+
****************************************************************************
3+
pgRouting Manual
4+
Copyright(c) pgRouting Contributors
5+
6+
This documentation is licensed under a Creative Commons Attribution-Share
7+
Alike 3.0 License: https://creativecommons.org/licenses/by-sa/3.0/
8+
****************************************************************************
9+
10+
.. index::
11+
single: Metrics Family ; pgr_bandwidth - Experimental
12+
single: bandwidth - Experimental on v4.0
13+
14+
|
15+
16+
``pgr_bandwidth`` - Experimental
17+
===============================================================================
18+
19+
``pgr_bandwidth`` - Calculates the bandwidth of the graph
20+
21+
.. include:: experimental.rst
22+
:start-after: warning-begin
23+
:end-before: end-warning
24+
25+
.. rubric:: Availability
26+
27+
.. rubic:: Version 4.0.0
28+
29+
* New experimental function.
30+
31+
Description
32+
-------------------------------------------------------------------------------
33+
34+
Bandwidth measures how "spread out" the connections are in a graph when vertices are arranged in a linear order (like numbering them 1, 2, 3, etc.).
35+
36+
* For each edge in the graph, calculate the distance between the vertex numbers it connects
37+
* The bandwidth is the maximum of all these distances
38+
* The implementation is for undirected graphs
39+
* Run time is 0.160789 seconds
40+
41+
|Boost| Boost Graph Inside
42+
43+
Signatures
44+
-------------------------------------------------------------------------------
45+
46+
.. rubric:: Summary
47+
48+
.. admonition:: \ \
49+
:class: signatures
50+
51+
pgr_bandwidth(`Edges SQL`_)
52+
53+
| Returns ``BIGINT``
54+
55+
:Example: For an undirected graph with edges.
56+
57+
.. literalinclude:: bandwidth.queries
58+
:start-after: -- q1
59+
:end-before: -- q2
60+
61+
Parameters
62+
-------------------------------------------------------------------------------
63+
64+
.. include:: pgRouting-concepts.rst
65+
:start-after: edges_start
66+
:end-before: edges_end
67+
68+
Inner Queries
69+
-------------------------------------------------------------------------------
70+
71+
Edges SQL
72+
...............................................................................
73+
74+
.. include:: pgRouting-concepts.rst
75+
:start-after: basic_edges_sql_start
76+
:end-before: basic_edges_sql_end
77+
78+
Result columns
79+
-------------------------------------------------------------------------------
80+
81+
Returns a bigint ``(pgr_bandwidth)``
82+
83+
================= =========== ==========================================
84+
Column Type Description
85+
================= =========== ==========================================
86+
``pgr_bandwidth`` ``BIGINT`` gives the bandwidth of the graph.
87+
================= =========== ==========================================
88+
89+
Additional Examples
90+
-------------------------------------------------------------------------------
91+
92+
:Example: Undirected graph with edges before optimization.
93+
94+
.. graphviz::
95+
96+
graph G {
97+
node [shape=circle, style=filled, fillcolor=white, color=black, fontcolor=black, fontsize=10];
98+
edge [color=black, penwidth=1];
99+
100+
4 -- 7;
101+
7 -- 9;
102+
7 -- 0;
103+
0 -- 2;
104+
2 -- 5;
105+
5 -- 9;
106+
9 -- 8;
107+
9 -- 1;
108+
5 -- 1;
109+
9 -- 6;
110+
6 -- 3;
111+
1 -- 3;
112+
113+
{rank=same; 4; 8; 6;}
114+
{rank=same; 7; 9; 3;}
115+
{rank=same; 0; 2; 5; 1;}
116+
}
117+
118+
.. literalinclude:: bandwidth.queries
119+
:start-after: -- q2
120+
:end-before: -- q5
121+
122+
:Example: Undirected graph with edges after optimization.
123+
124+
.. graphviz::
125+
126+
graph G {
127+
node [shape=circle, style=filled, fillcolor=white, color=black, fontcolor=black, fontsize=12];
128+
edge [color=black, penwidth=1];
129+
130+
0 -- 1;
131+
1 -- 3;
132+
1 -- 2;
133+
2 -- 4;
134+
4 -- 8;
135+
8 -- 3;
136+
3 -- 5;
137+
3 -- 6;
138+
3 -- 7;
139+
8 -- 7;
140+
6 -- 9;
141+
7 -- 9;
142+
143+
{rank=same; 0; 5; 6;}
144+
{rank=same; 1; 3; 9;}
145+
{rank=same; 2; 4; 8; 7;}
146+
147+
}
148+
149+
.. literalinclude:: bandwidth.queries
150+
:start-after: -- q5
151+
:end-before: -- q8
152+
153+
See Also
154+
-------------------------------------------------------------------------------
155+
156+
* :doc:`sampledata`
157+
* `Boost: bandwidth
158+
<https://www.boost.org/libs/graph/doc/bandwidth.html>`_
159+
160+
.. rubric:: Indices and tables
161+
162+
* :ref:`genindex`
163+
* :ref:`search`

doc/src/pgRouting-introduction.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Individuals in this release v4.0.0 (in alphabetical order)
6767
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6868

6969
Regina Obe,
70+
Saloni kumari,
7071
Vicky Vergara
7172

7273

@@ -144,6 +145,7 @@ Rajat Shinde,
144145
Razequl Islam,
145146
Regina Obe,
146147
Rohith Reddy,
148+
Saloni Kumari,
147149
Sarthak Agarwal,
148150
Shobhit Chaurasia,
149151
Sourabh Garg,

0 commit comments

Comments
 (0)