-
-
Notifications
You must be signed in to change notification settings - Fork 341
Add edmonds blossom algo #238
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
base: master
Are you sure you want to change the base?
Add edmonds blossom algo #238
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds implementations of several new algorithms to the R repository, including Edmonds' Blossom Algorithm for maximum matching in non-bipartite graphs, along with machine learning algorithms (k-NN, Gaussian Process, CNN), graph algorithms (Stoer-Wagner), and dynamic programming (Kadane's Algorithm). However, the PR title and description focus exclusively on Edmonds' Blossom Algorithm while other unrelated algorithms are included without mention.
Key Changes:
- Added Edmonds' Blossom Algorithm for maximum matching in general graphs
- Added multiple machine learning and graph algorithm implementations not mentioned in PR description
- All new files follow lowercase
.r
extension convention
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
graph_algorithms/edmonds_blossom.r | Implementation of Edmonds' Blossom Algorithm using igraph for maximum matching |
machine_learning/k-NN.r | Complete k-Nearest Neighbors implementation with classification and regression support |
machine_learning/guassian_process.r | Gaussian Process Regression using kernlab package |
machine_learning/cnn.r | Convolutional Neural Network architecture definition using Keras |
graph_algorithms/stoer_wagner.r | Stoer-Wagner minimum cut algorithm for undirected weighted graphs |
dynamic_programming/kadane's_algo.r | Kadane's Algorithm for maximum subarray sum with circular variant |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
machine_learning/guassian_process.r:1
- Corrected spelling of 'guassian' to 'gaussian' in filename.
# ==============================================
@@ -0,0 +1,62 @@ | |||
# ============================================== | |||
# Gaussian Process Regression (GP) |
Copilot
AI
Oct 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filename contains a misspelling ('guassian_process.r') that is inconsistent with the correct spelling used throughout the file content ('Gaussian'). The file should be renamed to 'gaussian_process.r'.
Copilot uses AI. Check for mistakes.
Overview
This implementation defines Edmonds’ Blossom Algorithm in R for computing the maximum matching in general (non-bipartite) graphs. The algorithm finds the largest set of edges without shared vertices, handling odd-length cycles (blossoms) efficiently.
Features
Computes maximum matching for both bipartite and non-bipartite graphs.
Handles odd-length cycles using blossom contraction.
Returns matched edges for further processing or analysis.
Includes an example graph for demonstration.
Useful for network pairing, scheduling, and project/task assignments.
Complexity
Time Complexity: O(V³) (V = number of vertices)
Space Complexity: O(V + E)
Demonstration
The included R script computes the maximum matching on a 5-vertex non-bipartite graph.
Prints the matched edges.
Users can replace the edge list with their own graph to find maximum matchings.
Summary
This implementation adds Edmonds’ Blossom Algorithm to the R algorithms repository. It is suitable for matching problems in networks, scheduling tasks, and pairing applications in non-bipartite graphs.