Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A-star search in numpy or python

i tried searching stackoverflow for the tags [a-star] [and] [python] and [a-star] [and] [numpy], but nothing. i also googled it but whether due to the tokenizing or its existence, i got nothing.

it's not much harder than your coding-interview tree traversals to implement. but, it would be nice to have a correct efficient implementation for everyone.

does numpy have A*?

like image 622
sam boosalis Avatar asked Jan 31 '13 23:01

sam boosalis


3 Answers

Numpy doesn't have A*, but NetworkX has. See https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.algorithms.shortest_paths.astar.astar_path.html .

like image 119
ngr-t Avatar answered Oct 11 '22 14:10

ngr-t


Because your question specifies numpy OR python: There is at least one astar solver in python available on PyPi.

Also there seems to be a few options on GitHub, one of which leverages numpy and c++ (hopefully efficiently).

like image 40
Fnord Avatar answered Oct 11 '22 13:10

Fnord


No, there is no A* search in Numpy.

like image 42
Benjamin Avatar answered Oct 11 '22 13:10

Benjamin