C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2720
Number of posts: 5746

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
search algorithmn for 8 puzzles Posted by divinehan on 3 Aug 2009 at 6:41 AM
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?
Attachment: 8_Puzzles.zip (227397 Bytes | downloaded 674 times)
Report
Re: search algorithmn for 8 puzzles Posted by adam20091 on 27 Oct 2009 at 1:51 PM
hi if you solve the looping problem with this program can you please send it to me?
Report
Re: search algorithmn for 8 puzzles Posted by divinehan on 28 Oct 2009 at 5:15 AM
i used a if statement to control only. for example if the stack more than 500, exit the loop
Report
Re: search algorithmn for 8 puzzles Posted by divinehan on 28 Oct 2009 at 5:19 AM
I've updated the program with new search.
Please download the latest version.
Report
Re: search algorithmn for 8 puzzles Posted by adam20091 on 28 Oct 2009 at 8:08 AM
please send to me the latest virsion of this code
Report
Re: search algorithmn for 8 puzzles Posted by divinehan on 28 Oct 2009 at 8:35 AM
just click the download button. I've already upload it.
Report
Re: search algorithmn for 8 puzzles Posted by adam20091 on 28 Oct 2009 at 8:39 AM
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) .
Report
Re: search algorithmn for 8 puzzles Posted by divinehan on 28 Oct 2009 at 9:14 AM
Sorry. I'm not doing all these. Case closed.
Report
Re: search algorithmn for 8 puzzles Posted by adam20091 on 28 Oct 2009 at 10:12 AM
please please help me i want only how to enter goal state manually ?
Report
Re: search algorithmn for 8 puzzles Posted by divinehan on 28 Oct 2009 at 10:45 AM
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 :
http://www.microsoft.com/Downloads/details.aspx?FamilyID=371368a8-7fdc-441f-8e7d-fe78d96d4063&displaylang=en

* 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 :)
Report
Re: search algorithmn for 8 puzzles Posted by adam20091 on 28 Oct 2009 at 10:58 AM
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.
Report
Re: search algorithmn for 8 puzzles Posted by divinehan on 28 Oct 2009 at 11:15 AM
Please check under frm8Puzzles.cs
it's set during form load.
Report
Re: search algorithmn for 8 puzzles Posted by adam20091 on 28 Oct 2009 at 11:34 AM
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.
Report
Re: search algorithmn for 8 puzzles Posted by divinehan on 28 Oct 2009 at 12:20 PM
just change the value as u like in the desired goal, before form load.
Report
Re: search algorithmn for 8 puzzles Posted by adam20091 on 28 Oct 2009 at 12:31 PM
thank you very much i want to enter these states by the user please help me
Report
Re: search algorithmn for 8 puzzles Posted by divinehan on 28 Oct 2009 at 12:35 PM
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.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.