The Student Room Group

Develop python based 8 puzzle problem solver

Develop python based 8 puzzle problem solver which will be used as singed octal to binary
converter. The algorithm must be rearranging the tiles using a Breadth First Search (BFS)
algorithm. In an output print all visited node and 8 puzzle formations of each visited node.
Statement:
Given a 3×3 board with 8 tiles and one empty space. Out of eight tiles, 4 tiles represent binary
number 1, and the rest of the 4 tiles represent binary number 0 as shown in Figure 1. We can
slide four adjacent (left, right, above and below) tiles into the empty space. You have to develop
signed octal to binary decoder. The First row of slider will represent the binary equivalent of
the octal number as given in table 1a, and the second row will represent the sign of octal
number as given in table 1b. Algorithm always starts solving puzzle from initial state as show in
Figure 2. Initial State is considered as parent node for BFS.
For positive (+) sign second row arrangement will be either 001 or 100, and for negative (-) sign
the arrangement will be 010. Last row will consider as “don’t care”.

Quick Reply

Latest