/Astar-and-Uniform-Cost-Search

Search Algorithms to find least cost path in a graph

Primary LanguageJupyter Notebook

Open In Collab

A* Search and Uniform Cost Search

A* Search and Uniform Cost Search are graph traversal and path search algorithms. Starting from a specific starting node of a graph, both algorithms aims to find a path to the given goal node having the smallest cost (least distance travelled, shortest time, etc.). Both the algorithms are implemented in Python

The sample input contains the start_node, end_node, the costs and the heuristics. Change this input list to put in your custom graph

sample1=[['A','B',60,315],['A','C',125,315],['A','E',115,315],['B','C',130,340],['E','F',60,195],['F','G',55,210],['G','H',90,160],['C','D',90,210],['C','G',70,210],['D','I',150,150],['H','I',85,70]]
sample2=[['S','A',6,17],['S','B',5,17],['S','C',10,17],['A','E',6,10],['B','E',6,13],['B','D',7,13],['C','D',6,4],['E','F',6,4],['D','F',6,2],['F','G',1,1]]