8-puzzle(A-star)

A* 알고리즘을 이용한 8-퍼즐 (8-Puzzle Using A* Algorithm)

8puzzle

1) 실제 값에 더 가까운 다른 h(n)함수를 정의하여 보자. (Defines a function closer to actual values for different h(n).)

f(n) = g(n) + h(n) g(n): 현재까지의 값, 즉 지금까지 움직인 횟수. (The value so far, that is, the number of moves so far.)

=> h(n): 현재 노드와 목표 노드의 값이 다른 타일을 찾은 개수, 다른 타일의 개수가 같다면 목표 노드처럼 되기 위한 타일의 최소 이동 횟수의 최댓값 (The number of tiles with different values for the current node and the target node, Maximum of the minimum number of tiles moved to be like the target node if the number of other tiles is the same.)

2) 수정된 h 함수를 이용하여 search 트리를 다시 작성하시오. (Rebuild the search tree using the modified h(n).)

search-tree

3) 몇 번 만에 goal 노드를 찾았나요? (How many times did you find the goal node?)

=> 5번 만에 goal 노드를 찾았습니다. (found the goal node in five tries.)

Comments