8 Puzzle
April 25th, 2009
1 comment
The A* Algorithm represent by 8 Puzzle.
Modify the simple A* from
Different Distance = RouteCount + distToGoal
to
Different Distance = RouteCount + distToGoal – distToInitial
RouteCount = Cost to current state
distToGoal = Estimated cost between possible state with
coordinates (x1, y1) and goal state at (x2, y2)
|x1 – x2| + |y1 – y2|
distToInitial = Estimated cost between possible state with
coordinates (x1, y1) and initial state at (x2, y2)
|x1 – x2| + |y1 – y2|