Skip to content

Update basic_graphs.py #1990

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 2 commits into from
Jul 13, 2020
Merged

Conversation

karthikeyansa
Copy link
Contributor

@karthikeyansa karthikeyansa commented May 16, 2020

missing return statement line no:223.

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

missing return statement line no:223.
Copy link
Member

@poyea poyea left a comment

Choose a reason for hiding this comment

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

Thank you for your PR. Why would this return a sum? Prim's algorithm should return a tree.
Also, this file has some other issues - no tests or references for algorithms. You may consider fixing some of those for functions in this file.

@itsvinayak itsvinayak requested a review from poyea June 17, 2020 05:35
@itsvinayak
Copy link
Member

@poyea is this seems ok
now it returns the map with the path values

@cclauss
Copy link
Member

cclauss commented Jun 18, 2020

@poyea Please re-review.

Copy link
Member

@poyea poyea left a comment

Choose a reason for hiding this comment

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

Thank you for your pull request!🤩

@poyea
Copy link
Member

poyea commented Jun 23, 2020

@karthikeyansa @cclauss @itsvinayak I think we can add some test graphs to this file, as it is quite difficult to see the expected output. An input graph for prim should be of the form

{ "a" : [["d",1]], "b" : [["c",2], ["e",2]],"c" : [["a",1], ["b",2], ["d",3], ["e",2]],"d" : [["c",2]],"e" : [["c",1], ["b",3]],"f" : []}

However, Dictionary of edges underspecifies the requirement of this argument, though there is an input option for constructing the dictionary.

@itsvinayak itsvinayak merged commit e292ddb into TheAlgorithms:master Jul 13, 2020
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* Update basic_graphs.py

missing return statement line no:223.

* Update basic_graphs.py

Co-authored-by: vinayak <[email protected]>
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.

4 participants