1 of 17

Cuthill-Mckee Ordering Algorithm for

- Shobhit Chaurasia

25 August 2022 on Firenze room

2 of 17

Shobhit Chaurasia

  • Student, Bachelors of Tech. in CSE
  • Hindustan College of Science and Technology, Mathura, India
  • Participated this year in GSoC
  • pgRouting Developer
  • Email: 000shobhitchaurasia@gmail.com

3 of 17

Agenda

  1. My Contributions
  2. Usage & Applications
  3. Future Scope
  4. Conclusion

4 of 17

My Contributions

5 of 17

My Contributions

  • Added Cuthill-Mckee Ordering Algorithm by the Boost Graph Library to pgRouting.
  • Created one function:
    • pgr_cuthillMckeeOrdering

6 of 17

Benefits to the community

  • Adds more functionality to pgRouting
  • Can be integrated with other routing algorithms
  • Used to reduce the Bandwidth of the Graphs
  • Applications in linear system of

equations, reduce size needed to store sparse matrix, enhancing data locality, etc

7 of 17

Usage & Applications

8 of 17

pgRouting Cuthill-Mckee Ordering

  • This algorithm is a part of sparse matrix ordering algorithms:
    • decreases the Bandwidth of the Graph.
    • it re-order the indices assigned to each vertex.
  • Applicable for Undirected Graphs.
  • Applications: Linear equations, data locality, size reduction, etc.
  • Time complexity : O(m log(m)|V|) where m = max { degree(v) | v in V }.

9 of 17

pgRouting Cuthill-Mckee Ordering

CREATE TABLE edge_table

(

id BIGSERIAL,

source BIGINT,

target BIGINT,

cost FLOAT,

reverse_cost FLOAT

);

INSERT INTO edge_table

(id, source, target, cost, reverse_cost) VALUES

(1, 1, 4, 1, 1), (8, 3, 5, 1, 1),

(2, 1, 6, 1, 1), (9, 4, 6, 1, 1),

(3, 2, 3, 1, 1), (10, 4, 9, 1, 1),

(4, 2, 5, 1, 1), (11, 5, 7, 1, 1),

(5, 2, 7, 1, 1), (12, 6, 7, 1, 1),

(6, 2, 10, 1, 1), (13, 6, 8, 1, 1);

(7, 3, 4, 1, 1), (14, 7, 8, 1, 1);

10 of 17

pgRouting Cuthill-Mckee Ordering

Initial graph (Bandwidth = 8)

Final Graph (New bandwidth = 4)

11 of 17

SELECT * FROM pgr_cuthillMckeeOrdering (

'SELECT * FROM edge_table'

);

seq | node seq | node

---------+---------- ----------+----------

1 | 1 6 | 7

2 | 9 7 | 5

3 | 6 8 | 3

4 | 8 9 | 2

5 | 4 10 | 10

(10 rows)

pgRouting Cuthill-Mckee Ordering

12 of 17

Future Scope

What next?

13 of 17

Future Scope

  • More functions can be implemented for different use cases from the sparse matrix ordering family:
    • minimum degree ordering, sloan ordering, etc
  • Bandwidth minimization algorithms for pgRouting will help in computations over large-scale graphs efficiently.

14 of 17

Let’s Wrap Up!

Project:

Source Code:

Documentation:

Wiki Page:

15 of 17

https://github.com/pgRouting/GSoC-pgRouting

16 of 17

More Information

Website:

GitHub:

Documentation:

Developer’s Doc:

Workshop:

Shobhit Chaurasia: 000shobhitchaurasia@gmail.com

17 of 17

Thanks!