Documente Academic
Documente Profesional
Documente Cultură
Artificial Intelligence
Lecture 1 Problem Solving A*
Fall 2015
fang.liu@hust.edu.
Outline - Lecture 02
Problem Solving
Search
Graph Search - Review
Heuristic Search
State Space
Discussion: Where is the intelligence in searching
Problem Solving
Introduction to Artificial Intelligence
Problem Solving
Path Finding
Task of the agent is to find a Sequence of Action
Definition of a Problem
Initial State
RESULT(s, a) s
GOALTEST(s) F | T
PATHCOST(path) n
(s : state)
(s: new state)
Search
Introduction to Artificial Intelligence
Heuristic Information
f=g+h
g(path) = path cost
h(path) = h(s) = estimated distance from current node to the goal
A* Search
Open: Arad(0+366)
Close:
A* Search
Open:Sibiu(393)
Timisoara(447)
Zerid(449)
Close: Arad(366)
A* Search
Open: Rimnicu(413)
Fagaras(415)
Timisoara(447)
Zerid(449)
Oradea(671)
Close: Arad(366)
Sibiu(393)
A* Search
Open:Fagaras(415)
Pitesti(417)
Timisoara(447)
Zerid(449)
Craiova(526)
Oradea(671)
Close: Arad(366)
Sibiu(393)
Rimnicu(413)
A* Search
Open:Pitesti(417)
Timisoara(447)
Zerid(449)
Bucharest(450)
Craiova(526)
Oradea(671)
Close: Arad(366)
Sibiu(393)
Rimnicu(413)
Fagaras(415)
A* Search
Open:Bucharest(min(450,41
8))
Timisoara(447)
Zerid(449)
Craiova(min(526,715))
Oradea(671)
Close: Arad(366)
Sibiu(393)
Rimnicu(413)
Fagaras(415)
Pitesti(417)
A* Search
Open:Bucharest(418)
Timisoara(447)
Zerid(449)
Craiova(min(526,715))
Oradea(671)
Close: Arad(366)
Sibiu(393)
Rimnicu(413)
Fagaras(415)
Pitesti(417)
BFS DFS A*
Optimal Solution
Storage
Optimal
Storage
BFS
2n
DFS
Best First
2n
2n
Better than
Best First
A*
A* - Condition
Does the Search stratage f=g+h always
find the optimal solution ?
1 Yes, always.
2 No, depends on problem
3 No, depends on h
A* - Condition
The answer is: 3. depends on h
h(s) should be less than the true cost from s to goal
When A* terminate p is found, and q is any other nodes than p in Open list
According to A* strategy, we have
f(q) > Cp(S->G)
(Cp(S->G) : Cost of p solution)
g(S->q) + h(q->G) > Cp(S->G)
We want to make sure that Cost of p solution is the least cost, i.e.
Cq(S->G) > Cp(S->G)
If we make Cq(S->G) > g(S->q) + h(q->G) then we can say Cq(S->G) ) > Cp(S->G)
Cq(S->G) > g(S->q) + h(q->G)
State Space
Introduction to Artificial Intelligence
Vacuum World
1 two places: A & B
2 clean or dirty for each place
How many states in the state space?
15 puzzle
h1 = the number of misplaced blocks
h2 = the sum of distances each block have to move to
the right position
Discussion:
where is the intelligence?
Introduction to Artificial Intelligence
Smart in A*
Compared to blind search, A* is viewed as intelligence.
It can get to the goal fast.(eg. Compare A* with BFS or Cheapest Cost)
But as we see, the heuristic information h is defined by human being.
The agent does not show the ability of finding the heuristic information.
Is it possible that the agent can find the heuristic information?
Restraint Relaxation
A block can move from square A to square B if (A is adjacent to B) and if (B is blank)
(to relax the restraint)
A block can move from square A to square B if (A is adjacent to B)
h2
h1
Question A*
1
Reading