GSoC 2026 Maximum Weighted Matching Algorithm - pgRouting/pgrouting GitHub Wiki

Table of Contents

Proposal

Brief Description

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.

State of the Project Before GSoC

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.

Deliverables

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

Detailed Proposal

Detailed Proposal link

Participants

Title GitHub Handle Name
1st Mentor @krashish8 Ashish Kumar
2nd Mentor @cvvergara Vicky Vergara
Student Developer @mayurgalhate Mayur Galhate

Timeline & weekly report

Note: in reverse order: the most recent is first

Second Coding Period

week 12

Week 12

Dates: (August 10th – August 16th)

Proposed:

  • Prepare and submit the final project report.

Link to report mail

week 11

Week 11

Dates: (August 3rd – August 9th)

Proposed:

  • Preparing for Final Delivery
  • Integrating to develop branch in the main repository

Link to report mail

week 10

Week 10

Dates: (July 27th – August 2nd)

Proposed:

  • Fixing remaining bugs, test and documentation details
  • Wiki page

Link to report mail

week 9

Week 9

Dates: (July 20th – July 26th)

Proposed:

  • Developer and User’s Documentation
  • Suitable Query using sample data on pgrouting documentation.

Link to report mail

week 8

Week 8

Dates: (July 13th – July 19th)

Proposed:

  • Internal tests for pgr_maximumWeightedMatching()
  • No server crash test
  • pgtAP Unit tests

Link to report mail

week 7

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

Link to report mail

First Coding Period

week 6

Week 6

Dates: (June 29th – July 5th)

Proposed:

  • Finalize the function and documentation
  • Prepare report for first evaluation

Link to report mail

week 5

Week 5

Dates: (June 22nd – June 28th)

Proposed:

  • Create sql query examples
  • Prepare for midterm evaluation

Link to report mail

week 4

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

Link to report mail

week 3

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 maximumWeightedMatching to maxWeightedMatching across the project for consistent naming.

  • Remove obsolete and duplicate files as part of the codebase cleanup.

  • Add the new include/drivers/maxWeightedMatching_driver.hpp driver 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.txt files to reflect the new structure.

Report:

  • Renamed maximumWeightedMatching to maxWeightedMatching across the project for consistent naming.

  • Removed obsolete and duplicate files as part of the codebase cleanup.

  • Added the new include/drivers/maxWeightedMatching_driver.hpp driver 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.txt files to reflect the new structure.

Link to report mail

week 2

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 .rst documentation and test files (.pg , .resultt) under doc/max_flow/ and docqueries/max_flow/
  • Add maximumWeightedMatching.hpp and update localization files (.po , .pot)

Report:

  • Implemented the core algorithm logic using Boost pgr_maximumWeightedMatching
  • Added .rst documentation and test files (.pg , .resultt) under doc/max_flow/ and docqueries/max_flow/
  • Added maximumWeightedMatching.hpp and updated localization files (.po , .pot)

Link to report mail

week 1

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

Link to report mail

Community Bonding Period

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.

Week -1 (May 1 ~ May 10)

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

Link to report mail

Week -2 (May 11 ~ May 18)

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

Link to report mail

Week -3 (May 19 ~ May 24)

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

Log of Pull Requests

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

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

References

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