/Heuristic-Search

An example of different searching algorithms mainly heuristic search on different heuristic functions, different cost functions, and different problems

Primary LanguagePython

This is an example of different searches of solutions to problems in different methods, mainly heuristic search and cost based search, The first Map problem is a search through a given map file at: framework\db\tlv_streets_map The second is a MDA search problem which is set through these specific rules, they are described in comments at the .py files and is a delivary problem, we define it as an ambulance delivary and maintainment system where each ambulance has a fixed number of Covid-19 tests it could maintain, has a certain number of test kits it has and it could gather test kits and scatter the tests to given labs, it has to test certain amount of people in different apartments and the goal of the ambulance is to test all people with the described constraints with the lowest cost possible, where this loss could be the total distance (km) that the ambulance has travelled, the total gas payment for the ambulance (which is defined as the payment for distance together with the payment for the storage capabilities of the ambulance) and a loos for the total distance every Covid test has travelled (as those need to be as quickly as possible in the labs).

The program consists of weighted A*, A* epsilon, anytime A* and uniform cost searching algorithms located in: framework\graph_search The heuristic functions for both problems and for different cost functions are in problems\mda_heuristics and problems\map_heuristics in accordance. The search algorithms are usable for every given problem described through a class inheriting from GraphProblemState, given examples are mda_problem and map_problem.