Hello people from Daniweb, nice to meet you!
I am a student and registered today, but I am familiar with these type of sites.
Now to the point of this post.
As I stated I am student, and have an assignment for my AI discipline.(Because of some
circumstances i was not able to attend classes at all and I was not slacing)
What I want to ask is for a tip or a point in the right direction nothing more,
even if I ask please ignore me for some time I have to learn. :)
My assignment is to do a depth bound search with backtrascking for a game(puzzle) called "2n+1".
Atleast that is what my teacher calls it.
We have N black and N white plates(N is the same for both)
placed in a line with one empty place between.
Let's take N=3, B=Black, W=White, so it looks like this: WWW_BBB.
The puzzle is solved when all black plates are on the left of the white plates,
for this example. The blank space is of no concern. Plates can be moved to adjacent
cell if it's free or hop over other plate, the limit of hopping is N-1. The costs
are the number of hopped over plates + 1.
So for my example 2 plates can be hopped over.
STATE COST WW_WBBB 1 W_WWBBB 2 WBWW_BB 3 WBWWB_B is not valid
What I tried:
As I was not limited to what programming language to use I first tried with Java.
But it did not worked. After that a colleague told me that it is easier to use Prolog for this type of problem,
and I focused on this language. The general idea of the language I understand, but there was
another problem. I had two ways to go one was to define all the possible states and let
Prolog find the solution, or define the initial state and few operators and then let Prolog
find the solution. First one is out of the question, the depth and branching is enormous.
I chose to go with the second one. To clarify i've done similar problem before with the language PDDL,
that problem consisted of towns connected with paths and I had to move people and cargo
from one town to another nothing more. And what's more I had
the graph and I had only to define the operators for the Blackbox which it used to
search for the path. I have not done this type of problem(2n+1) before that is why I am asking for some
general idea to what I could do.
Sorry for the long post, but I had to explain.