-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
i found another typo and problem greedy_best_first #8770
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
Labels
awaiting triage
Awaiting triage from a maintainer
Comments
JadeKim042386
added a commit
to JadeKim042386/Python
that referenced
this issue
May 26, 2023
JadeKim042386
added a commit
to JadeKim042386/Python
that referenced
this issue
May 27, 2023
JadeKim042386
added a commit
to JadeKim042386/Python
that referenced
this issue
May 27, 2023
JadeKim042386
added a commit
to JadeKim042386/Python
that referenced
this issue
May 27, 2023
- node in self.open_nodes is always better node TheAlgorithms#8770
JadeKim042386
added a commit
to JadeKim042386/Python
that referenced
this issue
May 27, 2023
JadeKim042386
added a commit
to JadeKim042386/Python
that referenced
this issue
May 27, 2023
JadeKim042386
added a commit
to JadeKim042386/Python
that referenced
this issue
May 27, 2023
- node in self.open_nodes is always better node TheAlgorithms#8770
JadeKim042386
added a commit
to JadeKim042386/Python
that referenced
this issue
Aug 15, 2023
JadeKim042386
added a commit
to JadeKim042386/Python
that referenced
this issue
Aug 15, 2023
JadeKim042386
added a commit
to JadeKim042386/Python
that referenced
this issue
Aug 15, 2023
- node in self.open_nodes is always better node TheAlgorithms#8770
tianyizheng02
added a commit
that referenced
this issue
Aug 15, 2023
* fix: typo #8770 * refactor: delete unnecessary continue * add test grids * fix: add \_\_eq\_\_ in Node class #8770 * fix: delete unnecessary code - node in self.open_nodes is always better node #8770 * fix: docstring * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: docstring max length * refactor: get the successors using a list comprehension * Apply suggestions from code review --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
sedatguzelsemme
pushed a commit
to sedatguzelsemme/Python
that referenced
this issue
Sep 15, 2024
* fix: typo TheAlgorithms#8770 * refactor: delete unnecessary continue * add test grids * fix: add \_\_eq\_\_ in Node class TheAlgorithms#8770 * fix: delete unnecessary code - node in self.open_nodes is always better node TheAlgorithms#8770 * fix: docstring * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: docstring max length * refactor: get the successors using a list comprehension * Apply suggestions from code review --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What would you like to share?
1. Typo
self.target.pos_y
andself.target.pos_x
are reversed.Python/graphs/greedy_best_first.py
Lines 145 to 154 in a17791d
parameter of Node is below
Python/graphs/greedy_best_first.py
Lines 38 to 46 in a17791d
The reason why it worked well is that
self.target.pos_y
(6) andself.target.pos_x
(6) are the same.2. Class equality
__eq__
is not implement inNode
class.Python/graphs/greedy_best_first.py
Lines 20 to 56 in 6f21f76
so the below
child_node not in self.open_nodes
orchild_node not in self.open_nodes
did't work.Python/graphs/greedy_best_first.py
Lines 105 to 114 in 6f21f76
3. node in self.open_nodes is always better_node
How can a previous path cost more than the next one? A node that has already entered self.open_nodes is always less expensive than the next node.
So I checked that it works well even if I simply modify it as below.
Additional information
I think
sort()
andpop(0)
are unnecessary. I think it's rather to increase the complexity of time.The text was updated successfully, but these errors were encountered: