-
Notifications
You must be signed in to change notification settings - Fork 286
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
A_STAR algorithem Implementation #582
base: main
Are you sure you want to change the base?
Conversation
@Kishan-Ved @czgdp1807 https://github.com/codezonediitj/pydatastructs/actions/runs/13481779061/job/37667878320?pr=582#logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines should not end in white spaces.
pydatastructs/graphs/algorithms.py
Outdated
pred = {v: None for v in graph.vertices} | ||
dist[source] = 0 | ||
from pydatastructs.miscellaneous_data_structures.queue import PriorityQueue, BinomialHeapPriorityQueue | ||
pq = PriorityQueue(implementation='binomial_heap') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pq = PriorityQueue(implementation='binomial_heap') | |
pq = PriorityQueue(implementation='binomial_heap') |
pydatastructs/graphs/algorithms.py
Outdated
pq = PriorityQueue(implementation='binomial_heap') | ||
f_score = heuristic(source, target) | ||
pq.push(source, f_score) | ||
while not pq.is_empty: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while not pq.is_empty: | |
while not pq.is_empty: |
pydatastructs/graphs/algorithms.py
Outdated
return dist[target], pred | ||
if visited[current]: | ||
continue | ||
visited[current] = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
visited[current] = True | |
visited[current] = True |
pydatastructs/graphs/algorithms.py
Outdated
visited[current] = True | ||
neighbors = graph.neighbors(current) | ||
if not neighbors: | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continue | |
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kishan-Ved not sure how to resolve this ? shall i git--pull once?
References to other Issues or PRs or Relevant literature
Fixes #486
Brief description of what is fixed or changed
Added A* pathfinding algorithm implementation (_a_star_adjacency_list). This Algorithm uses the Manhattan distance heuristic for coordinate-based nodes and Returns shortest path distance and predecessor dictionary like other pathfinding algorithms
Other comments
used the below to pull requests
https://github.com/codezonediitj/pydatastructs/pull/283/files
https://github.com/codezonediitj/pydatastructs/pull/301/files