GSoC 2026 Planar Face Extraction and K‐Core Decomposition - pgRouting/pgrouting GitHub Wiki
This project aims to implement Planar Face Extraction and K-Core Decomposition algorithms from the Boost Graph Library into pgRouting. These algorithms extend pgRouting’s capabilities in structural graph analysis.
Planar face extraction identifies the bounded regions (faces) formed by edges in a planar graph, which is useful for applications such as road network partitioning and spatial analysis. K-core decomposition assigns a core number to each vertex, representing its level of connectivity within the graph, and is widely used in network analysis and clustering.
By integrating these algorithms, pgRouting will support more advanced graph analysis directly within PostgreSQL, enabling efficient processing of large-scale geospatial and network data.
Currently, pgRouting does not provide functions for planar face extraction or k-core decomposition. While planar face extraction algorithms is available in the Boost Graph Library also k-core decomposition would be implemented from sctratch with standalone function, they have not yet been integrated into pgRouting.
This project will bridge that gap by implementing these algorithms within pgRouting’s existing architecture and exposing them through SQL interfaces.
- Implementation of
pgr_planarFaces()function. - Implementation of
pgr_coreNumbers()function. - Integration with Boost Graph Library algorithms.
- SQL interface for both functions.
- User documentation for the new functions.
- pgTap test cases to ensure correctness and stability.
- A wiki page documenting weekly progress.
- Final and evaluation reports.
Delivered: Link to PR or to Tag based on the final status
| Title | GitHub Handle | Name |
|---|---|---|
| 1st Mentor | @cvvergara | Vicky Vergara |
| 2nd Mentor | @robe2 | Regina Obe |
| Student Developer | @sakirr05 | Md Sakir Ahmed |
Note: in reverse order: the most recent is first
week 12
Dates: (August 10 ~ August 16)
Proposed: Final project polishing, retrospective cleanup, and post-review integration validation.
week 11
Dates: (August 3 ~ August 9)
Proposed: Finalize merge-ready stabilization, rebasing, and review resolution.
week 10
Dates: (July 27 ~ August 2)
Proposed: Perform large-scale validation and review-driven stabilization for both features.
week 9
Dates: (July 20 ~ July 26)
Proposed: Complete documentation, validation, and integration cleanup for both algorithms.
week 8
Dates: (July 13 ~ July 19)
Proposed:
Stabilize pgr_coreNumbers() implementation with pgTap validation, benchmarks, and CI compatibility fixes.
week 7
Dates: (July 6 ~ July 12)
Proposed:
Integrate PostgreSQL wrappers and SQL result pipeline for pgr_coreNumbers().
week 6
Dates: (June 29 ~ July 5)
Completed:
Expanded pgr_planarFaces() and pgr_coreNumbers() documentation to Dijkstra-style depth: prose, graphviz diagrams, and numbered examples with explanations.
Extended docqueries for both functions and updated expected .result files.
Fixed CI failures by removing cross-module docquery/RST dependencies between planar and metrics mentor branches.
Opened and merged Week 6 PRs: week6-planarFaces (#591) and week6-coreNumbers (#590).
week 5
Dates: (June 22 ~ June 28)
Proposed: Complete pgr_coreNumbers documentation and testing; polish pgr_planarFaces documentation.
-
Revised plan:
- Create Week 5 branches and PRs following the weekly workflow
- Finish remaining
pgr_coreNumberspgtap tests (inner_query.pg,edge_cases.pg) - Complete
pgr_coreNumbers.rst(academic prose, Batagelj & Zaversnik citation) - Refine
pgr_planarFaces.rstexplanation and description wording
-
Work Done:
- pgr_planarFaces #578:
- Refined the Explanation section: clarified success on planar input, noted the unbounded exterior face, and described counterclockwise traversal for
side = 'l'/'r' - Corrected row-count wording in the Description section (
2|E|rows when the graph has|E|edges) - No new algorithm or test changes; existing docqueries and pgtap tests from Week 3-4 remain passing
- Refined the Explanation section: clarified success on planar input, noted the unbounded exterior face, and described counterclockwise traversal for
- pgr_coreNumbers #579:
- Expanded
pgr_coreNumbers.rst: added k-core definition, algorithm context, Batagelj & Zaversnik citation, and Boost Graph Inside marker - Fixed Availability section formatting to match pgRouting RST conventions
- Added
inner_query.pgpgtap test using the standardstyle_dijkstrapattern (54 inner-query style checks) - Added
edge_cases.pgpgtap test covering subgraphs (id < 2,id < 4,id < 5,id < 10) and empty-graph input - Updated See Also links (
pgr_betweennessCentrality,metrics-family) - All CI checks passing
- Expanded
- Still in progress (planned for Week 6):
- Add pipeline example linking
pgr_coreNumberswithpgr_planarFacesin documentation - Additional Examples section for
pgr_coreNumbers(subgraph and edge-case docqueries) - Cross-link
pgr_isPlanarinpgr_planarFacesSee Also section
- Add pipeline example linking
- pgr_planarFaces #578:
week 4
Dates: (June 15 ~ June 21)
Proposed: Stabilize pgr_planarFaces() integration and complete validation/testing workflow.
-
Revised plan:
- Create Week 4 branches and PRs following the weekly workflow
- Polish
pgr_planarFacesdocumentation and docqueries - Implement
pgr_coreNumbersalgorithm (Batagelj–Zaversnik) and switch toII_t_rt - Add partial documentation, docqueries, and initial pgtap tests for
pgr_coreNumbers
-
Work Done:
- pgr_planarFaces #577:
- Enhanced
pgr_planarFaces.rstwith clearer face description, guidance to runpgr_isPlanarfirst, and an Explanation section - Added Additional Examples: planarity check before face extraction, and triangle graph example (2 faces, 6 rows)
- Extended docquery files (
planarFaces.pgandplanarFaces.result) withq2(isPlanar check) andq3(triangle example); docquery tests pass
- Enhanced
- pgr_coreNumbers #576:
- Switched return type from custom
CoreNumbers_rtto sharedII_t_rt(d1-> node,d2-> core;seqgenerated in C SRF layer) - Removed
include/c_types/coreNumbers_rt.hand updated process, driver, and algorithm layers - Implemented k-core decomposition manually using Batagelj–Zaversnik algorithm (Boost used only for graph construction)
- Addressed mentor review: renamed
deg->degree, extractedbin_sort_vertices()helper, usedstd::max_element()for max-degree lookup - Added partial RST documentation (
pgr_coreNumbers.rst) and registered indoc/metrics/CMakeLists.txtandmetrics-family.rst - Created docquery files (
coreNumbers.pgandcoreNumbers.result) with correct BEGIN/ROLLBACK wrapper format - Added initial pgtap tests:
types_check.pgandno_crash_test.pg(both passing) - All CI checks passing
- Switched return type from custom
- Still in progress (planned for Week 5):
- Complete
pgr_coreNumbers.rst(academic prose, Batagelj & Zaversnik citation, pipeline example withpgr_planarFaces) - Remaining pgtap tests (
inner_query.pg,edge_cases.pg)
- Complete
- pgr_planarFaces #577:
week 3
Dates: (June 8 ~ June 14)
Proposed: Begin PostgreSQL integration for pgr_planarFaces() with minimal wrapper and result pipeline support.
-
Revised plan:
- Restructure
pgr_planarFacesto 3-layer process/driver architecture - Add documentation and docqueries for
pgr_planarFaces - Fix
pgr_coreNumbersSQL and copyright issues
- Restructure
-
Work Done:
- pgr_planarFaces #568:
- Restructured algorithm to 3-layer process/driver architecture matching
dijkstra,astar,spanningTree,coloring, andorderingmodules - Created algorithm-specific
planarFaces_process.cppandplanarFaces_driver.cppfor SPI connection, timing, error reporting, edge fetching, and graph construction - Updated
planarFaces.cto callpgr_process_planarFaces()instead of directly calling the driver - Created RST documentation (
pgr_planarFaces.rst) and added to experimental toctree - Created docquery files (
planarFaces.pgandplanarFaces.result) with correct BEGIN/ROLLBACK wrapper format - Fixed cpplint errors (include ordering, missing
<utility>header) - Refactored from shared
planar_process/planar_driverto algorithm-specific files to avoid return type conflicts (PlanarFace_rtvsII_t_rt) with other planar algorithms - All CI checks passing- build, pgtap tests, docqueries, and cpplint
- Restructured algorithm to 3-layer process/driver architecture matching
- pgr_coreNumbers #567:
- Fixed
_coreNumbers.sqlLANGUAGE property fromIMMUTABLEtoVOLATILEto matchbetweennessCentralitypattern - Corrected copyright years in
coreNumbers.hppandcoreNumbers.cpp - All CI checks passing
- Fixed
- pgr_planarFaces #568:
week 2
Dates: (June 1 ~ June 7)
Proposed: Implement core planar face traversal logic and face recording workflow in isolated C++ prototypes.
-
Revised plan:
- Implement
pgr_planarFacesalgorithm and add pgtap tests - Move
pgr_coreNumbersfiles tometrics/module and fix naming conventions
- Implement
-
Work Done:
- Attended Monday meeting where mentor Vicky reviewed Week 1 PRs and gave feedback on file structure and naming conventions
-
pgr_planarFaces (PR #563):
- Implemented face traversal algorithm using Boost's
boyer_myrvold_planarity_testandplanar_face_traversalwith a customFaceVisitorthat recordsseq,face_id,edge_id,side - Rewrote driver and C SRF entry to follow the planar module pattern (matching
isPlanar/boyerMyrvold) - Removed old
planarFaces_process.cppandplanarFaces_driver.hpp— replaced with new driver pattern - Fixed file naming convention - removed incorrect
pgr_prefix from filenames to match planar directory - Added 4 pgtap test files (69 tests total):
edge_cases.pg(6),types_check.pg(4),no_crash_test.pg(5),inner_query.pg(54) - Verified algorithm output against real PostgreSQL database - all 69 tests pass locally and in CI
- Implemented face traversal algorithm using Boost's
-
pgr_coreNumbers (PR #564):
- Relocated all coreNumbers files from standalone
coreNumbers/directory intometrics/module (alongsidebetweennessCentralityandbandwidth) - Renamed files to follow metrics naming convention - removed
pgr_prefix, renamed_process.h→_driver.h,_driver.hpp→.hpp - Updated build configs:
src/metrics/CMakeLists.txt,sql/metrics/CMakeLists.txt,configuration.conf,code_checker.sh - Fixed driver header, SQL files, and C SRF entry to follow
betweennessCentralitypattern
- Relocated all coreNumbers files from standalone
week 1
Dates: (May 25 ~ May 31)
Proposed:
Study existing pgr_isPlanar() infrastructure and integrate Boyer–Myrvold embedding generation with reusable embedding storage for pgr_planarFaces().
-
Revised plam:
- Create skeleton file struture for
pgr_planarFaces - Create skeleton file structure for
pgr_coreNumbers - Follow the process-driver pattern shown by mentor
- Create skeleton file struture for
-
Work Done:
- Had a Monday meeting where my mentor Vicky showed how to create skeleton files using Dijkstra as example (PR #548, PR #549)
- Had exams so couldnt work till Thursday
- Made first attempt at
pgr_planarFacesskeleton (PR #551) but most CI checks were failing and the commit history got too messy so I closed it and started fresh - Rebuilt both skeletons from scratch:
- SQL layer: internal C stub + public wrapper
- C layer: PostgreSQL SRF entry point
- C++ layer: process layer + driver stub
- Build system: CMakeLists, configuration.conf, sig file
-
PR #556 for
pgr_planarFaces, all CI checks passing -
PR #555 for
pgr_coreNumbers, had one issue where the sig file entries were in the wrong position (recieved query check failure), fixed the sort order and all checks passed after that
Bonding period
Goal: arrive at Week 1 with , proposal reviewed by mentors, study implementation of algorithms, and a clear understanding of pgRouting architecture.
Proposed: Study pgRouting architecture and refine implementation strategy after deeper analysis of planar traversal and k-core decomposition workflows.
Plan for the week:
- Research outer-face traversal handling and visitor traversal order
- Investigate standalone implementation strategy for
pgr_coreNumbers() - Study pgRouting SQL → C wrapper → C++ driver → Boost integration pipeline
- Research Batagelj–Zaversnik k-core decomposition workflow
Report:
- Bonding period meeting
- Prepared Wiki (copied from proposal)
- Revised proposal timeline and implementation strategy
- Research about
planar_face_traversalvisitor workflow and outer-face handling - Investigated standalone
pgr_coreNumbers()implementation feasibility - Studied pgRouting execution pipeline and Boost graph integration workflow
- Researched Batagelj–Zaversnik degree-peeling decomposition process
Proposed: Study planar face traversal behavior using Graphviz examples and Boost documentation.
Plan for the week:
- Study
boyer_myrvold_planarity_testembedding generation - Experiment with Graphviz planar graph examples
- Research
planar_face_traversalvisitor workflow - Study pgRouting SQL → C wrapper → C++ driver → Boost pipeline
- Revise implementation approach after architecture study
Report:
- Studied Graphviz planar traversal examples
- Researched
planar_face_traversalworkflow and visitor behavior - Investigated outer-face traversal handling using Boost documentation and Graphviz experiments
- Studied pgRouting execution pipeline (SQL → C wrapper → C++ driver → Boost)
- Restructured proposal after deeper architecture study
- Planned standalone
pgr_coreNumbers()implementation approach - Researched core-number computation workflow and graph abstraction integration
- Explored Boost Graph Library references related to k-core decomposition
- Created discussion notes/questions regarding traversal behavior and implementation details
Plan for the week:
- Bonding period meeting with mentors
- Prepare GSoC wiki structure from proposal
- Revise proposal after deeper algorithm research
- Research outer-face handling during planar traversal
- Study third algorithm/stretch-goal feasibility as homework
Report:
- Bonding period meeting completed
- GSoC wiki prepared from proposal
- Proposal revision and implementation planning started
- Outer-face traversal behavior researched
- Third algorithm/stretch-goal research in progress
Link to all the Pull Requests made in GSoC-pgRouting repository
| Pull Request | Description | Date | Status |
|---|---|---|---|
| #555 | Week 1: pgr_coreNumbers skeleton | May 29, 2026 | Merged |
| #556 | Week 1: pgr_planarFaces skeleton | May 30, 2026 | Merged |
| #563 | Week 2: pgr_planarFaces | June 7, 2026 | Merged |
| #564 | Week 2: pgr_coreNumbers | June 7, 2026 | Merged |
| #567 | Week 3: pgr_coreNumbers | June 13, 2026 | Merged |
| #568 | Week 3: pgr_planarFaces | June 13, 2026 | Merged |
| #576 | Week 4: pgr_coreNumbers | June 21, 2026 | Merged |
| #577 | Week 4: pgr_planarFaces | June 21, 2026 | Merged |
| #578 | Week 5: pgr_planarFaces | June 29, 2026 | Merged |
| #579 | Week 5: pgr_coreNumbers | June 29, 2026 | Merged |
| #591 | Week 6: pgr_planarFaces | July 6, 2026 | Merged |
| #590 | Week 6: pgr_coreNumbers | June 6, 2026 | Merged |
TBD
TBD
- Links:
(i) Code Documentation:
TBD
(ii) Tags:
TBD
(iii) Pull Requests:
TBD
(iv) Wiki Pages:
TBD
- Images:
TBD
- Media:
TBD
- pgRouting Documentation -- https://docs.pgrouting.org/
- Diagram tools -- Diagrams were created using Python (NetworkX + Matplotlib) and Draw.io
- Boost Graph Library -- https://www.boost.org/doc/libs/release/libs/graph/
- Planar Face Traversal (Boost) -- https://www.boost.org/doc/libs/release/libs/graph/doc/planar_face_traversal.html
- Boyer-Myrvold Planarity Test (Boost) -- https://www.boost.org/doc/libs/release/libs/graph/doc/boyer_myrvold.html
- Batagelj, V. and Zaversnik, M.
An O(m) Algorithm for Cores Decomposition of Networks.
arXiv:cs/0310049, 2003. - OSGeo GSoC Guidelines -- https://wiki.osgeo.org/wiki/Google_Summer_of_Code