Skip to content
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

N queens math #2175

Merged
merged 19 commits into from Jul 10, 2020
Merged

N queens math #2175

merged 19 commits into from Jul 10, 2020

Conversation

@DavidBanda
Copy link
Contributor

DavidBanda commented Jul 5, 2020

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}.
@TravisBuddy
Copy link

TravisBuddy commented Jul 5, 2020

Hey @DavidBanda,
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: dec05400-be57-11ea-b6c3-5fc2c9c22d2c
@cclauss
Copy link
Member

cclauss commented Jul 5, 2020

How is this better than https://github.com/TheAlgorithms/Python/blob/master/backtracking/n_queens.py ?

backtracking/n_queens_math.py Outdated Show resolved Hide resolved
backtracking/n_queens_math.py Outdated Show resolved Hide resolved
backtracking/n_queens_math.py Outdated Show resolved Hide resolved
backtracking/n_queens_math.py Outdated Show resolved Hide resolved
DavidBanda and others added 4 commits Jul 5, 2020
Co-authored-by: Christian Clauss <cclauss@me.com>
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

TravisBuddy commented Jul 5, 2020

Hey @DavidBanda,
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: d95c4fc0-be78-11ea-b6c3-5fc2c9c22d2c
@TravisBuddy
Copy link

TravisBuddy commented Jul 5, 2020

Hey @DavidBanda,
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: 7f03d7e0-be79-11ea-b6c3-5fc2c9c22d2c
@TravisBuddy
Copy link

TravisBuddy commented Jul 6, 2020

Hey @DavidBanda,
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: a5b11690-bfba-11ea-8212-0f9c14daf924
@TravisBuddy
Copy link

TravisBuddy commented Jul 6, 2020

Hey @DavidBanda,
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: 13acf3c0-bfbc-11ea-8212-0f9c14daf924
DavidBanda added 4 commits Jul 6, 2020
@DavidBanda
Copy link
Contributor Author

DavidBanda commented Jul 6, 2020

Its not better than https://github.com/TheAlgorithms/Python/blob/master/backtracking/n_queens.py. Its just another solution to the problem of n queens.

@DavidBanda DavidBanda requested a review from cclauss Jul 7, 2020
Copy link
Member

cclauss left a comment

Let's add type hints and let's have depth_first_search() return a board (the search result) instead of passing in boards each time.

backtracking/n_queens_math.py Outdated Show resolved Hide resolved
backtracking/n_queens_math.py Outdated Show resolved Hide resolved
backtracking/n_queens_math.py Outdated Show resolved Hide resolved
backtracking/n_queens_math.py Outdated Show resolved Hide resolved
backtracking/n_queens_math.py Show resolved Hide resolved
backtracking/n_queens_math.py Outdated Show resolved Hide resolved
backtracking/n_queens_math.py Outdated Show resolved Hide resolved
backtracking/n_queens_math.py Outdated Show resolved Hide resolved
backtracking/n_queens_math.py Outdated Show resolved Hide resolved
@TravisBuddy
Copy link

TravisBuddy commented Jul 7, 2020

Hey @DavidBanda,
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: ac9689d0-c08d-11ea-8f0c-c508e01afe59
DavidBanda added 2 commits Jul 7, 2020
@DavidBanda
Copy link
Contributor Author

DavidBanda commented Jul 7, 2020

Hey, how's it going? I added all the changes you requested except for the one that said to use boards as a local variable within depth_first_search() because I don't know how to do it without the algorithm misbehaving.

@DavidBanda DavidBanda requested a review from cclauss Jul 7, 2020
@cclauss
Copy link
Member

cclauss commented Jul 9, 2020

Sorry for the delay... I will review this and land it in 24 hours.

@DavidBanda
Copy link
Contributor Author

DavidBanda commented Jul 10, 2020

Don't worry about it

@cclauss cclauss merged commit 05c14c6 into TheAlgorithms:master Jul 10, 2020
2 checks passed
2 checks passed
codespell
Details
Travis CI - Pull Request Build Passed
Details
@cclauss
Copy link
Member

cclauss commented Jul 10, 2020

Thanks!

@DavidBanda DavidBanda deleted the DavidBanda:n-queens-math branch Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.