- Accidental implementation (Expected was heuristic approach)
- Simple logic/no big deal.
How it works:
- Given an array(1-D) as initial state (Must be of len=16).
- Check whether goal state is reachable.
- Find the position of empty None block.
- Enlist possible moves.
- Find the cost of each move.
- Apply move with the minimum cost.
- Repeat 4,5,6 until goal state is found.
- Algorithm moves on the basis of current possible moves (no track/record).
- Moves with no/same minimum cost ends to repetition.
- Repetition is somehow solved using randomness but complicates the problem.