Heuristic Searches
Project description
Heuristic Searches
This module contains functions to perform a* search and ao* search algorithms
Installation
Run the following command to install:
pip install heuristicsearch
Useage
from a_star_search import AStar
from ao_star import AOStar
# object creation Astar(adjacency_list -> dictionary, heuristic_values -> dicitonary)
# call the apply_a_star method to find the shortest path
adjacency_list = {
'A': [('B', 1), ('C', 3), ('D', 7)],
'B': [('D', 5)],
'C': [('D', 12)]
}
heuristics = {'A':1, 'B':1, 'C':1, 'D':1}
graph1 = AStar(adjacency_list, heuristics)
graph1.apply_a_star(start='A',stop='B')
# similar approach for AOStar
# object creation AOStar(adjacency_list -> dictionary, heuristic_values -> dicitonary, startNode)
# call apply_AOStar method
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
heuristicsearch-0.0.5.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for heuristicsearch-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b353f0f0eab5cee0e7840a42dc3dd143462a331be46d338992e99d6025d0a5b |
|
MD5 | b276c2c723106094fbf4dc41dd096dab |
|
BLAKE2b-256 | 5ff3c2b5cb1c1cfb65170e1c4bc7b06d30e53fffa84470ee9ea983825348d31d |