N-Puzzle Problem solver using Python

I completed and submitted my project "N-Puzzle Problem Solver". I wrote it in Python, and it was a lot of fun. I learned about the similarities between Lisp and Python, and discovered why Lisp is so powerful and how quickly things come together once you understand the language.

When solving the N-Puzzle The 15 puzzle (also called Gem Puzzle, Boss Puzzle, Game of Fifteen, Mystic Square and more) is a sliding puzzle. It has 15 square tiles numbered 1 to 15 in a frame that is 4 tile positions high and 4 tile positions wide, with one unoccupied position. Tiles in the same row or column of the open position can be moved by sliding them horizontally or vertically, respectively. The goal of the puzzle is to place the tiles in numerical order (from left to right, top to bottom). problem, I initially tried with no fundamental algorithms, and it was extremely challenging to derive a solution. However, after discovering the strategy of using Manhattan distances Taxicab geometry or Manhattan geometry is geometry where the familiar Euclidean distance is ignored, and the distance between two points is instead defined to be the sum of the absolute differences of their respective Cartesian coordinates, a distance function (or metric) called the taxicab distance, Manhattan distance, or city block distance. The name refers to the island of Manhattan, or generically any planned city with a rectangular grid of streets, in which a taxicab can only travel along grid directions. In taxicab geometry, the distance between any two points equals the length of their shortest grid path. This different definition of distance also leads to a different definition of the length of a curve, for which a line segment between any two points has the same length as a grid path between those points rather than its Euclidean length. on Norvig's site, coding the solution became much more enjoyable. It really gave me a sense of what Toy problem In scientific disciplines, a toy problem or a puzzlelike problem is a problem that is not of immediate scientific interest, yet is used as an expository device to illustrate a trait that may be shared by other, more complicated, instances of the problem, or as a way to explain a particular, more general, problem solving technique. A toy problem is useful to test and demonstrate methodologies. Researchers can use toy problems to compare the performance of different algorithms. They are also good for game designing. AI problems are like.


help needed

hi,

i m amazed to see that in ISSc,this problem (N-puzzle) was a one semester proj and here in my university(Goa university),our teacher has given this prob today told us do this prob till tomorrow.

can u help me ?? i have to do this in C/C++ or JAVA.

thanks

abhi (abhishek.luck@gmail.com)

Anonymous


Re: help needed

Thats one of the toy- AI problems. We started off without the algorithms and tried it as we might think to solve.. I could implement it say in a week, only after the algorithms were known. It was assignment too (or rather class discussion), but I did with some explanation and analysis as a project.

Senthil