page 1 of 1
Comments: 2 | Views: 13803 | Downloads: 316
DoomBringer
DoomBringer
Doom!
I've been taking an AI class, and we had to implement breadth first and depth first searches with the "8 piece puzzle" problem.  (8 piece puzzles are the little 3 by 3 grids with 8 tiles in them, so you can move them around).  I implemented everything in C#, and it is pretty well documented.
Three classes of interest:
PuzzleState: An object representing a state of a 8 piece puzzle.  It generates the child states as well.
PuzzleProcessor: The class that actually performs the searches themselves.  Please note the use of the "closed" node lists... these track the states that have already been considered.
PuzzleMain: the actual starting point.  It sets everything up and goes.

This is a console application with no flashy graphics or whatever.  Although I included a function to make a random starting state, this is undesirable, because solving one of those takes a long time with these searches.

I could go into more detail about the searches themselves, if someone wants.  The only real difference is the underlying data structure.

I'm working on a Java implementation of Genetic Algorithms in solving the "travelling salesman problem".  Hopefully, it works well and I post it here.
Can you help me in understanding the depth- first search. CAn you explain it breaftly so that i can understand it. Please send me the algorithm  & program of depth first search


tnx a lot

I have written a function that searches a node space in a depth first way...

http://www.imunheard.net/programming/c-sharp_depthfirstsearch.htm

p

page 1 of 1
Comments: 2 | Views: 13803 | Downloads: 316
Microsoft Communities