Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
1f4307b
Added saloni(name) in pgrouting_doc_strings.po
Saloni-2005 Jun 3, 2025
844bbe4
Added "Saloni Kumari" in pgrouting_doc_strings.pot
Saloni-2005 Jun 3, 2025
9c2139a
Added "Saloni Kumari" in pgRouting-introduction.rst
Saloni-2005 Jun 3, 2025
7c173ca
Update locale: commit 9c2139a8e
github-actions[bot] Jun 3, 2025
fe31c19
Create sql/metrics/bandwidth.sql
Saloni-2005 Jun 5, 2025
1e12325
Created sql/metrics/_bandwidth.sql
Saloni-2005 Jun 5, 2025
04de46b
Added bandwidth local files name in CMakeLists.txt
Saloni-2005 Jun 5, 2025
5692027
Created include/drivers/metrics/bandwidth_driver.h
Saloni-2005 Jun 5, 2025
57c9bf3
Created include/metrics/bandwidth.hpp
Saloni-2005 Jun 5, 2025
d4860ed
created include/c_types/graph_bandwidth_rt.h , src/metrics/bandwidth.…
Saloni-2005 Jun 6, 2025
3978b2d
Added bandwidth files name in src/metrics/CMakeLists.txt
Saloni-2005 Jun 6, 2025
97e7d9d
Created include/process/bandwidth_process.h
Saloni-2005 Jun 7, 2025
e31cdec
Created src/metrics/bandwidth_process.cpp
Saloni-2005 Jun 7, 2025
ca4afc8
Updated CMakeLists.txt
Saloni-2005 Jun 7, 2025
fb551cc
Update metrics-family.rst
Saloni-2005 Jun 7, 2025
a869453
Update locale: commit fb551cc78
github-actions[bot] Jun 7, 2025
99aab68
Merge pull request #443 from Saloni-2005/week-1-bandwidth
Saloni-2005 Jun 9, 2025
8f35173
Merge remote-tracking branch 'pgr/develop' into week-2-bandwidth
Saloni-2005 Jun 9, 2025
e5a1096
Update locale: commit 8f35173b8
github-actions[bot] Jun 9, 2025
e624b6b
Merge remote-tracking branch 'pgr/develop' into saloni-2025
cvvergara Jun 11, 2025
909fe2a
Merge branch 'saloni-2025' into week-2-bandwidth
cvvergara Jun 11, 2025
ce53cb5
Renamed files and added metrics_process.cpp and metrics_driver.cpp
Saloni-2005 Jun 11, 2025
2b13647
Merge branch 'week-2-bandwidth' of github.com:Saloni-2005/GSoC-pgRout…
Saloni-2005 Jun 11, 2025
a8f3308
Merge remote-tracking branch 'pgr/develop' into week-2-bandwidth
Saloni-2005 Jun 15, 2025
1c715e7
Deleted bandwidth_driver.h
Saloni-2005 Jun 15, 2025
15e49d1
Deleted bandwidth_driver.hpp
Saloni-2005 Jun 15, 2025
930a703
Renamed bandwidth_process.hpp to metrics_process.h
Saloni-2005 Jun 15, 2025
602e1dc
Deleted run.sh
Saloni-2005 Jun 15, 2025
661996c
Deleted bandwidth_driver.cpp
Saloni-2005 Jun 15, 2025
3813349
Deleted bandwidth_process.cpp
Saloni-2005 Jun 15, 2025
d5ab2cc
Renamed graph_bandwidth_rt.h to bandwidth_rt.h
Saloni-2005 Jun 15, 2025
1a7a4c8
Fixed license in metrics_driver.hpp
Saloni-2005 Jun 15, 2025
8e1b537
Changed the commenting style as suggested in bandwidth.c
Saloni-2005 Jun 15, 2025
b48e68c
Fixed license in metrics_driver.cpp
Saloni-2005 Jun 15, 2025
5169873
Updated src/metrics/CMakeLists.txt
Saloni-2005 Jun 15, 2025
b99a611
replaced @ -> at and added missing license content
Saloni-2005 Jun 15, 2025
c30ad59
Merge pull request #445 from Saloni-2005/week-2-bandwidth
Saloni-2005 Jun 16, 2025
0cdf0d5
Merge remote-tracking branch 'upstream/develop' into saloni-2025
cvvergara Jun 16, 2025
380c998
Updated include and function name in metrics_process.cpp to maintain…
Saloni-2005 Jun 17, 2025
1532391
Updated include and function name in metrics_driver.cpp to maintain …
Saloni-2005 Jun 17, 2025
97c6b0b
Upadted include file name from graph_bandwidth_rt.h -> bandwidth_rt.h
Saloni-2005 Jun 17, 2025
8531094
Updated parameters and data types in metrics_process.h
Saloni-2005 Jun 18, 2025
09805e6
Udated metrics_process.cpp based on the method change in pgr_process_…
Saloni-2005 Jun 18, 2025
159d390
Changed name of function from pgr_process_bandwidth to pgr_process_me…
Saloni-2005 Jun 18, 2025
365eb4b
Updated src/metrics/bandwidth.c to match it with the previous changes…
Saloni-2005 Jun 18, 2025
928296e
Fixed include in src/metrics/bandwidth.c
Saloni-2005 Jun 18, 2025
a94557f
Created metrics_rt.h and updated the includes
Saloni-2005 Jun 18, 2025
6408013
Updated metrics_process.cpp chnaged : pgr_alloc -> pgrouting::pgr_alloc
Saloni-2005 Jun 18, 2025
a278784
Commented some part to compile successfully
Saloni-2005 Jun 18, 2025
7899140
Updated file name in License
Saloni-2005 Jun 21, 2025
a424afc
Merge pull request #454 from Saloni-2005/week-3-bandwidth-try3
Saloni-2005 Jun 22, 2025
2f04182
Merge remote-tracking branch 'pgr/develop' into week-4-bandwidth
Saloni-2005 Jun 22, 2025
bfc430a
Changed metrics_rt.h to iid_t_rt.h in metrics_driver.hpp
Saloni-2005 Jun 26, 2025
ead3ba3
Changed bandwidth_rt.h to iid_t_rt.h in metrics_process.h
Saloni-2005 Jun 26, 2025
c68e2e0
Updated and corrected src/metrics/metrics_driver.cpp
Saloni-2005 Jun 26, 2025
f928b64
Replaced bandwidth struct with iid_t_rt struct
Saloni-2005 Jun 26, 2025
e6e592d
Fixed _bandwidth.sql
Saloni-2005 Jun 28, 2025
a36f864
Fixed bandwidth.sql
Saloni-2005 Jun 28, 2025
a6d342d
Added return column in _bandwidth.sql
Saloni-2005 Jun 28, 2025
cd62ce5
Added type_check.pg file for bandwidth
Saloni-2005 Jun 28, 2025
a0c0c0f
Merge pull request #456 from Saloni-2005/week-4-bandwidth
Saloni-2005 Jun 30, 2025
0060758
Fixed include in bandwidth.c
Saloni-2005 Jul 1, 2025
44db581
Fixed src/metrics/bandwidth.c
Saloni-2005 Jul 4, 2025
bfbe4f0
Fixed src/metrics/metrics_process.cpp by comparing with allpairs
Saloni-2005 Jul 4, 2025
87cd88a
Fixed include/process/metrics_process.h by comparing with allpairs
Saloni-2005 Jul 4, 2025
b2efb73
Fixed parameters in include/drivers/metrics_driver.hpp
Saloni-2005 Jul 4, 2025
6242ab3
Resolved compilation error
Saloni-2005 Jul 4, 2025
73bf701
Added bandwidth.c file in CMakeLists.txt
Saloni-2005 Jul 4, 2025
14c10c2
Removed extra parameter from the function
Saloni-2005 Jul 4, 2025
d55a175
Aligned file names in src/metrics/CMakeLists.txt
Saloni-2005 Jul 6, 2025
6d65658
Fixed spaces in metrics_process.h
Saloni-2005 Jul 6, 2025
3dc42ce
Fixed spacing in metrics_driver.cpp
Saloni-2005 Jul 6, 2025
2e403b7
Fixed "Weird number of spaces at line-start" error in metrics_process…
Saloni-2005 Jul 6, 2025
ace032b
Added which parameter in metrics_driver.cpp
Saloni-2005 Jul 6, 2025
4ba92bc
Merge pull request #463 from Saloni-2005/week-5-bandwidth
Saloni-2005 Jul 7, 2025
511bba2
Added new file : docqueries/metrics/bandwidth.pg
Saloni-2005 Jul 7, 2025
95e0401
Added bandwidth in CMakeLists.txt
Saloni-2005 Jul 7, 2025
56da95b
Added bandwidth.pg file in test.conf
Saloni-2005 Jul 7, 2025
7011c1c
Fixed typo-error in name bandwidth
Saloni-2005 Jul 7, 2025
db787e4
Fixed compilation error of bandwidth.pg
Saloni-2005 Jul 7, 2025
311f738
Added docqueries/metrics/bandwidth.result file
Saloni-2005 Jul 7, 2025
4aff82d
Removed whitespaces from metrics_process.cpp
Saloni-2005 Jul 7, 2025
cfeed27
Fixed bandwidth.c
Saloni-2005 Jul 7, 2025
9352dc6
Commented some part of cide as we don't need for now in metrics_drive…
Saloni-2005 Jul 7, 2025
e8c20f1
Result file is updated
Saloni-2005 Jul 10, 2025
3e12d43
Removed whitespaces from bandwidth.c file
Saloni-2005 Jul 10, 2025
306a14a
Removed trailing spaces
Saloni-2005 Jul 10, 2025
7ad5b2d
Added if block
Saloni-2005 Jul 10, 2025
d2c877b
For Check-query checkto pass
Saloni-2005 Jul 13, 2025
507df6a
Fixed types_check.pg
Saloni-2005 Jul 13, 2025
6bc0e67
Changed the plan
Saloni-2005 Jul 13, 2025
ace89de
Merge pull request #465 from Saloni-2005/week-6-bandwidth
Saloni-2005 Jul 14, 2025
afd2f23
Removed ctrl M from bandwidth.c
Saloni-2005 Jul 15, 2025
735ce90
Fixed the warning by changing type
Saloni-2005 Jul 15, 2025
15d19c0
Fixed types_check.pg
Saloni-2005 Jul 15, 2025
a9ecc2f
Resolved ctrl M line ending
Saloni-2005 Jul 15, 2025
cde65e4
Changed the return type
Saloni-2005 Jul 15, 2025
9592c0c
Made the function call
Saloni-2005 Jul 15, 2025
dc4d70e
replaced variable bw with bandwidth
Saloni-2005 Jul 15, 2025
419ac59
Fixed the return type
Saloni-2005 Jul 15, 2025
236c443
Fixed type check
Saloni-2005 Jul 15, 2025
6964f3b
Fixed type check from bandwidth.hpp
Saloni-2005 Jul 15, 2025
2c41a46
Fixed bandwidth.hpp
Saloni-2005 Jul 15, 2025
6c5bb08
Updated bandwidth.hpp to include boost/graph/bandwidth.hpp
Saloni-2005 Jul 18, 2025
938e61d
Used spaces instead of tab
Saloni-2005 Jul 20, 2025
7f10c1b
Fixed the logic in bandwidth.hpp
Saloni-2005 Jul 20, 2025
5f4d1bc
Remove ctrl M line ending
Saloni-2005 Jul 20, 2025
24fae33
Merge pull request #470 from Saloni-2005/week-7-bandwidth
Saloni-2005 Jul 22, 2025
98f14cf
Removed using statement and used complete namespace path
Saloni-2005 Jul 22, 2025
5154861
Added pgtap/metrics/bandwidth/no_crash_test.pg file
Saloni-2005 Jul 23, 2025
ba514ef
Updated return statement
Saloni-2005 Jul 23, 2025
f66751c
Fixed plan and removed some return query
Saloni-2005 Jul 23, 2025
1fdc269
Created pgtap/metrics/bandwidth/inner_query.pg
Saloni-2005 Jul 23, 2025
a480fe3
Updated plans in no_crash_test.pg
Saloni-2005 Jul 23, 2025
7b79bc3
Created edge_cases.pg
Saloni-2005 Jul 23, 2025
578e9e2
Updated to add suggested lines of code instead of unnecessary code
Saloni-2005 Jul 24, 2025
66ce485
Added some edge_cases and removed the copied ones
Saloni-2005 Jul 25, 2025
0283f41
Modified no. of plans
Saloni-2005 Jul 25, 2025
9df4d8f
Removed useless test
Saloni-2005 Jul 28, 2025
016cae4
Added pgr_bandwidth to else
Saloni-2005 Jul 28, 2025
f071a76
Merge pull request #473 from Saloni-2005/week-8-bandwidth
Saloni-2005 Jul 28, 2025
d78b58c
Merge remote-tracking branch 'upstream/develop' into HEAD
cvvergara Jul 28, 2025
2fb8552
Updated bandwidth.pg and result file
Saloni-2005 Jul 29, 2025
e0246fa
Updated result file
Saloni-2005 Jul 29, 2025
d30418b
Created bandwidth.rst file
Saloni-2005 Jul 29, 2025
9b4ec82
Added pgr_bandwidth.rst in CMakeLists.txt
Saloni-2005 Jul 29, 2025
2823607
Added pgr_bandwidth in doc/_static/page_history.js
Saloni-2005 Jul 31, 2025
b59b613
Added description
Saloni-2005 Aug 1, 2025
5ae087d
Removed explanation section
Saloni-2005 Aug 1, 2025
b5f1e9d
Merge pull request #474 from Saloni-2005/week-9-bandwidth
Saloni-2005 Aug 3, 2025
39e1607
Merge remote-tracking branch 'upstream/develop' into saloni-2025
cvvergara Aug 4, 2025
af4aa86
Initialized the result variable with 0
Saloni-2005 Aug 5, 2025
4144a22
Added queries
Saloni-2005 Aug 5, 2025
28f0efc
Added required extra line
Saloni-2005 Aug 5, 2025
5829f3c
Added one more query
Saloni-2005 Aug 5, 2025
1373106
Added additional examples in the documentation
Saloni-2005 Aug 5, 2025
7f8fe23
Added one extra query to use in documentation
Saloni-2005 Aug 5, 2025
4063b4e
Updated the queries
Saloni-2005 Aug 6, 2025
1b8a341
Added graphs in documentation
Saloni-2005 Aug 6, 2025
64b9c0a
Updated description section
Saloni-2005 Aug 6, 2025
0800c10
Merge pull request #478 from Saloni-2005/week-10-bandwidth
Saloni-2005 Aug 12, 2025
c1c160c
Updated metrics_driver.cpp to insert vertices in order of id
Saloni-2005 Aug 14, 2025
d537dcb
Updated result to show correct bandwidth
Saloni-2005 Aug 14, 2025
c29e5a3
Removed tab to pass style check
Saloni-2005 Aug 14, 2025
fc3559e
Merge pull request #481 from Saloni-2005/week-11-bandwidth
Saloni-2005 Aug 16, 2025
f5752e8
Added my name in pgrouting-introduction.rst
Saloni-2005 Aug 19, 2025
3bfd5aa
Merge pull request #483 from Saloni-2005/week-12-bandwidth
Saloni-2005 Aug 19, 2025
2f08b15
Update locale: commit 3bfd5aa0e
github-actions[bot] Aug 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/_static/page_history.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var titles = [


var newpages = [
{v: '4.0', pages: ['pgr_bandwidth']},
{v: '3.8', pages: ['pgr_contractionDeadEnd', 'pgr_contractionLinear', 'pgr_separateCrossing',
'pgr_separateTouching']},

Expand Down
1 change: 1 addition & 0 deletions doc/metrics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SET(LOCAL_FILES
metrics-family.rst
pgr_betweennessCentrality.rst
pgr_degree.rst
pgr_bandwidth.rst
)

foreach (f ${LOCAL_FILES})
Expand Down
3 changes: 3 additions & 0 deletions doc/metrics/metrics-family.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ Metrics - Family of functions
* :doc:`pgr_betweennessCentrality` - Calculates relative betweenness centrality
using Brandes Algorithm

* :doc:`pgr_bandwidth` - Computes the bandwidth of a graph.

.. experimental-end

.. toctree::
:hidden:

pgr_degree
pgr_betweennessCentrality
pgr_bandwidth

See Also
-------------------------------------------------------------------------------
Expand Down
163 changes: 163 additions & 0 deletions doc/metrics/pgr_bandwidth.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
..
****************************************************************************
pgRouting Manual
Copyright(c) pgRouting Contributors

This documentation is licensed under a Creative Commons Attribution-Share
Alike 3.0 License: https://creativecommons.org/licenses/by-sa/3.0/
****************************************************************************

.. index::
single: Metrics Family ; pgr_bandwidth - Experimental
single: bandwidth - Experimental on v4.0

|

``pgr_bandwidth`` - Experimental
===============================================================================

``pgr_bandwidth`` - Calculates the bandwidth of the graph

.. include:: experimental.rst
:start-after: warning-begin
:end-before: end-warning

.. rubric:: Availability

* Version 4.0.0

* New experimental function.

Description
-------------------------------------------------------------------------------

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.).

* For each edge in the graph, calculate the distance between the vertex numbers it connects
* The bandwidth is the maximum of all these distances
* The implementation is for undirected graphs
* Run time is 0.160789 seconds

|Boost| Boost Graph Inside

Signatures
-------------------------------------------------------------------------------

.. rubric:: Summary

.. admonition:: \ \
:class: signatures

pgr_bandwidth(`Edges SQL`_)

| Returns ``BIGINT``

:Example: For an undirected graph with edges.

.. literalinclude:: bandwidth.queries
:start-after: -- q1
:end-before: -- q2

Parameters
-------------------------------------------------------------------------------

.. include:: pgRouting-concepts.rst
:start-after: edges_start
:end-before: edges_end

Inner Queries
-------------------------------------------------------------------------------

Edges SQL
...............................................................................

.. include:: pgRouting-concepts.rst
:start-after: basic_edges_sql_start
:end-before: basic_edges_sql_end

Result columns
-------------------------------------------------------------------------------

Returns a bigint ``(pgr_bandwidth)``

================= =========== ==========================================
Column Type Description
================= =========== ==========================================
``pgr_bandwidth`` ``BIGINT`` gives the bandwidth of the graph.
================= =========== ==========================================

Additional Examples
-------------------------------------------------------------------------------

:Example: Undirected graph with edges before optimization.

.. graphviz::

graph G {
node [shape=circle, style=filled, fillcolor=white, color=black, fontcolor=black, fontsize=10];
edge [color=black, penwidth=1];

4 -- 7;
7 -- 9;
7 -- 0;
0 -- 2;
2 -- 5;
5 -- 9;
9 -- 8;
9 -- 1;
5 -- 1;
9 -- 6;
6 -- 3;
1 -- 3;

{rank=same; 4; 8; 6;}
{rank=same; 7; 9; 3;}
{rank=same; 0; 2; 5; 1;}
}

.. literalinclude:: bandwidth.queries
:start-after: -- q2
:end-before: -- q5

:Example: Undirected graph with edges after optimization.

.. graphviz::

graph G {
node [shape=circle, style=filled, fillcolor=white, color=black, fontcolor=black, fontsize=12];
edge [color=black, penwidth=1];

0 -- 1;
1 -- 3;
1 -- 2;
2 -- 4;
4 -- 8;
8 -- 3;
3 -- 5;
3 -- 6;
3 -- 7;
8 -- 7;
6 -- 9;
7 -- 9;

{rank=same; 0; 5; 6;}
{rank=same; 1; 3; 9;}
{rank=same; 2; 4; 8; 7;}

}

.. literalinclude:: bandwidth.queries
:start-after: -- q5
:end-before: -- q8

See Also
-------------------------------------------------------------------------------

* :doc:`sampledata`
* `Boost: bandwidth
<https://www.boost.org/libs/graph/doc/bandwidth.html>`_

.. rubric:: Indices and tables

* :ref:`genindex`
* :ref:`search`
2 changes: 2 additions & 0 deletions doc/src/pgRouting-introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Individuals in this release v3.8.x (in alphabetical order)

Aurélie Bousquet,
Regina Obe,
Saloni kumari,
Vicky Vergara


Expand Down Expand Up @@ -145,6 +146,7 @@ Rajat Shinde,
Razequl Islam,
Regina Obe,
Rohith Reddy,
Saloni Kumari,
Sarthak Agarwal,
Shobhit Chaurasia,
Sourabh Garg,
Expand Down
1 change: 1 addition & 0 deletions docqueries/metrics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Do not use extensions
SET(LOCAL_FILES
bandwidth
betweennessCentrality
degree
)
Expand Down
88 changes: 88 additions & 0 deletions docqueries/metrics/bandwidth.pg
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
-- CopyRight(c) pgRouting developers
-- Creative Commons Attribution-Share Alike 3.0 License : https://creativecommons.org/licenses/by-sa/3.0/

/* -- q1 */
SELECT * FROM pgr_bandwidth(
'SELECT id, source, target, cost, reverse_cost
FROM edges'
);

/* -- q2 */
CREATE TABLE my_edges1 (
id SERIAL PRIMARY KEY,
source INTEGER,
target INTEGER,
cost DOUBLE PRECISION,
reverse_cost DOUBLE PRECISION
);
/* -- q3 */
INSERT INTO my_edges1 (source, target, cost, reverse_cost) VALUES
(4, 7, 1, 1),
(7, 4, 1, 1),
(7, 9, 1, 1),
(9, 7, 1, 1),
(7, 0, 1, 1),
(0, 7, 1, 1),
(0, 2, 1, 1),
(2, 0, 1, 1),
(2, 5, 1, 1),
(5, 2, 1, 1),
(5, 9, 1, 1),
(9, 5, 1, 1),
(9, 8, 1, 1),
(8, 9, 1, 1),
(9, 1, 1, 1),
(1, 9, 1, 1),
(5, 1, 1, 1),
(1, 5, 1, 1),
(9, 6, 1, 1),
(6, 9, 1, 1),
(6, 3, 1, 1),
(3, 6, 1, 1),
(1, 3, 1, 1),
(3, 1, 1, 1);
/* -- q4 */
SELECT * FROM pgr_bandwidth(
'SELECT id, source, target, cost, reverse_cost FROM my_edges1'
);

/* -- q5 */
CREATE TABLE my_edges2 (
id SERIAL PRIMARY KEY,
source INTEGER,
target INTEGER,
cost DOUBLE PRECISION,
reverse_cost DOUBLE PRECISION
);
/* -- q6 */
INSERT INTO my_edges2 (source, target, cost, reverse_cost) VALUES
(0, 1, 1, 1),
(1, 0, 1, 1),
(1, 3, 1, 1),
(3, 1, 1, 1),
(1, 2, 1, 1),
(2, 1, 1, 1),
(2, 4, 1, 1),
(4, 2, 1, 1),
(4, 8, 1, 1),
(8, 4, 1, 1),
(8, 3, 1, 1),
(3, 8, 1, 1),
(3, 5, 1, 1),
(5, 3, 1, 1),
(3, 6, 1, 1),
(6, 3, 1, 1),
(3, 7, 1, 1),
(7, 3, 1, 1),
(8, 7, 1, 1),
(7, 8, 1, 1),
(6, 9, 1, 1),
(9, 6, 1, 1),
(7, 9, 1, 1),
(9, 7, 1, 1);
/* -- q7 */
SELECT * FROM pgr_bandwidth(
'SELECT id, source, target, cost, reverse_cost FROM my_edges2'
);

/* -- q8 */
Loading