-
Notifications
You must be signed in to change notification settings - Fork 276
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
Implemented A* algorithm and updated test cases #576
base: main
Are you sure you want to change the base?
Conversation
@Kishan-Ved @czgdp1807 |
if algorithm == 'a_star_with_manhattan': | ||
# A* with this implementation requires both source and target | ||
if not target: | ||
raise ValueError("Target must be specified for A* algorithm") | ||
|
||
func = "_a_star_with_manhattan_" + graph._impl | ||
return getattr(algorithms, func)(graph, source, target) |
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.
This is not needed. The logic below already handles this.
@@ -293,7 +292,34 @@ def _test_shortest_paths_positive_edges(ds, algorithm): | |||
graph.remove_edge('SLC', 'D') | |||
graph.add_edge('D', 'SLC', -10) | |||
assert raises(ValueError, lambda: shortest_paths(graph, 'bellman_ford', 'SLC')) | |||
|
|||
def _test_a_star_manhattan(ds): |
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.
def _test_a_star_manhattan(ds): | |
def _test_a_star_manhattan(ds): |
It's a path setting issue in VSCode. You need to add PATH to your conda environment headers in VSCode settings. |
I'm currently working on this along with publishing a research paper. I'll get it done ASAP sir |
References to other Issues or PRs or Relevant literature
fixes #486
https://github.com/codezonediitj/pydatastructs/pull/283/files
https://github.com/codezonediitj/pydatastructs/pull/301/files
Brief description of what is fixed or changed
1.implemented a star algorithm with the help of Manhattan heustric and took reference from the Wikipedia
2.took reference from the Dijkstra and bellman ford algorithm for test cases and code writing
Other comments