Skip to content

Implemented kruskal algorithm #24

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 8 commits into from
Aug 16, 2017
Merged

Conversation

Michedev
Copy link

I've implemented the kruskal algorithm to find the minimum spanning tree in a weighted connected undirected graph. I've wrote two tests for kruskal algorithm and all seems work and i run also your tests after the implementation to check that all works.
I'm not an expert of documentation with python, so please check carefully my docs.

Michele De Vita added 3 commits August 14, 2017 13:29
@OmkarPathak
Copy link
Owner

The algorithm looks implemented very well. Just a thought, Kruskal's Algorithm is an algorithm of Graph data structures. So, would it be better to place it under pygorithm/data_structures/graph.py. If so make the relative changes and I would be merging the PR. If you think it's a bad idea, comment here so that I can merge PR right away.

@OmkarPathak OmkarPathak reopened this Aug 15, 2017
Michele De Vita added 4 commits August 16, 2017 02:09
Moved implentation of kruskal into WeightedGraph class into data_structures/graph.py and refactor relative tests. Changed some implementation details into Graph class to simplify the code into add_edge method
…ctures/graph.py and refactor relative tests. Changed some implementation details into Graph class to simplify the code into add_edge method. Changed some code in linked_list and modules to respect pep8 and make some methods (especially get_code()) static or class dependent
@Michedev
Copy link
Author

you have reason, i've moved the implementation into a new WeightedGraph class into graph.py file. I've changed also a little thing into your Graph class: changed the graph variable from dict to defaultdict so the code in add_edge method it's very simplified. I've do some small changes to fit the pep8 style guide into linked_list.py and modules.py. Tell me if you want else i can remove it!

@OmkarPathak OmkarPathak merged commit 536c77d into OmkarPathak:master Aug 16, 2017
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.

2 participants