@@ -744,7 +744,7 @@ def shortest_paths(graph: Graph, algorithm: str,
744
744
>>> G2 = Graph(start, middle, goal)
745
745
>>> G2.add_edge('0,0', '1,1', 2)
746
746
>>> G2.add_edge('1,1', '2,2', 2)
747
- >>> shortest_paths(G2, 'A_star ', '0,0', '2,2')
747
+ >>> shortest_paths(G2, 'a_star ', '0,0', '2,2')
748
748
(4, {'0,0': None, '1,1': '0,0', '2,2': '1,1'})
749
749
References
750
750
==========
@@ -756,7 +756,7 @@ def shortest_paths(graph: Graph, algorithm: str,
756
756
raise_if_backend_is_not_python (
757
757
shortest_paths , kwargs .get ('backend' , Backend .PYTHON ))
758
758
import pydatastructs .graphs .algorithms as algorithms
759
- func = "_" + algorithm + "_" + graph ._impl
759
+ func = "_" + algorithm . lower () + "_" + graph ._impl
760
760
if not hasattr (algorithms , func ):
761
761
raise NotImplementedError (
762
762
"Currently %s algorithm isn't implemented for "
@@ -824,7 +824,6 @@ def _dijkstra_adjacency_list(graph: Graph, start: str, target: str):
824
824
def _a_star_adjacency_list (graph : Graph , source : str , target : str ) -> tuple :
825
825
"""
826
826
A* pathfinding algorithm implementation similar to Dijkstra's structure.
827
-
828
827
Parameters
829
828
==========
830
829
graph: Graph
@@ -833,7 +832,6 @@ def _a_star_adjacency_list(graph: Graph, source: str, target: str) -> tuple:
833
832
Starting node name
834
833
target: str
835
834
Target node name
836
-
837
835
Returns
838
836
=======
839
837
(distance, predecessors): tuple
0 commit comments