IntroIA TP1 en
IntroIA TP1 en
The A* algorithm is basically an artificial intelligence problem used for path finding (from
point A to point B) and graph traversals.
This algorithm is the advanced form of the BFS (breadth-first search) algorithm, which
searches for the shortest path first than the longest paths. It is a complete and optimal
solution to solve path and tree problems.
This algorithm can be used in a wide range of contexts. The A* search algorithm uses the
cost of the heuristic path, the cost of the starting point and the ending point.
Part A.
For the implementation of the A* algorithm, we need to use two arrays, namely FRINGE
and CLOSED.
FRINGE represents an array that contains nodes that have been spawned but have not
been examined so far.
CLOSED represents an array that contains the nodes that are being examined.
1: First, place the starting node in FRINGE and find its value f(n) by calculating f(n) = g(n)
+ h(n)
2: Then remove the node from FRINGE, having the smallest value f(n). If it is a Goal node,
stop and return SUCCESS.
3: Otherwise, remove the node from the FRINGE list and search for all its successors
using a successor() function for example.
4: Find the value f(n) of all successors, put them in the FRINGE list and put the deleted
node in CLOSED.
5: Go to step 2.
Part B.