Skip to content

Gale Shapley Algorithm #2100

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
Jul 5, 2020
Merged

Gale Shapley Algorithm #2100

merged 10 commits into from
Jul 5, 2020

Conversation

akashvshroff
Copy link
Contributor

@akashvshroff akashvshroff commented Jun 12, 2020

Implementation of a Nobel prize-winning algorithm that determines a stable matching in a bipartite graph.

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}.

Implementation of a Nobel prize-winning algorithm that determines a stable matching in a bipartite graph.
@TravisBuddy
Copy link

Hey @akashvshroff,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 163ef130-aca0-11ea-8245-836d9da6cb4c

Copy link
Member

@l3str4nge l3str4nge left a comment

Choose a reason for hiding this comment

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

Please flake8 --ignore=E203,W503 --max-complexity=25 --max-line-length=120 --statistics --count . on your local machine and fix errors.

Co-authored-by: Christian Clauss <cclauss@me.com>
@TravisBuddy
Copy link

Hey @akashvshroff,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 3875c110-b633-11ea-aaf6-456b40a357ff

@akashvshroff
Copy link
Contributor Author

Please flake8 --ignore=E203,W503 --max-complexity=25 --max-line-length=120 --statistics --count . on your local machine and fix errors.

I think it should be alright now? Thanks.

@TravisBuddy
Copy link

Hey @akashvshroff,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: bf289ae0-b636-11ea-aaf6-456b40a357ff

@asukaminato0721
Copy link
Contributor

I read the log, it said W291 trailing whitespace which means there are extra white sapces. You can use the format function in your editor to fix it.

@akashvshroff
Copy link
Contributor Author

I read the log, it said W291 trailing whitespace which means there are extra white spaces. You can use the format function in your editor to fix it.

When I do it, it says 0 and indicates there are no errors - did you try it on the code as part of my latest commit? Thanks.

@cclauss
Copy link
Member

cclauss commented Jul 3, 2020

psf/black and other formatters might be reluctant to modify text that is inside a triple quoted string but flake8 will still flag that those lines as having trailing whitespace. If that is the case then manual edits may be required.

@cclauss
Copy link
Member

cclauss commented Jul 3, 2020

I know this is a bit of a chore but... I do not think that we should base an algorithm on the premise that Marriages are heterosexual as it will not be viewed as politically correct in some circles. Could we please shift to organ donors and recipients instead. I hope that you understand why this would be helpful for us building a diversified community of contributors. Thanks.

@akashvshroff
Copy link
Contributor Author

I know this is a bit of a chore but... I do not think that we should base an algorithm on the premise that Marriages are heterosexual as it will not be viewed as politically correct in some circles. Could we please shift to organ donors and recipients instead. I hope that you understand why this would be helpful for us building a diversified community of contributors. Thanks.

I've made the necessary changes and manually ensured that there is no trailing whitespace in the program, I hope it is alright now! Thanks.

@TravisBuddy
Copy link

Hey @akashvshroff,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 73f20c50-bde3-11ea-a595-8f8781864445

Copy link
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

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

Just a few minor changes and then we can land this one.

@cclauss
Copy link
Member

cclauss commented Jul 4, 2020

./graphs/gale_shapley_bigraph.py:30:89: E501 line too long (90 > 88 characters)

akashvshroff and others added 3 commits July 5, 2020 10:40
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
@TravisBuddy
Copy link

Hey @akashvshroff,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 56e77eb0-be7e-11ea-b6c3-5fc2c9c22d2c

@akashvshroff
Copy link
Contributor Author

I hope I've edited everything as required!

@TravisBuddy
Copy link

Travis tests have failed

Hey @akashvshroff,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 2d19ac50-be80-11ea-b6c3-5fc2c9c22d2c

@cclauss cclauss merged commit 25d9d81 into TheAlgorithms:master Jul 5, 2020
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* Gale Shapley Algorithm

Implementation of a Nobel prize-winning algorithm that determines a stable matching in a bipartite graph.

* Update graphs/gale_shapley_bigraph.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Fixed some flake8 issues.

* Updated it to donors and recipients

* description changes

Co-authored-by: Christian Clauss <cclauss@me.com>

* description changes

Co-authored-by: Christian Clauss <cclauss@me.com>

* description changes

Co-authored-by: Christian Clauss <cclauss@me.com>

* Edited the line lengths

* Update gale_shapley_bigraph.py

* Update gale_shapley_bigraph.py

Co-authored-by: Christian Clauss <cclauss@me.com>
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.

5 participants