A Report on Sam's Fifteen Puzzle Problem Solution

Pages: 29 (6044 words) Published: May 4, 2013
Abstract

This report is made to solve sam’s 15 puzzle problem’s solution. The 15 or descending puzzle is usually represent as a 4 * 4 board with strips number from 1 to 15 orderly in mathematical direct from crest left to base right of the board. The object of the puzzle is to rearrange the tiles in this order from any solvable scrambled starting position. A solvable board is one where the start configuration is an even permutation of the solved board. This report describes an algorithm that generates solutions to solvable boards not only for the 15 puzzle, but also for boards of different dimensions. It adapts a divide and conquer approach outlined in Ian Parberry’s paper (1997). Firstly, a brief discussion on the definition and background of the puzzle is offered. An in-depth explanation of what constitutes a solvable puzzle board is presented - an analysis of even permutations, which is fundamental to generating a solvable board, is given. From this, an algorithm to check a permutation for evenness is then illustrated. The adapted algorithm to solve the 15 or (n2-1) puzzle is then presented along with the theory and reasoning behind the adaptation, demonstrating different solution cases depending on where a tile is situated on the puzzle board. Following this, a discussion on special board configurations that cannot be directly solved by the puzzle algorithm is offered. A second report will follow on the steps required to generate the worst case number of moves of a board of a given dimension, which demonstrates that the adapted algorithm solves the worst case board in substantially less moves than the one described in [Parberry 1997]. In the appendix of this report appears each series of moves used in the algorithm to solve a puzzle board.

Acknowledgements :
First and foremost, I would like to address special thanks to my Supervisor , ...........................for his patient guidance, insightful comments and unending support during my research work. My deepest love and affection go to my Mother. She has been an unfailing source of strength during my university studies. I am also very grateful for my family’s encouragement and invaluable moral support during my academic work. I thank Md Rahman for his help during coding and debugging of the testing software and throughout the experiments sessions. I am also deeply grateful to all the people that spent countless hours helping me proofread this text and for their comments and advice. You were more helpful than you may think. Finally, I would like to thank the members of my thesis committee for reading this thesis and providing me with valuable suggestions and comments.

Dedication :

I like to dedicate this Project to my parents, and to my all friends and my well wisher. I also like to dedicate this thesis report to those who will find help next time from this report. Keywords :

System Design, system, working methodology, Virtual Environments, Review on different Algorithm, Market Research.

Content Page :

1.1Introduction

1.2 Even Permutations
1.2.1 Determining a state's evenness
1.2.1.1 Space in its default position
1.2.1.2 Space not in its default position

2 (n2-1) Puzzle Algorithm

2.1 Introduction
2.2 Algorithm
2.3 Putting the first row in position
2.3.1 Placing the first (n-2) tiles in a row
2.3.2 Place tile (n-2) in location (0, (n-1)
2.3.3 Place tile (n-1) in location (1, (n-1))
2.3.4 Completing the end of the row

2.4Putting the first column into position

3 Special Board Configurations

3.1 Special Row Configurations
3.2 Special Column Configurations

4 Conclusion

Appendix

References

1.1 Introduction

The 15 puzzle is traditionally represented as a 4 * 4 board with tiles numbered from 1 to 15 arranged in numerical order from top left to bottom right of the board (called the goal board). However in this report, it is represented as an n * n board...

References: Bird, R. and Wadler, P. Introduction to Functional Programming. Prentice Hall, 1988.
Gardner, M. Mathematical Puzzles and Diversions. Bell, 1961.
Parberry, I. A Real Time Algorithm for the (n2 – 1) Puzzle. Information Processing Letters, Vol. 56, pp. 23-28, 1997.
Schofield, P. D. A. Complete solution of the Eight Puzzle. In Machine Intelligence by N. L. Collins and D. Michie, pages 125-133. American Elsevier, 1967.
Storey, W.E. Notes on the 15 puzzle 2. American Journal of Mathematics, 2(4):399-404, 1879.