search algorithmn for 8 puzzles

Hi all, I'm doing a program to implement Depth First Search, Breadth first search, hill climbing and best first search. i do not know how to continue to do the hill climbing and best first search. Another thing is my program will keep on looping if it cannot find the solution (DFS, BFS). anyone can help on this?


  • hi if you solve the looping problem with this program can you please send it to me?
  • i used a if statement to control only. for example if the stack more than 500, exit the loop
  • I've updated the program with new search.
    Please download the latest version.
  • please send to me the latest virsion of this code
  • just click the download button. I've already upload it.
  • sorry I download the latest virsion of this code, please help me i want to enter goal state manually ,then i want to print out the time spent for each search .Then for each itration in each search print out the the numbers remaining in the queue .then print out the largest size of the queue (space complexty) .
  • Sorry. I'm not doing all these. Case closed.
  • please please help me i want only how to enter goal state manually ?
  • Did you try to compile and run my code? It's all inside.
    Make sure you have Visual Studio 2008 with .NET 3.5 SP1 installed and Visual Basic Power Pack 3 installed to compile it.

    To get VS Power Pack :

    * Please go through the coding. It's all inside. Including manual state and log file of generated state. (using the 4 algorithmns I mentioned)

    If you find this post and code is useful please credit :)
  • Thank you very much .I do all of that but when run the program no solution found.
    but when i trace the code i can not find the desired state.
    yes i can generate or manually enter curren states.
    the thing what i want to enter desired(goal) states manually then generate current states then do the search to achive desired goal states.
    please,please help me.I am begining with this and thank you very much again.
  • Please check under frm8Puzzles.cs
    it's set during form load.
  • Thank you very much again . I understand what you mean
    but what i want like this
    suppose that the generate states are
    1 2 4
    0 6 3
    5 8 7

    Then I want to make search to achieve the following goal states

    1 2 4
    5 0 3
    6 7 8

    please help me and thank you very much.
  • just change the value as u like in the desired goal, before form load.
  • thank you very much i want to enter these states by the user please help me
  • Sorry. You need to do it yourself. I wont do any update for this code anymore. It's just very simple modification as I've already provided completed source code. Good time for you to learn. Good Luck.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!