0% found this document useful (0 votes)
52 views2 pages

IntroIA TP1 en

The document discusses the A* search algorithm, which is used for pathfinding and graph traversals. It finds the shortest path first by considering both the cost of traveling from the start node to the current node (g(n)) and the estimated cost of traveling from the current node to the goal (h(n)). The total cost (f(n)) is calculated as the sum of g(n) and h(n). The algorithm uses two arrays, FRINGE and CLOSED - FRINGE contains nodes not yet examined and CLOSED contains nodes that have been examined. It removes the node with the lowest f(n) score from FRINGE, examines its successors, and adds them to FRING

Uploaded by

Nistor Grozavu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views2 pages

IntroIA TP1 en

The document discusses the A* search algorithm, which is used for pathfinding and graph traversals. It finds the shortest path first by considering both the cost of traveling from the start node to the current node (g(n)) and the estimated cost of traveling from the current node to the goal (h(n)). The total cost (f(n)) is calculated as the sum of g(n) and h(n). The algorithm uses two arrays, FRINGE and CLOSED - FRINGE contains nodes not yet examined and CLOSED contains nodes that have been examined. It removes the node with the lowest f(n) score from FRINGE, examines its successors, and adds them to FRING

Uploaded by

Nistor Grozavu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

TP 1

The A* search algorithm

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.

As a reminder, this algorithm uses the calculation of the following costs:


f(n) = g(n) +h(n)
g(n) : the actual cost path from the start node to the current node.
h(n) : the actual cost path from the current node to the target node.
f(n) : the actual cost path from the start node to the end node.

Question 1. Definitions and properties


1. Give the definition of the optimality of an algorithm;
2. Give the definition of the completeness of an algorithm;
3. Give the Difference between the A* algorithm and the Uniform-cost Search
algorithm;

Question 2. Graph Search


Write the algorithm (pseudo-code) for searching in graphs (Graph Search). You will
need for the implementation of the A* algorithm;

Question 3. The implementation of the A* research method

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.

To implement the A* algorithm, you can follow the following steps.

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.

6: Return the solution

Part B.

1. Apply the A* algorithm on the following graph :

2. Display the parsed nodes as well as the final result.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy