Davis plaque method.pptx recombinant DNA technology
Astar algorithm
1. CSCI 6212
Presented by Team Flash
Member: Shuqing Zhang
Yang Cao
Tong Qiao
A* Algorithm
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 1
2. A* is one of the many search algorithm that take an input, evaluates a
number of possible paths and returns a solution.
A* combines feartures of uniform-cost search and pure heuristic search to
effectively compute optimal solutions
A* evaluates nodes by combining g(n) and h(n) f(n) = g(n) + h(n)
f(n) is called evaluation function.
A* is both complete and optimal.
Introduction
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 2
3. f(n) = g(n) + h(n)
f(n) is the estimated total cost of the cheapest solution through n
g(n) gives the path cost from the start node to node n
h(n) named as heuristic function is the estimated cost of the cheapest path
from n to the goal node.
Evaluation Function
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 3
4. Algorithm Process
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 4
Given: A graph of nodes, is start, is goal
Aim: To find out the path from to with the minimum cost
Procedure
1. Create a search graph G, consisting solely of the start node s. Put s on a list called OPEN.
2. Create a list called CLOSED that is initially empty.
3. LOOP: if OPEN is empty, exit with failure
4. Select the first node on OPEN, remove it from OPEN and put it into CLOSED. Call this node n.
5. If n is a goal node, exit successfully with the solution obtained by tracing a path along the pointers from n to s in G.
6. Expand node n, generating the set M of its successors and install them as successors of n in G.
7. Establish a pointer to n from those members of M that were not already in G(i.e not already on either OPEN or CLOSED). Add these members of M to
OPEN. For each member of M that was already on OPEN or CLOSED, decide whether or not to redircet its pointer to n. For each member of M already
on CLOSED, decide for each its descendents in G whether or not to redirect its pointer.
8. Recorder the list OPEN, eitheraccording to some scheme or some heuristic merit
9. Goto LOOP
sn gn
sn gn
5. Find the shortest path from Arad to Bucharest
Example
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 5
11. Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 11
OS {(Timisoara,118, 329), (Zerind, 75, 374),
(Oradea, 291, 380), (Craiova, 366, 160),
(Bucharest, 450, 0), (Bucharest, 418, 0),
(Craiova, 455, 160)}
CS { (Arad, 0, 366), (Sibiu, 140, 253),
(Rimnicu Vikea, 220, 193), (Fagaras, 239,176),
(Pitesti, 317, 100) }
OS {(Timisoara,118, 329), (Zerind, 75, 374),
(Oradea, 291, 380), (Craiova, 366, 160),
(Bucharest, 450, 0), (Bucharest, 418, 0),
(Craiova, 455, 160)}
CS { (Arad, 0, 366), (Sibiu, 140, 253),
(Rimnicu Vikea, 220, 193), (Fagaras, 239,176),
(Pitesti, 317, 100), (Bucharest, 418, 0) }
Construct the path:
Set pointer from each node to its predecessor.
Construct the path start from the goal, then reverse it.
The path:
Arad->Sibiu->Rimnicu Vikea->Pitesti->Bucharest
12. Pseudocode
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 12
1: initialize the open list
2: initialize the closed list
3: put the starting node on the open list (leave its f at zero)
-
4: while the open list is not empty
5: find the node with the least f on the open list, call it “q”
6: pop q off the open list
7: generate q’s successors and set their parents to q
8: for each successor
9: if successor is the goal, stop the search
10: successor.g = q.g + distance between successor and q
11: successor.h = distance from goal to successor
12: successor.f = successor.g + successor.h
-
13: if a same node is in the open list which has a lower f than successor, skip this successor
14: if a same node is in the closed list which has a lower f than successor, skip this successor
15: otherwise, add the node to the open list
16: end
17: push q on the closed list
18: end
14. A heuristic h(n) is admissible if for every node n, h(n) ≤ h*(n), where h*(n) is
the true cost to reach the goal from n.
An admissible heuristics never overestimates the cost to reach the goal
Property: The tree-search version of A* is optimal if h(n) is admissible
Admissible Heuristics
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 14
15. A heuristic is consistent if for every node n, every successor n’ of n generated
by any action a,
If h is consistent, we have
Property: The graph-search version of A* is optimal if h(n) is consistent.
Consistent Heuristics
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 15
h(n) ≤ c(n, a, n’) + h(n’)
f(n’) = g(n’) + h(n’)
= g(n) + c(n, a, n’) + h(n’)
f(n’) ≥ g(n) + h(n)
f(n’) ≥ f(n)
16. The time complexity depends on heuristic function
In worst case of an unbound search space: O(bd)
The time complexity is polynomial,when
Search space is tree
There is a single goal state
Heuristic function meets: | h(x) – h*(x)| = O(logh*(x)), where h* is the optimal heuristic, the
exact cost to get from x to the goal
Time Complexity
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 16
17. A* algorithm
f(n) = g(n) + h(n)
Each step expand the node with lowest value of f(n)
No other optimal algorithm is guaranteed to expand fewer nodes than A*
Dijkstra’s algorithm
f(n) = g(n), as a special case of A* where h(n) = 0
Each step expand all closest unexamined nodes
Can be implemented more efficiently without a h(x) value at each node
Compare to Dijkstra’s Algorithm
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 17
18. Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 18
Conclusion
Advantage:
The A* algorithm is complete, optimal, and optimally efficient among all such algorithms.
Disadvantage:
A* is not practical for many large-scale problems, due to space time complexity is O(bd). That means A*
usually runs out of space long before it runs out of time.
Applications
Network routing
Image processing
A.I path finding
19. Artificial Intelligence: A Modern Approach, third edition by Stuart Russell & Peter Norvig
Principles of Artificial Intelligence by Nils J.Nilsson
https://en.wikipedia.org/wiki/A*_search_algorithm
https://www.ics.uci.edu/~welling/teaching/ICS175winter12/A-starSearch.ppt
http://theory.stanford.edu/~amitp/GameProgramming/AStarComparison.html
http://web.mit.edu/eranki/www/tutorials/search/
Reference
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 19