Added MST Algorithms to the Algorithms_and_Data_Structures folder #481 #593
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request for PyVerse 💡
Requesting to submit a pull request to the PyVerse repository.
Issue Title
[Code Addition Request]: Add MST Algorithms
Info about the Related Issue
What’s the goal of the project?
The goal of the project is to enhance the repository's graph algorithms section by implementing optimized versions of Prim's and Kruskal's algorithms to find the Minimum Spanning Tree (MST) in an undirected, weighted graph. These implementations will improve performance by using a priority queue in Prim’s algorithm and a disjoint set in Kruskal’s for cycle detection.
Describe the aim of the project.
The aim is to provide efficient and well-documented implementations of MST algorithms, ensuring that they handle edge cases (like disconnected graphs) and include unit tests for reliability. This will strengthen the graph algorithms section of the repository.
Name
Please mention your name.
Enter your name here.
Shashmitha V
GitHub ID
Please mention your GitHub ID.
Enter your GitHub ID here.
https://github.com/shashmitha46
Email ID
Please mention your email ID for further communication.
Enter your email ID here.
[email protected]
Identify Yourself
Mention in which program you are contributing (e.g., WoB, GSSOC, SSOC, SWOC).
Enter your participant role here.
Closes
Enter the issue number that will be closed through this PR.
*Closes: #481 *
Describe the Add-ons or Changes You've Made
Give a clear description of what you have added or modified.
Describe your changes here.
Added 3 MST algorithms
Type of Change
Select the type of change:
How Has This Been Tested?
Describe how your changes have been tested.
Describe your testing process here.
The changes have been tested using unit tests that cover various scenarios, including connected graphs, disconnected graphs, and edge cases like graphs with no edges or multiple minimum spanning trees. The tests ensure that both Prim’s and Kruskal’s algorithms correctly find the Minimum Spanning Tree and handle edge cases without errors.
Checklist
Please confirm the following: