Skip to content

Added breadth_first_search.py #3648

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

Closed
wants to merge 2 commits into from
Closed

Added breadth_first_search.py #3648

wants to merge 2 commits into from

Conversation

Rolv-Apneseth
Copy link
Contributor

Added a .py file in the searches folder for breadth-first search algorithm with a pathfind visualisation to show the result.

Included doctests and have already run black, mypy and doctests locally.

In relation to #3260, and retrying from #3632 since I accidentally included commits from another pr in that one.

@Rolv-Apneseth
Copy link
Contributor Author

Thank you to the comments on #3632

@spamegg1
Copy link
Contributor

I see there are already 4 BFS implementations in the graphs folder. Is this significantly different from those? Not sure, a maintainer would have to look over.

@Rolv-Apneseth
Copy link
Contributor Author

Oh my god I did not even see that folder, I just went off the comment under the issue I posted (#3260) that said to put it in searches and nobody else replied to that issue so I just went with it.

@Rolv-Apneseth
Copy link
Contributor Author

For a maintainer to decide then, looking at the other breadth first search algorithms though, it looks like they have to be fed a specific linked list, whereas mine generates a simple maze(optional) where the user only has to specify size, starting and ending location and it will print it the maze before and after it is solved. I could do the same for a different algorithm though it looks like most are covered in that graphs folder. Again, my bad, thought it would be in the searches folder

@spamegg1
Copy link
Contributor

@Rolv-Apneseth Ah don't feel bad, the repo is not perfectly organized and contains a lot of redundant stuff. (We actually need people to improve existing files much more than we need new algorithms being submitted, at least in my opinion. Take a look at #2128 )

But as you can see it definitely pays to browse through the repo FIRST.

I guess mazes can be converted to graphs and vice versa, but your maze version might be worth having. But I guess it will take a long time to be reviewed.

There are other much much less popular TheAlgorithms repos where you could submit this: F#, Haskell, OCaml, Scala, Elm and so on. In the spirit of Hacktoberfest, learn a new language!

@stale
Copy link

stale bot commented Nov 22, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Used to mark an issue or pull request stale. label Nov 22, 2020
@stale
Copy link

stale bot commented Nov 29, 2020

Please reopen this pull request once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions!

@stale stale bot closed this Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Used to mark an issue or pull request stale.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants