Subj : Re: Knight's Tour Problem To : borland.public.cpp.borlandcpp From : "Daniel Pfeffer" Date : Wed Oct 22 2003 12:00 pm "Johny Walker" wrote in message news:3f95aaa9@newsgroups.borland.com... > Hello Everybody, > > My problem is relatd with Knight's Tour problem. Can anybody please send me > the code of Knights Tour that > Knight goes to each square only once. A systematic approach would be as follows: 1. pick an arbitraty starting point. 2. choose an arbitrary knight's move from the current location. 3. if the move is legal (on the board, and no piece already in that location), place a knight at the new location, update the current location, and go to step 2. 4. if all possible moves from this location have been tried, backtrack one move by removing the last piece in the tour. If all pieces in the tour have been removed, go to step 1. otherwise, go to step 2. The bookkeeping involved is (or should be) elementary. A few simple considerations (left as an exercise for the reader) could speed the search up by quite a bit. Daniel Pfeffer .