Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

breadth-first seach algorithm...

Status
Not open for further replies.

Vizion01

Programmer
Jun 4, 2003
9
0
0
US
Hi,

I'm trying to implement this searching method in C++ but didn't get that far into the code. I have a configuration of a puzzle that is passing in to a solver and from there the solver do the breadth-first search to find the path.I'm using std::deque to store the root but I don't know where to start in the right way.

**Configuration object has a method that change the current state and return a new Configuration state.**

Here's a little code I have wrote:

PuzzleSolver::Solve(Configuration *config) {
deque<Configuration> theQueue;
theQueue.push_front(config);

//left- do I need another queue here

//right - do I need another queue here


}

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top