GSoC 2026 Maximum Weighted Matching Algorithm - pgRouting/pgrouting GitHub Wiki
This project aims to implement the Maximum Weighted Matching Algorithm from the Boost Graph Library into pgRouting, is an algorithm for finding an optimal set of independent edges in a weighted graph such that the sum of their weights is maximized. The algorithm generates an optimal pairing of vertices that maximizes the total relationship value, improving the efficiency of resource allocation, fleet management, and complex assignment problems. The algorithm works by iteratively discovering augmenting paths and resolving odd-length cycles (using strategies like Edmonds' blossom shrinking) to systematically pair graph vertices, with a typical time complexity of O(V3 ) and space complexity of O(V + E), where V is the number of vertices and E is the number of edges. This implementation will enhance pgRouting's capabilities in combinatorial optimization, benefiting applications that require advanced pairing and relationship maximization.
Until now, maximum weighted matching has not been implemented in pgRouting. However, among the graph algorithms provided by the Boost C++ Libraries, no matching-related algorithm has been integrated into pgRouting so far.
- Implementation of pgr_maximumWeightedMatching().
- Code with clear and essential comments, following style guides and best practices.
- User documentation for the new function.
- Basic pgTap test cases.
- A wiki page detailing weekly progress.
- Detailed reports for the first and final evaluations.
| Title | GitHub Handle | Name |
|---|---|---|
| 1st Mentor | @krashish8 | Ashish Kumar |
| 2nd Mentor | @cvvergara | Vicky Vergara |
| Student Developer | @mayurgalhate | Mayur Galhate |
Note: in reverse order: the most recent is first
week 12
Dates: (August 10th β August 16th)
Proposed:
- Prepare and submit the final project report.
week 11
Dates: (August 3rd β August 9th)
Proposed:
- Preparing for Final Delivery
- Integrating to develop branch in the main repository
week 10
Dates: (July 27th β August 2nd)
Proposed:
- Fixing remaining bugs, test and documentation details
- Wiki page
week 9
Dates: (July 20th β July 26th)
Proposed:
- Developer and Userβs Documentation
- Suitable Query using sample data on pgrouting documentation.
week 8
Dates: (July 13th β July 19th)
Proposed:
- Internal tests for
pgr_maximumWeightedMatching() - No server crash test
- pgtAP Unit tests
week 7
Dates: (July 6h β July 12th)
Proposed:
- Work on the feedback as provided from the First Evaluation
- Bug fixing
- Prepare second coding period Synopsis
week 6
Dates: (June 29th β July 5th)
Proposed:
- Finalize the function and documentation
- Prepare report for first evaluation
week 5
Dates: (June 22nd β June 28th)
Proposed:
- Create sql query examples
- Prepare for midterm evaluation
week 4
Dates: (June 15th β June 21st)
Proposed:
- Finalize the data flow from SQL input to the C layer
- Write helper class and wrappers
- C driver to use Boost C++ function
week 3
Dates: (June 8th β June 14th)
Proposed:
- Read data from User
- Start building the pipeline from SQL input to the C interface.
Plan:
-
Rename
maximumWeightedMatchingtomaxWeightedMatchingacross the project for consistent naming. -
Remove obsolete and duplicate files as part of the codebase cleanup.
-
Add the new
include/drivers/maxWeightedMatching_driver.hppdriver interface. -
Update shared enums and utility mappings to support the renamed function.
-
Reorganize related files to align with the updated project structure.
-
Fix license headers across the affected files to comply with project standards.
-
Update
CMakeLists.txtfiles to reflect the new structure.
Report:
-
Renamed
maximumWeightedMatchingtomaxWeightedMatchingacross the project for consistent naming. -
Removed obsolete and duplicate files as part of the codebase cleanup.
-
Added the new
include/drivers/maxWeightedMatching_driver.hppdriver interface. -
Updated shared enums and utility mappings to support the renamed function.
-
Reorganized related files to align with the updated project structure.
-
Fixed license headers across the affected files to comply with project standards.
-
Updated
CMakeLists.txtfiles to reflect the new structure.
week 2
Dates: (June 1st β June 7th)
Proposed:
- Set up the initial framework for tests and documentation.
- Start implementing
pgr_maximumWeightedMatching()
Plan:
- Implement the core algorithm logic using Boost
pgr_maximumWeightedMatching - Add
.rstdocumentation and test files (.pg,.resultt) underdoc/max_flow/anddocqueries/max_flow/ - Add
maximumWeightedMatching.hppand update localization files (.po,.pot)
Report:
- Implemented the core algorithm logic using Boost
pgr_maximumWeightedMatching - Added
.rstdocumentation and test files (.pg,.resultt) underdoc/max_flow/anddocqueries/max_flow/ - Added
maximumWeightedMatching.hppand updated localization files (.po,.pot)
week 1
Dates: (May 25th β May 31th)
Proposed:
- Go through BGL concepts
- Design data structures needed for
pgr_maximumWeightedMatching()
Plan:
-
Create foundational file structure for
pgr_maximumWeightedMatching -
Create initial C++ implementation skeleton
-
sql/max_flow/_maximumWeightedMatching.sql
-
sql/max_flow/maximumWeightedMatching.sql
-
include/drivers/max_flow/maximum_weighted_matching_driver.h
-
include/max_flow/maximumWeightedMatching.hpp
-
src/max_flow/maximumWeighted_matching_driver.cpp
-
src/max_flow/maximumWeightedMatching.c
-
src/max_flow/maximumWeightedMatching_process.cpp
Report:
-
Create foundational file structure for
pgr_maximumWeightedMatching -
Added basic structure of the following files:-
-
sql/max_flow/_maximumWeightedMatching.sql
-
sql/max_flow/maximumWeightedMatching.sql
-
include/drivers/max_flow/maximum_weighted_matching_driver.h
-
include/max_flow/maximumWeightedMatching.hpp
-
src/max_flow/maximumWeighted_matching_driver.cpp
-
src/max_flow/maximumWeightedMatching.c
-
src/max_flow/maximumWeightedMatching_process.cpp
Bonding period
- Introduce myself to the pgRouting mentors and community members.
- Set up my local development environment and tools.
- Get familiar with the pgRouting codebase and how development is done.
- Learn pgTap and the Boost C++ Libraries to support the project work.
- Create a wiki page to track weekly progress and updates.
- Take part in community chats, meetings, and discussions.
- Learn how PostgreSQL and PostGIS are used with pgRouting.
Proposed: Community bonding and initial preparation β introduce myself to the pgRouting mentors and community members, participate in discussions, and prepare the wiki page for tracking progress.
Plan for the week:
- Introduce myself to the pgRouting mentors and community members
- Participate in community chats, meetings, and discussions
- Create a wiki page to track weekly progress and updates
- Understand the project goals and workflow
Report:
- Participated in bonding period meetings
- Introduced myself to mentors and community members
- Prepared the wiki progress page
- Discussed project ideas and proposal with mentors
Proposed: Environment setup and codebase exploration β set up the local development environment, build pgRouting from source, and understand the project structure and workflow.
Plan for the week:
- Set up the local development environment and required tools
- Build pgRouting from source
- Explore the pgRouting codebase structure
- Understand the development workflow and build system
Report:
- Local development environment successfully configured
- Built pgRouting from source
- Studied the pgRouting codebase and workflow
- Explored the project structure and build process
Proposed: Technical preparation for the project β study Boost Graph Library concepts related to Maximum Weighted Matching and discuss implementation ideas with mentors.
Plan for the week:
- Study Boost Graph Library (BGL) concepts related to Maximum Weighted Matching
- Discuss implementation details and proposal ideas with mentors
- Learn basics of pgTap testing framework
- Study PostgreSQL and PostGIS integration with pgRouting
Report:
- Discussed project proposal and implementation ideas with mentors
- Studied BGL concepts for Maximum Weighted Matching
- Learned basics of pgTap testing framework
- Studied PostgreSQL and PostGIS integration with pgRouting
Link to all the Pull Requests made in GSoC-pgRouting repository
| Pull Request | Description | Date | Status |
|---|---|---|---|
| # 562 | GSoC-2026 Week-01: pgr_maximumWeightedMatching | June 1st, 2026 | Merged |
| # 565 | GSoC-2026 Week-02: pgr_maximumWeightedMatching | June 7th, 2026 | Closed |
| # 566 | GSoC-2026 Week-02: pgr_maximumWeightedMatching | June 8th, 2026 | Merged |
| # 569 | GSoC-2026 Week-03: pgr_maximumWeightedMatching | June 8th, 2026 | Closed |
| # 572 | GSoC-2026 Week-03: pgr_maximumWeightedMatching | June 14th, 2026 | Merged |
TBD
TBD
- Links:
(i) Code Documentation:
TBD
(ii) Tags:
TBD
(iii) Pull Requests:
TBD
(iv) Wiki Pages:
TBD
- Images:
TBD
- Media:
TBD
- https://www.boost.org/doc/libs/latest/libs/graph/doc/maximum_weighted_matching.html
- https://www.boost.org/doc/libs/latest/libs/graph/example/weighted_matching_example.cpp
- https://www.boost.org/doc/libs/1_82_0/libs/graph/doc/index.html
- https://en.wikipedia.org/wiki/Maximum-weight_matching
- https://docs.pgrouting.org/latest/en/sampledata.html
- https://github.com/pgRouting/pgrouting