GSoC 2026 Make Biconnected Planar and Make Maximal Planar - pgRouting/pgrouting GitHub Wiki

Table of Contents

Proposal

Brief Description

This project completes pgRouting's planar graph pipeline by implementing two missing Boost Graph Library algorithms: pgr_makeBiconnectedPlanar and pgr_makeMaximalPlanar.

Together with the existing pgr_makeConnected, these form a complete pipeline:

pgr_makeConnected → pgr_makeBiconnectedPlanar → pgr_makeMaximalPlanar

This pipeline unlocks downstream Boost layout algorithms (chrobak_payne_straight_line_drawing, planar_canonical_ordering) that are currently inaccessible to pgRouting users.

State of the Project Before GSoC

pgRouting already provides pgr_makeConnected, pgr_isPlanar / pgr_boyerMyrvold, and pgr_bipartite. Two concrete gaps remain: no function to eliminate articulation points while preserving planarity, and no triangulation of biconnected planar graphs — leaving chrobak_payne_drawing and straight_line_drawing completely inaccessible.

Deliverables

Proposed:

  • Implementation of pgr_makeBiconnectedPlanar()
  • Implementation of pgr_makeMaximalPlanar()
  • Code with clear comments following pgRouting style guides
  • User documentation (RST format) for each new function
  • pgTap test cases for all functions
  • Weekly wiki progress reports
  • Detailed reports for midterm and final evaluations

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

Detailed Proposal

Link to proposal PDF

Participants

Title GitHub Handle Name
1st Mentor @cvvergara Vicky Vergara
2nd Mentor @robe2 Regina Obe
Student Developer @Mohit242-bit Mohit Rawat

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 polish - clean up all code, squash commits, format documentation, write final blog post / GSoC wiki summary, prepare final report.

Plan for the week:

  • Test both algorithms against historical Boost versions (1.79, 1.80, 1.81) to establish compatibility via CI matrix.
  • Perform strict conflict resolution and exact diff checks against the latest pgrouting/develop to ensure a clean merge.
  • Create the final clean branches (biconnected-planar-newfun-try1, new-function-pgr-maximal-planar) rebased directly on pgrouting/develop with a clean 6-commit structure.
  • Finalize RST documentation images and docqueries output.
  • Open the final PRs to pgrouting/develop: PR #3134 (pgr_makeMaximalPlanar) and PR #3135 (pgr_makeBiconnectedPlanar).

Report:

  • Tested the algorithms against historical Boost versions (1.56 through 1.86) to establish compatibility boundaries and updated GitHub Actions CI matrix to test all supported versions.
  • Performed strict conflict resolution and exact difference checks against the latest upstream pgrouting/develop branch to guarantee a perfectly clean integration.
  • Finalized the documentation images and RST files, fixed locale generation conflicts, and ensured all docqueries output accurately reflects edge additions.

Link to report mail

week 11

Week 11

Dates: (August 3 - August 9)

Proposed: Additional integration testing and performance benchmarking on OSM datasets (>1M edges). Address any remaining mentor feedback from Phase 2.

Plan for the week:

  • Migrate makeBiconnectedPlanar and makeMaximalPlanar from the custom planar processing layers to the official pgRouting coloring process and driver architecture.
  • Delete old custom boilerplate driver/process files.
  • Add MAXIMALPLANAR and BICONNECTEDPLANAR cases to src/coloring/coloring_driver.cpp.
  • Create mohit-2026-boost-poc-1.80-algo and biconnected-planar-newfun-try1 branches for Boost Proof-of-Concept CI testing.
  • Add comprehensive pgTAP edge case tests for both algorithms.

Report:

  • Implemented Pgr_makeMaximalPlanar<G> and makeBiconnectedPlanar using shared coloring_driver / coloring_process (the correct modern pattern) — no custom driver/process files.
  • Added MAXIMALPLANAR and BICONNECTEDPLANAR case to src/coloring/coloring_driver.cpp cleanly.
  • Results are sorted by (d1, d2) inside the .hpp algorithm itself.
  • Created mohit-2026-boost-poc-1.80-algo and biconnected-planar-newfun-try1 for Boost Proof-of-Concept testing, narrowing matrix to [79, 80, 81].

Link to report mail

week 10

Week 10

Dates: (July 27 - August 2)

Proposed: Pipeline Integration & Deliverable - fix any cross-function ID mapping issues. Deliverable: working pgr_makeMaximalPlanar with full tests and docs. Address mentor feedback from Phase 2 midterm review.

Plan for the week: Address any PR review from mentors regarding architecture pattern. Optimize pgtap tests. Work on documentation.

Report:

  • Architectural Alignment: Successfully refactored pgr_makeBiconnectedPlanar and pgr_makeMaximalPlanar to match the official C++ architecture. This included routing the logic through unified driver and process files.
  • Upstream Synchronization & Merge Resolution: Fetched and merged the latest changes from pgrouting/develop into my feature branches to ensure compatibility. Carefully resolved complex Git merge conflicts.

Link to report mail

week 9

Week 9

Dates: (July 20 - July 26)

Proposed: Phase 2: Documentation & Idempotency - complete RST docs and docqueries for pgr_makeMaximalPlanar. Verify idempotency (re-run returns empty, pgr_isPlanar still true). Full pipeline integration test.

Plan for the week:

  • Follow pgr_makeConnected approach to match the planar driver and process files with the coloring process and driver.
  • Create the planar-family.rst index page to group all planar functions correctly in the Table of Contents.
  • Perform the mentor exercise: remove the remaining redundant files from GSoC branches so future merges to pgrouting/develop are clean.
  • Optimize pgtap files.

Report:

  • Planar Family Documentation: I created the planar-family.rst index page. I grouped all the planar functions (pgr_isPlanar, pgr_makeBiconnectedPlanar, and pgr_makeMaximalPlanar) so they appear correctly in the Table of Contents.
  • Completed the exercise given by mentors: Removing the redundant files from the GSoC branches so in future we can merge it with the main pgrouting develop branch.

Link to report mail

week 8

Week 8

Dates: (July 13 - July 19)

Proposed: Phase 2: Testing - write comprehensive pgTap tests for pgr_makeMaximalPlanar. Verify E = 3V-6 on all test graphs. Verify no parallel edges or self-loops introduced.

Plan for the week:

  • Rewrite edge_cases.pg tests to accurately cover 0-vertex, 1-vertex, and 2-vertex graph inputs.
  • Align all pgTAP queries to use the standard pgRouting edges sample dataset instead of arbitrary mock data.
  • Ensure comprehensive coverage of all remaining edge cases for both makeBiconnectedPlanar and makeMaximalPlanar.

Report:

  • Edge Cases Validation: I rewrote the edge_cases.pg tests to accurately test 0-vertex, 1-vertex, and 2-vertex graphs.
  • Sample Data Alignment: Instead of using arbitrary mock data, I aligned the pgTAP queries to correctly pull from the standard pgRouting edges sample dataset (e.g., extracting specific edge IDs that accurately represent single-vertex self-loops and two-vertex path graphs).

Link to report mail

week 7

Week 7

Dates: (July 6 - July 12)

Proposed: Phase 2: Core Logic & Edge Cases - handle all error conditions for pgr_makeMaximalPlanar. Handle already-maximal-planar case (empty return). Verify E = 3V-6.

Plan for the week:

  • Create the planar-family.rst index page to group all planar functions in the documentation Table of Contents.
  • Redraw the maximal_planar_sampledata diagram using Graphviz to explicitly reposition nodes so that zero edges cross.
  • Simplify pgTAP test files: remove redundant UPDATE statements and unused PREPARE statements.
  • Open the official final pull requests for the biconnected and maximal planar branches to pgrouting/develop.

Report:

  • pgTAP Simplification: Removed redundant UPDATE statements (like cost = sign(cost)) from the edge_cases.pg files for both makeBiconnectedPlanar and makeMaximalPlanar. Since these algorithms are strictly topological and do not consider edge weights, preparing costs was unnecessary.
  • Test Code Cleanup: Removed unused PREPARE statements and inlined queries in the test files to make the testing structure leaner and easier to maintain.

Link to report mail

First Coding Period

week 6

Week 6

Dates: (June 29 - July 5)

Proposed: Phase 2: pgr_makeMaximalPlanar begins - implement triangulation_visitor with timestamp trick for O(1) neighbor marking. Connect to planar_face_traversal. Get basic triangulation working on C4 -> K4 (adds 2 diagonals).

Plan for the week: -Present the fully tested, and documented implementations of pgr_makeBiconnectedPlanar and pgr_makeMaximalPlanar to mentors for review. -Address any mentor review feedback or requested optimizations on the algorithm or pgtap files.

Report:

  • Documentation Structure & Standardisation: Restructured the official Sphinx documentation for both pgr_makeBiconnectedPlanar.rst and pgr_makeMaximalPlanar.rst. Prioritised the core graph theory definitions and algorithm descriptions at the very beginning of the documentation. Standardised the “Main characteristics” sections (undirected graph, planar graph requirements, empty set returns for invalid inputs) and refined the running time mathematical notation to strictly follow :math:O(|V_G| + |E_G|)where:math:G(V_G, E_G) is the input graph.
  • Planar Diagram & Visual Layout Optimization: Redesigned and updated the visual sample graph diagrams (sampledata, line, and 5cycle diagrams) to guarantee strict two-dimensional planar representations with zero edge crossings. Positioned isolated components (such as 2-4 and 13-14) cleanly apart from the main graph structure to visually clarify multi-component behavior.

Link to report mail

week 5

Week 5

Dates: (June 22 - June 28)

Proposed: Phase 1 -> Phase 2 Transition - address mentor feedback from Week 4. Create Phase 2 file scaffolding (src/planar/makeMaximalPlanar.*). Study triangulation_visitor source and end_face() phases 1-6 in detail.

Plan for the week:

-Discuss on the official .rst documentation and C++ docqueries for both pgr_makeBiconnectedPlanar and pgr_makeMaximalPlanar so they are fully ready for the official release. -Present my completed work to the mentors, gather feedback on the disconnected components architecture, and implement any performance optimizations requested.

Report:

  • Deterministic Edge Sorting & Normalization: Updated the core C++ implementations of both pgr_makeBiconnectedPlanar and pgr_makeMaximalPlanar. Enforced edge normalization (start_vid < end_vid) and deterministic sorting by (start_vid, end_vid) across both single-component and multi-component graphs, guaranteeing consistent results independent of internal Boost traversal order.
  • Refined & Simplified pgTAP Test Suite: Restructured edge_cases.pg for both algorithms using clean inline SQL queries, eliminating complex named prepared statements while maintaining comprehensive coverage. Thoroughly tested graph theory concepts including self-loops, P3 path bridging, C4 triangulation, disconnected forest graphs, disjoint road networks, and non-planar K5 rejection. All 71+ tests pass with 100% success rate.
  • Official Sphinx Documentation & Documentation Queries: Standardised pgr_makeBiconnectedPlanar.rst and pgr_makeMaximalPlanar.rst to follow official pgRouting documentation guidelines. Updated docqueries .result files to reflect normalized edge outputs and verified zero-warning HTML generation

Link to report mail

week 4

Week 4

Dates: (June 15 - June 21)

Proposed: Phase 1: Documentation & Delivery - complete RST documentation, write docquery examples, verify idempotency. Deliverable: working pgr_makeBiconnectedPlanar with full tests and docs.

Plan for the week: -Work on the pgr_makeBiconnectedPlanar and pgr_makeMaximalPlanar implementation for the disconnected components input case. -Edge Cases & Output Mapping -handle different types of edge cases and erros. -Write comprehensive pgTap tests: path graphs P3/P4/P5, cycle graphs, tree graphs, disconnected input. -Start RST documentation and docqueries .

Report:

  • Implemented Disconnected Graph Support: Successfully implemented pgr_makeMaximalPlanar and pgr_makeBiconnectedPlanar for disconnected component inputs using a multi-component bucket architecture without dropping graph accuracy.
  • Architectural Cleanup: Maintained the core pgRouting 3-layer architecture by removing outdated redundant validation checks that blocked disconnected graphs, and enforcing the mutable planar_visitor pattern for accurate edge traversal.
  • Memory Safety & Robustness: Extensively handled edge cases, memory bounds, and vertex indices mapping between Boost components and pgRouting components.
  • Comprehensive pgTAP Tests: Wrote and executed a full suite of pgTAP tests (including types_check.pg, inner_query.pg, no_crash_test.pg, and edge_cases.pg) for both algorithms. Tested memory crashes and input data issues. All 71+ tests pass successfully.
  • Documentation & Standardisation: Wrote documentation of algorithms with proper syntax.

Link to report mail

week 3

Week 3

Dates: (June 8 - June 14)

Proposed: Phase 1: Edge Cases & Output Mapping - handle already-biconnected (empty return), not-connected error, not-planar error. Write comprehensive pgTap tests: path graphs P3/P4/P5, cycle graphs, tree graphs, disconnected input.

Plan:

  • Refactor the code architecture to use a shared planar_driver and planar_process pattern.
  • Clean up the workspace by removing old, individual driver/process files.
  • Discussed and finalised the implementation of Makebiconnected algorithm and MakeMaximal planar algorithm implementation (disconnected components input case)

Report:

  • Refactored the core logic of pgr_makeBiconnectedPlanar and pgr_makeMaximalPlanar to use the shared 3-layer planar_driver and planar_process architecture.
  • Cleaned up the codebase by removing obsolete files.
  • Discussed and finalised the implementation of Makebiconnected algorithm and MakeMaximal planar algorithm implementation (disconnected components input case)

Link to report mail

week 2

Week 2

Dates: (June 1 - June 7)

Proposed: Phase 1: Core Algorithm - connect EdgeIndexMap and embedding to boost::make_biconnected_planar. Implement pgr_collect_edges_visitor. Map Boost vertex descriptors back to pgRouting IDs. Get a working end-to-end function on the 7-vertex walkthrough graph.

Plan:

  • Implement the core algorithm logic using Boost’s make_biconnected_planar and make_maximal_planar
  • Build the EdgeIndexMap and planar embedding infrastructure needed by the Boost calls
  • Implement pgr_collect_edges_visitor
  • Begin documentation for the new functionalities

Report:

  • Implemented the core algorithm logic using Boost’s make_biconnected_planar and make_maximal_planar.
  • Built the EdgeIndexMap and planar embedding infrastructure required by the Boost calls.
  • Implemented planar_visitor to extract the added edges.
  • Added standard error handling returning std::string messages.

Link to report mail

week 1

Week 1

Dates: (May 25 - May 31)

Proposed: Phase 1: pgr_makeBiconnectedPlanar begins - build and test EdgeIndexMap construction in isolation using BGL_FORALL_EDGES. Run boyer_myrvold_planarity_test with embedding storage enabled; verify embedding vector populates correctly on test graphs.

Plan:

  • Create foundational file structure for pgr_makeBiconnectedPlanar
  • Create foundational file structure for pgr_makeMaximalPlanar
  • Register new source files in src/planar/CMakeLists.txt
  • Register new SQL files in sql/planar/CMakeLists.txt
  • Add signatures of both functions to sql/sigs/pgrouting--4.1.sig
  • Open Pull Requests to initiate GSoC review

Report:

  • Create foundational file structure for pgr_makeBiconnectedPlanar
  • Create foundational file structure for pgr_makeMaximalPlanar
  • Register new source files in src/planar/CMakeLists.txt
  • Register new SQL files in sql/planar/CMakeLists.txt
  • Add signatures of both functions to sql/sigs/pgrouting--4.1.sig
  • Open Pull Requests to initiate GSoC review

Link to report mail

Community Bonding Period

Bonding period

Goal: arrive at Week 1 with pseudocode approved by mentors, test graphs designed, and a clear understanding of pgRouting architecture.

Week -1 (May 19 ~ May 24)

Proposed: Pre-Coding Preparation - run standalone tests of boost::make_biconnected_planar on path/tree graphs and boost::make_maximal_planar on simple planar graphs (C4 -> K4). Share pseudocode of C++ wrapper classes with mentors for review. Design specific test graphs for docqueries.

Plan for the week:

  • Run standalone tests of boost::make_biconnected_planar on path/tree graphs
  • Run standalone tests of boost::make_maximal_planar on simple planar graphs (C4 -> K4)
  • Write pseudocode for both C++ wrapper classes and share with mentors for review
  • Study maximal planar in detail and confirm the visitor should be non-mutating OR mutating

Report:

  • Standalone tests of boost::make_biconnected_planar run
  • Standalone tests of boost::make_maximal_planar run
  • Pseudocode for both wrappers(will link in report)
  • Studied maximal planar graph (revised proposal edit: mutating visitor )

Link to report mail

Week -2 (May 11 ~ May 18)

Proposed: Deep Codebase Reading - read make_biconnected_planar.hpp and make_maximal_planar.hpp in full Boost source. Write a private walkthrough document for each file and share with mentors for feedback.

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 boyer_myrvold_planarity_test embedding generation
  • Studied Graphviz planar examples
  • planar_face_traversal workflow studied
  • pgRouting execution pipeline studied

Link to report mail

Week -3 (May 1 ~ May 10)

Proposed: Environment and Community - introduce myself on pgrouting-dev and soc@osgeo mailing lists. Verify pgRouting builds from source with all planar tests passing. Set up wiki progress page.

Plan for the week:

  • Introduce myself on pgrouting-dev and soc@osgeo mailing lists
  • Verify pgRouting builds from source with all planar tests passing
  • Set up wiki progress page at the pgRouting GSoC wiki

Report:

  • Bonding period meeting
  • Prepared Wiki (copied from proposal)
  • Worked on edges problem (maximal planar and biconnected planar should return edges or not in the output)

Link to report mail

Log of Pull Requests

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

Pull Request Description Date Status
#550 pgr_makeBiconnectedPlanar Week 1 Skeleton files implemention 2026-06-01 Merged
#553 pgr_makeMaximalPlanar - Week 1 Implementation (Closed:wrong branch) 2026-05-28 Closed
#554 pgr_makeMaximalPlanar Week 1 Skeleton files implemention 2026-06-01 Merged
#558 pgr_makeBiconnectedPlanar - Week 2 implementation 2026-06-08 Merged
#560 pgr_makeMaximalPlanar Week 2 Implementation 2026-06-08 Merged
#570 pgr_makeBiconnectedPlanar - Week 3 implementation 2026-06-14 Merged
#571 pgr_makeMaximalPlanar Week 3 Implementation 2026-06-14 Merged
#574 pgr_makeBiconnectedPlanar - Week 4 implementation 2026-06-22 Merged
#573 pgr_makeMaximalPlanar Week 4 Implementation 2026-06-22 Merged
#580 pgr_makeBiconnectedPlanar - Wrong branch(closed) 2026-06-23 Closed
#581 pgr_makeMaximalPlanar Wrong branch(closed) 2026-06-23 Closed
#584 pgr_makeBiconnectedPlanar - Week 5 implementation 2026-06-29 Merged
#583 pgr_makeMaximalPlanar Week 5 Implementation 2026-06-29 Merged
#588 pgr_makeBiconnectedPlanar - Week 6 implementation 2026-07-05 Merged
#587 pgr_makeMaximalPlanar Week 6 Implementation 2026-07-05 Merged
#593 pgr_makeBiconnectedPlanar - Week 7 implementation 2026-07-12 Merged
#592 pgr_makeMaximalPlanar - Week 7 Implementation 2026-07-12 Merged
#598 pgr_makeBiconnectedPlanar - Week 8 implementation 2026-07-19 Merged
#597 pgr_makeMaximalPlanar - Week 8 Implementation 2026-07-19 Merged
#604 pgr_makeBiconnectedPlanar - Week 9 implementation 2026-07-26 Merged
#605 pgr_makeMaximalPlanar - Week 9 Implementation 2026-07-26 Merged
#612 Exercise Week 9 2026-07-26 Merged
#619 pgr_makeBiconnectedPlanar - Week 10 implementation 2026-08-02 Merged
#613 pgr_makeMaximalPlanar - Week 10 Implementation 2026-08-02 Merged
#623 pgr_makeMaximalPlanar - Week 11 Implementation 2026-08-13 Merged
#624 pgr_makeBiconnectedPlanar - Week 11 implementation 2026-08-13 Merged
#626 pgr_makeMaximalPlanar - Week 11a Implementation 2026-08-15 Merged
#630 pgr_makeBiconnectedPlanar - Boost check 2026-08-17 Closed
#631 pgr_makeMaximalPlanar - Boost check 2026-08-17 Closed
#632 pgr_makeBiconnectedPlanar - Week 12 implementation 2026-08-17 Merged
#633 pgr_makeMaximalPlanar - Week 12 Implementation 2026-08-17 Merged

Final Report

Report Mail - [OSGeo Discourse]

Hello everyone,

With GSoC coming to an end, I hereby present my final report of the work I have done over the past three months. It has been an amazing learning experience and a great time working with the pgRouting community and mentors.

Title: Implementing make_biconnected_planar and make_maximal_planar Algorithms for pgRouting from the Boost Graph Library

Organisation: pgRouting under the umbrella of OSGeo

Abstract: This GSoC project dealt with the implementation of two new planar graph algorithms in pgRouting. The algorithms are described below:

  • pgr_makeBiconnectedPlanar: This algorithm takes a planar graph and adds edges to eliminate articulation points (vertices whose removal would disconnect the graph), making it biconnected while strictly preserving its planarity. Biconnectivity is a fundamental requirement for many advanced graph layout algorithms.
  • pgr_makeMaximalPlanar: This algorithm triangulates a biconnected planar graph by adding edges until no more edges can be added without violating planarity (resulting in a graph where every face is a triangle, satisfying Euler's formula E = 3V - 6).

Together with the existing pgr_makeConnected, these functions complete pgRouting's planar graph pipeline (makeConnectedmakeBiconnectedPlanarmakeMaximalPlanar), unlocking downstream Boost layout algorithms like Chrobak-Payne straight line drawing.

State of the Project Before GSoC: pgRouting already provided pgr_makeConnected and planarity testing via pgr_isPlanar. However, there were two concrete gaps: no function to eliminate articulation points while preserving planarity, and no triangulation of biconnected planar graphs. This left advanced planar graph drawing and canonical ordering functions completely inaccessible to pgRouting users.

State of the Project After GSoC: The deliverables are complete. Both pgr_makeBiconnectedPlanar and pgr_makeMaximalPlanar have been fully implemented in C++ using the modern coloring_driver architecture. The deliverables include the core code, comprehensive RST user documentation, documentation queries, and a robust suite of pgTAP edge-case tests (handling 0-vertex, single-vertex, disconnected components, and non-planar rejection).

Potential Future Work:

  • After the completion of the program, I will focus on resolving any potential bugs or usability issues that may come up during extended community testing.
  • The completion of this pipeline now opens the door for implementing the actual drawing algorithms (chrobak_payne_straight_line_drawing and planar_canonical_ordering). I would like to explore implementing these downstream functions so users can generate 2D coordinates for planar graphs directly inside PostGIS.

Links:

I am so grateful to be a part of the amazing GSoC and OSGeo communities. I have learned a massive amount during this program, which has helped me improve my C++ architecture skills, my understanding of the Boost Graph Library, and how to effectively contribute to open source. Last but not least, a huge thank you to my mentors and the entire community for the continuous support, guidance, and helpful communication!

Thank you and Regards,

Mohit Rawat

References

  1. boost::make_biconnected_planar - Boost Graph Library

  2. boost::make_maximal_planar - Boost Graph Library

  3. Boyer-Myrvold Planarity Testing/Embedding - Boost Graph Library

  4. biconnected_components (Tarjan) - Boost Graph Library

  5. planar_face_traversal - Boost Graph Library

  6. planar_canonical_ordering - Boost Graph Library

  7. chrobak_payne_straight_line_drawing - Boost Graph Library

  8. pgRouting Sample Data

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