Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit with Blossom algorithm implementation #15

Closed
wants to merge 1 commit into from

Conversation

aybanda
Copy link

@aybanda aybanda commented Sep 13, 2024

Implement Blossom Algorithm for Maximum Weight Perfect Matching

#Overview

This pull request introduces an implementation of the Blossom algorithm for maximum weight perfect matching in generic graphs using Julia. The goal is to provide a foundational structure that can be further refined and optimized based on community feedback and collaboration.

#Key Features

Basic Implementation: The algorithm includes the core logic for finding augmenting paths and handling blossoms.
Weight Calculation: The total weight of the matching is calculated and returned alongside the matching pairs.
Labeling and Parent Tracking: The implementation tracks the state of vertices and their parents during the search for augmenting paths.

#Areas for Improvement

While this implementation serves as a starting point, there are several areas where it can be enhanced:
Blossom Handling: The logic for detecting and managing blossoms may need further refinement. Input on how to effectively shrink cycles and manage labels would be invaluable.

#Performance Optimizations: Suggestions for optimizing the algorithm, especially for larger graphs, are welcome. Considerations for using efficient data structures like union-find could be explored.

#Testing and Validation: Comprehensive tests are essential to ensure the robustness of the implementation. Contributions of test cases covering various scenarios, including edge cases, would be greatly appreciated.

#Collaboration Invitation
I invite all collaborators to review this implementation and provide feedback. Your insights and suggestions will be crucial in making this algorithm more robust and efficient. Whether it’s improvements to the logic, performance enhancements, or additional test cases, every contribution is welcome

Thank you for your time and consideration!

If you like what you see and want to support me:

https://buymeacoffee.com/aybanda

@Krastanov
Copy link
Member

Wow, that was quick! Thank you so much!

Before an in-depth review, two quick things:

  • I know that this algorithm can be used both for minimum and for maximum matching, but we should probably keep to the original API instead of modifying it (we can create a helper for the opposite type of matching that automatically changes the sign of the weights)
  • Check out the additional tests posted in fix blossom #11
  • For the bounty there is also the need to move the BlossomV implementation to an extension

Please ping us when you are done with these cleanup and the Graphs.jl team and I will be able to provide a real code review.

@Krastanov
Copy link
Member

hi, @aybanda ! We will be making a decision how to assign the exclusive time for the bounty shortly. Could you let us know whether you are still interested and give a few more details about your past projects that might have exercised similar skills?

@Krastanov
Copy link
Member

hi, @aybanda! Thank you for the first draft, it is very much appreciated! For the bounty, we will assign some exclusive time to another applicant for the time being, as they have more background in the necessary fields, but we would be happy to help you engage with any of the other bounties we are opening

@aybanda
Copy link
Author

aybanda commented Sep 19, 2024

@Krastanov
Sure happy to help
will come back with more rounded approach in solving something similar to this next time!

@Krastanov Krastanov closed this Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants