Title: PriorityQueue needs rework · Issue #1024 · aimacode/aima-python · GitHub
Open Graph Title: PriorityQueue needs rework · Issue #1024 · aimacode/aima-python
X Title: PriorityQueue needs rework · Issue #1024 · aimacode/aima-python
Description: As pointed out by #919 and #941, A* search is behaving incorrectly. This is partly due to the way the A* implementation interfaces with the PriorityQueue (in utils.py). Due to how __contains__ is implemented in PriorityQueue, if the heur...
Open Graph Description: As pointed out by #919 and #941, A* search is behaving incorrectly. This is partly due to the way the A* implementation interfaces with the PriorityQueue (in utils.py). Due to how __contains__ is i...
X Description: As pointed out by #919 and #941, A* search is behaving incorrectly. This is partly due to the way the A* implementation interfaces with the PriorityQueue (in utils.py). Due to how __contains__ is i...
Opengraph URL: https://github.com/aimacode/aima-python/issues/1024
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PriorityQueue needs rework","articleBody":"As pointed out by #919 and #941, A* search is behaving incorrectly. This is partly due to the way the A* implementation interfaces with the PriorityQueue (in utils.py). Due to how `__contains__` is implemented in PriorityQueue, if the heuristic function passed to A* produces non-unique values for the same state (As in the case of #919), A* would re-visit the same state multiple times. \r\n\r\n#829 also raises some concerns about the implementation of `__getitem__` and `__contains__` in PriorityQueue. While these methods seem similar, they are quite distinct. Using `__getitem__` instead of `__contains__` should fix A*. However, since both these functions are confused many times (#828), we should include at least some documentation and test cases to illustrate this use. Another solution to this confusion would be altering the roles of `__getitem__` and `__contains__` such that for a priority queue A and element x:\r\n\r\n- `x in A` returns whether a copy is present regardless of its function value\r\n\r\n- `A[x]` returns the function value of a copy if it is present in the queue, else throws a `KeyError` like other dicts in python.","author":{"url":"https://github.com/rajatjain1997","@type":"Person","name":"rajatjain1997"},"datePublished":"2019-02-10T02:55:29Z","url":"https://github.com/aimacode/aima-python/issues/1024"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:19635776-18a1-e2a9-3b64-916075eb1e50 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD2C:2A98A:FED1C2:1406F63:6B025088 |
| html-safe-nonce | e7f16401ccacd2b0a0b2dfe2a87e6c1311d6c884da1b2d93fdba433e215f0f90 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDJDOjJBOThBOkZFRDFDMjoxNDA2RjYzOjZCMDI1MDg4IiwidmlzaXRvcl9pZCI6IjU3NjIwNzEzMjA4NzE0NTY5MDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ed98fc03ccf25126700bc34bc0d77b8f881b32851cfe5e3127b8e6c63196d564 |
| hovercard-subject-tag | issue:408494675 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/aimacode/aima-python/1024/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dbb04d3d424aea1f834c77b9daa3f21c7a5724420f0423804b00ffd3052d3767/aimacode/aima-python/issues/1024 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dbb04d3d424aea1f834c77b9daa3f21c7a5724420f0423804b00ffd3052d3767/aimacode/aima-python/issues/1024 |
| og:image:alt | As pointed out by #919 and #941, A* search is behaving incorrectly. This is partly due to the way the A* implementation interfaces with the PriorityQueue (in utils.py). Due to how __contains__ is i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rajatjain1997 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/aimacode/aima-python git https://github.com/aimacode/aima-python.git |
| octolytics-dimension-user_id | 17015933 |
| octolytics-dimension-user_login | aimacode |
| octolytics-dimension-repository_id | 50881110 |
| octolytics-dimension-repository_nwo | aimacode/aima-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 50881110 |
| octolytics-dimension-repository_network_root_nwo | aimacode/aima-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width