GSoC 2026 Planar Face Extraction and K‐Core Decomposition - pgRouting/pgrouting GitHub Wiki

Table of Contents

Proposal

Brief Description

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.


State of the Project Before GSoC

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.


Deliverables

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

Detailed Proposal

Proposal link

Delivered: Link to PR or to Tag based on the final status

Participants

Title GitHub Handle Name
1st Mentor @cvvergara Vicky Vergara
2nd Mentor @robe2 Regina Obe
Student Developer @sakirr05 Md Sakir Ahmed

Timeline & weekly report

Note: in reverse order: the most recent is first

Second Coding Period

week 12

Week 12

Dates: (August 10 ~ August 16)

Proposed: Final project polishing, retrospective cleanup, and post-review integration validation.

Link to report mail

week 11

Week 11

Dates: (August 3 ~ August 9)

Proposed: Finalize merge-ready stabilization, rebasing, and review resolution.

Link to report mail

week 10

Week 10

Dates: (July 27 ~ August 2)

Proposed: Perform large-scale validation and review-driven stabilization for both features.

Link to report mail

week 9

Week 9

Dates: (July 20 ~ July 26)

Proposed: Complete documentation, validation, and integration cleanup for both algorithms.

Link to report mail

week 8

Week 8

Dates: (July 13 ~ July 19)

Proposed: Stabilize pgr_coreNumbers() implementation with pgTap validation, benchmarks, and CI compatibility fixes.

Link to report mail

week 7

Week 7

Dates: (July 6 ~ July 12)

Proposed: Integrate PostgreSQL wrappers and SQL result pipeline for pgr_coreNumbers().

Link to report mail

First Coding Period

week 6

Week 6

Dates: (June 29 ~ July 5)

Proposed: Begin standalone pgr_coreNumbers() implementation using Batagelj–Zaversnik decomposition integrated with pgRouting graph structures.

Link to report mail

week 5

Week 5

Dates: (June 22 ~ June 28)

Proposed: Finalize pgr_planarFaces() review-ready integration and begin pgr_coreNumbers() architecture preparation.

Link to report mail

week 4

Week 4

Dates: (June 15 ~ June 21)

Proposed: Stabilize pgr_planarFaces() integration and complete validation/testing workflow.

Link to report mail

week 3

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_planarFaces to 3-layer process/driver architecture
    • Add documentation and docqueries for pgr_planarFaces
    • Fix pgr_coreNumbers SQL and copyright issues
  • Work Done:

    • pgr_planarFaces #568:
      • Restructured algorithm to 3-layer process/driver architecture matching dijkstra, astar, spanningTree, coloring, and ordering modules
      • Created algorithm-specific planarFaces_process.cpp and planarFaces_driver.cpp for SPI connection, timing, error reporting, edge fetching, and graph construction
      • Updated planarFaces.c to call pgr_process_planarFaces() instead of directly calling the driver
      • Created RST documentation (pgr_planarFaces.rst) and added to experimental toctree
      • Created docquery files (planarFaces.pg and planarFaces.result) with correct BEGIN/ROLLBACK wrapper format
      • Fixed cpplint errors (include ordering, missing <utility> header)
      • Refactored from shared planar_process/planar_driver to algorithm-specific files to avoid return type conflicts (PlanarFace_rt vs II_t_rt) with other planar algorithms
      • All CI checks passing- build, pgtap tests, docqueries, and cpplint
    • pgr_coreNumbers #567:
      • Fixed _coreNumbers.sql LANGUAGE property from IMMUTABLE to VOLATILE to match betweennessCentrality pattern
      • Corrected copyright years in coreNumbers.hpp and coreNumbers.cpp
      • All CI checks passing

Link to report mail

week 2

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_planarFaces algorithm and add pgtap tests
    • Move pgr_coreNumbers files to metrics/ module and fix naming conventions
  • 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_test and planar_face_traversal with a custom FaceVisitor that records seq, face_id, edge_id, side
      • Rewrote driver and C SRF entry to follow the planar module pattern (matching isPlanar / boyerMyrvold)
      • Removed old planarFaces_process.cpp and planarFaces_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
    • pgr_coreNumbers (PR #564):
      • Relocated all coreNumbers files from standalone coreNumbers/ directory into metrics/ module (alongside betweennessCentrality and bandwidth)
      • 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 betweennessCentrality pattern
  • PR links: #563, #564

Link to report mail

week 1

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
  • 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_planarFaces skeleton (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
  • PR links: #555, #556

Link to report mail

Link to report mail

Community Bonding Period

Bonding period

Goal: arrive at Week 1 with , proposal reviewed by mentors, study implementation of algorithms, and a clear understanding of pgRouting architecture.

Week -3 (May 19 ~ May 24)

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_traversal visitor 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

Link to report mail

Week -2 (May 11 ~ May 18)

Proposed: Study planar face traversal behavior using Graphviz examples and Boost documentation.

Plan for the week:

  • Study boyer_myrvold_planarity_test embedding generation
  • Experiment with Graphviz planar graph examples
  • Research planar_face_traversal visitor 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_traversal workflow 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

Week -1 (May 1 ~ May 10)

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 report mail

Log of Pull Requests

Link to all the Pull Requests made in GSoC-pgRouting repository

Pull Request Description Date Status
#551 Week1: pgr_planarFaces skeleton (closed) May 28, 2026 Closed
#555 Week1: pgr_CoreNumbers skeleton May 29, 2026 Open
#556 Week1: pgr_planarFaces skeleton May 29, 2026 and May 30, 2026 Open

Slides

TBD

Final Report

TBD

  1. Links:

(i) Code Documentation:

TBD

(ii) Tags:

TBD

(iii) Pull Requests:

TBD

(iv) Wiki Pages:

TBD

  1. Images:

TBD

  1. Media:

TBD

3. References

⚠️ **GitHub.com Fallback** ⚠️