Skip to content

Implemented kruskal algorithm - #24

Merged
OmkarPathak merged 8 commits into
OmkarPathak:masterfrom
Michedev:master
Aug 16, 2017
Merged

Implemented kruskal algorithm#24
OmkarPathak merged 8 commits into
OmkarPathak:masterfrom
Michedev:master

Conversation

@Michedev

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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