sachin1092 / 8-Puzzle

Solving 8 puzzle using different heuristics like UCS, Misplaced tile and Manhattan distance.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

8-Puzzle

Solving 8 puzzle using different heuristics like UCS, Misplaced tile and Manhattan distance.

Results:


1 2 3 4 x 6 7 5 8

  1. UCS: To solve this problem the search algorithm expanded a total of 9 nodes. The maximum number of nodes in the queue at any one time was 8. The depth of the goal node was 2 The algorithm took 0.938177108765 ms of time.

  2. misplaced tile: To solve this problem the search algorithm expanded a total of 3 nodes. The maximum number of nodes in the queue at any one time was 5. The depth of the goal node was 2 The algorithm took 1.03116035461 ms of time.

  3. manhattan: To solve this problem the search algorithm expanded a total of 3 nodes. The maximum number of nodes in the queue at any one time was 5. The depth of the goal node was 2 The algorithm took 0.50687789917 ms of time.


1 6 2 4 3 8 7 x 5

  1. UCS: To solve this problem the search algorithm expanded a total of 498 nodes. The maximum number of nodes in the queue at any one time was 311. The depth of the goal node was 9 The algorithm took 50.2390861511 ms of time.

  2. misplaced tile:
    To solve this problem the search algorithm expanded a total of 32 nodes. The maximum number of nodes in the queue at any one time was 27. The depth of the goal node was 9 The algorithm took 2.6159286499 ms of time.

  3. manhattan: To solve this problem the search algorithm expanded a total of 13 nodes. The maximum number of nodes in the queue at any one time was 12. The depth of the goal node was 9 The algorithm took 1.09601020813 ms of time.


2 1 3 4 7 6 5 8 x

  1. UCS: To solve this problem the search algorithm expanded a total of 24255 nodes. The maximum number of nodes in the queue at any one time was 14363. The depth of the goal node was 18 The algorithm took 53421.2539196 ms of time.

  2. misplaced tile: To solve this problem the search algorithm expanded a total of 1755 nodes. The maximum number of nodes in the queue at any one time was 1137. The depth of the goal node was 18 The algorithm took 353.48200798 ms of time.

  3. manhattan: To solve this problem the search algorithm expanded a total of 810 nodes. The maximum number of nodes in the queue at any one time was 504. The depth of the goal node was 18 The algorithm took 118.982076645 ms of time.


5 x 2 8 4 7 6 3 1

  1. UCS: To solve this problem the search algorithm expanded a total of 110262 nodes. The maximum number of nodes in the queue at any one time was 45045. The depth of the goal node was 21 The algorithm took 685648.048878 ms of time.

  2. misplaced tile: To solve this problem the search algorithm expanded a total of 5635 nodes. The maximum number of nodes in the queue at any one time was 3364. The depth of the goal node was 21 The algorithm took 2862.04385757 ms of time.

  3. manhattan: To solve this problem the search algorithm expanded a total of 328 nodes. The maximum number of nodes in the queue at any one time was 220. The depth of the goal node was 21 The algorithm took 37.309885025 ms of time.


8 6 7 2 5 4 3 x 1

  1. UCS: To solve this problem the search algorithm expanded a total of 519140 nodes. The maximum number of nodes in the queue at any one time was 73066. The depth of the goal node was 31 The algorithm took 12839346.7379 ms of time.

  2. misplaced tile: To solve this problem the search algorithm expanded a total of 291286 nodes. The maximum number of nodes in the queue at any one time was 64910. The depth of the goal node was 31 The algorithm took 7963164.55007 ms of time.

  3. manhattan: To solve this problem the search algorithm expanded a total of 21167 nodes. The maximum number of nodes in the queue at any one time was 11833. The depth of the goal node was 31 The algorithm took 87512.5479698 ms of time.


About

Solving 8 puzzle using different heuristics like UCS, Misplaced tile and Manhattan distance.

License:Apache License 2.0


Languages

Language:Python 100.0%