Skip to content

Conversation

AtharvaPatange
Copy link

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.

@Copilot Copilot AI review requested due to automatic review settings October 18, 2025 07:54
Copy link

@Copilot Copilot AI left a 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>
@Copilot Copilot AI review requested due to automatic review settings October 18, 2025 12:26
Copy link

@Copilot Copilot AI left a 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)
Copy link

Copilot AI Oct 18, 2025

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.

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.

1 participant