The Wayback Machine - https://web.archive.org/web/20250511045132/https://github.com/TheAlgorithms/C/pull/815
Skip to content

feat: Prims algorithm #815

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

Merged
merged 10 commits into from
Mar 31, 2021
Merged

Conversation

Sl1mb0
Copy link
Contributor

@Sl1mb0 Sl1mb0 commented Mar 19, 2021

Description of Change

I implemented prim's algorithm and added prim.c to TheAlgorithms/C/greedy_approach.

Prim's algorithm finds a minimum spanning tree of a weighted, connected graph.
Using a 'greedy' approach to generate the MST, the algorithm searches for a minimally weighted, non-visited edge, and adds the vertex connected by that edge to the MST.

To test, compile and run.
Enter in adjacency matrix of a weighted, connected graph.

References

pg. 319 "Introduction to the Design and Analysis of Algorithms" - Anany Levitin

Checklist

  • [x ] Added description of change
  • [x ] Added file name matches File name guidelines
  • [ x] Added tests and example, test must pass
  • [ x] Relevant documentation/comments is changed or added
  • [ x] PR title follows semantic commit guidelines
  • [ x] Search previous suggestions before making a new one, as yours may be a duplicate.
  • [ x] I acknowledge that all my contributions will be made under the project's license.

Notes:

@Sl1mb0
Copy link
Contributor Author

Sl1mb0 commented Mar 19, 2021

Who needs to review the code I've added? What exactly are they reviewing for? My code has passed the automated tests.

Copy link
Member

@ayaankhan98 ayaankhan98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Sl1mb0, Thanks for your contribution.
Please follow the Repository Standard Guidelies strictly.

@Sl1mb0
Copy link
Contributor Author

Sl1mb0 commented Mar 19, 2021

Did I not follow the guidelines? I can't find an issue.

@KirwinD
Copy link

KirwinD commented Mar 19, 2021

@Sl1mb0 great input.

Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no proper documentation, and the code is not up to the repository standards. Please follow the steps documented. You can see #797 as a reference. Thanks. 🙂

@Panquesito7 Panquesito7 added Changes requested enhancement New feature or request Proper Documentation Required requested to write the documentation properly labels Mar 19, 2021
@Panquesito7 Panquesito7 changed the title Prims algorithm feat: Prims algorithm Mar 22, 2021
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Good work!

Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address all the unresolved conversations above. 🙂

@KirwinD
Copy link

KirwinD commented Mar 25, 2021

Amazing work. The results are game changing

@Sl1mb0
Copy link
Contributor Author

Sl1mb0 commented Mar 26, 2021

Does anything else need to be done?

@Sl1mb0
Copy link
Contributor Author

Sl1mb0 commented Mar 30, 2021

Okay I went through and made all the requested changes. Thanks for your help @Panquesito7!

Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice and amazing work, @Sl1mb0! Thank you for your contribution! 👍 🎉

@Panquesito7 Panquesito7 added approved Approved; waiting for merge and removed Changes requested Proper Documentation Required requested to write the documentation properly labels Mar 30, 2021
@ayaankhan98 ayaankhan98 merged commit c6a3279 into TheAlgorithms:master Mar 31, 2021
sthagen added a commit to sthagen/TheAlgorithms-C that referenced this pull request Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved; waiting for merge enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants