Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 3 4
- 8 0 2
- 7 6 5
- 1, 1
- root board:
- **************
- 1 3 4
- 8 0 2
- 7 6 5
- manhattan = 0
- costFromRoot = 0
- hueristic = 11
- zero position = 1, 1
- **********
- ******************
- whats in priority queue
- 1 3 4
- 8 0 2
- 7 6 5
- end of priority queue
- **************
- top should be
- 1 3 4
- 8 0 2
- 7 6 5
- ^^^top^^^
- board with lowest hueristics
- **************
- 1 3 4
- 8 0 2
- 7 6 5
- manhattan = 0
- costFromRoot = 0
- hueristic = 11
- zero position = 1, 1
- **********
- up move:
- **************
- 1 0 4
- 8 3 2
- 7 6 5
- manhattan = 14
- costFromRoot = 3
- hueristic = 17
- zero position = 0, 1
- **********
- left move:
- **************
- 1 3 4
- 0 8 2
- 7 6 5
- manhattan = 19
- costFromRoot = 8
- hueristic = 27
- zero position = 1, 0
- **********
- down move:
- **************
- 1 3 4
- 8 6 2
- 7 0 5
- manhattan = 17
- costFromRoot = 6
- hueristic = 23
- zero position = 2, 1
- **********
- right move:
- **************
- 1 3 4
- 8 2 0
- 7 6 5
- manhattan = 9
- costFromRoot = 2
- hueristic = 11
- zero position = 1, 2
- **********
- ******************
- whats in priority queue
- 1 3 4
- 8 2 0
- 7 6 5
- 1 0 4
- 8 3 2
- 7 6 5
- 1 3 4
- 8 6 2
- 7 0 5
- 1 3 4
- 0 8 2
- 7 6 5
- end of priority queue
- **************
- top should be
- 1 3 4
- 8 2 0
- 7 6 5
- ^^^top^^^
- board with lowest hueristics
- **************
- 1 3 4
- 8 2 0
- 7 6 5
- manhattan = 9
- costFromRoot = 2
- hueristic = 11
- zero position = 1, 2
- **********
- up move:
- **************
- 1 3 0
- 8 2 4
- 7 6 5
- manhattan = 5
- costFromRoot = 6
- hueristic = 11
- zero position = 0, 2
- **********
- down move:
- **************
- 1 3 4
- 8 2 5
- 7 6 0
- manhattan = 14
- costFromRoot = 7
- hueristic = 21
- zero position = 2, 2
- **********
- ******************
- whats in priority queue
- 1 3 0
- 8 2 4
- 7 6 5
- 1 0 4
- 8 3 2
- 7 6 5
- 1 3 4
- 8 2 5
- 7 6 0
- 1 3 4
- 8 6 2
- 7 0 5
- 1 3 4
- 0 8 2
- 7 6 5
- end of priority queue
- **************
- top should be
- 1 3 0
- 8 2 4
- 7 6 5
- ^^^top^^^
- board with lowest hueristics
- **************
- 1 3 0
- 8 2 4
- 7 6 5
- manhattan = 5
- costFromRoot = 6
- hueristic = 11
- zero position = 0, 2
- **********
- left move:
- **************
- 1 0 3
- 8 2 4
- 7 6 5
- manhattan = 2
- costFromRoot = 9
- hueristic = 11
- zero position = 0, 1
- **********
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement