Finding Optimal Solution of 15 Puzzle
Finding Optimal Solution of 15 Puzzle
Finding Optimal Solution of 15 Puzzle
of 15 puzzle
B94902062 NTUCSIE
Kai-Yung Chiang
15 puzzle introduction
Searching Algorithm
A* search
Each node has heuristic (the estimating
distance from current state to goal state)
Each nodes evaluation function = heuristic
+ total moves from initial state
A* always expands the fringe node whose
evaluation function is minimum
Example
h=45, f=45
: fringe nodes
Example
h=45, f=45
h=41, f=42
: fringe nodes
h=45, f=46
h=42, f=43
Example
h=45, f=45
h=41, f=42
h=45, f=47
: fringe nodes
h=42, f=44
h=45, f=46
h=42, f=43
h=43, f=45
Example
h=45, f=45
h=41, f=42
h=45, f=47
h=42, f=44
h=45, f=46
h=43, f=45
h=40, f=42
: fringe nodes
h=42, f=43
Pros:
Can find the optimal solution (or admissible) if
heuristic function will never overestimate
Pattern database
Demo
http://140.112.249.168/phpAdmin