Skip to content

Conversation

@GURUPRASADPANDA
Copy link

This PR adds an implementation of the Stoer-Wagner algorithm to compute the minimum cut in an undirected, weighted graph. The minimum cut identifies the smallest set of edges whose removal partitions the graph into two disconnected components.

Key Features:

  • Optimized O(V³) implementation for graphs with V vertices.
  • Handles weighted, undirected graphs.
  • Includes a self-contained main method for quick testing.
  • Comes with JUnit test cases to verify correctness.

Why this contribution?

  • Adds a unique graph algorithm not currently present in the repository.
  • Enhances the repository's coverage of advanced graph algorithms.
  • Provides educational value for learners exploring graph theory and network analysis.

Tested:

  • Unit tests using JUnit (StoerWagnerMinCutTest) validate correctness.
  • Sample graph in main demonstrates expected output.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.79%. Comparing base (ce6f731) to head (c1dee77).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6791      +/-   ##
============================================
+ Coverage     77.54%   77.79%   +0.25%     
- Complexity     6293     6308      +15     
============================================
  Files           728      728              
  Lines         20976    21012      +36     
  Branches       4086     4097      +11     
============================================
+ Hits          16265    16346      +81     
+ Misses         4076     4022      -54     
- Partials        635      644       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DenizAltunkapan
Copy link
Member

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.

3 participants