Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.ai    |    Awaiting the gospel from Sarah Connor    |    1,954 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 607 of 1,954    |
|    Maximilian Wilson to All    |
|    Re: Block puzzle problem and searching    |
|    17 Feb 05 11:28:25    |
   
   XPost: comp.ai.games   
   From: wilson.max@gmail.com   
      
   1. It depends. Is the "puzzle" a visual representation of the problem,   
   or just the problem state? I would do this with a FIFO queue of {puzzle   
   state + how-I-got-here path}. Pull each state off the FIFO queue in   
   turn, test each possible move against an estimator function h^ and if   
   it's not egregiously bad, push it onto the FIFO queue. Stop when the   
   puzzle is solved. (A good estimator might be sum(err(x)) where err(x)   
   is the number of positions block x is away from its "correct"   
   position.) Is this what you mean by a "tree containing the states"?   
   Then, when the puzzle is solved you'd take how-I-got-here and map it to   
   the visual representation of the puzzle.   
      
   2. In a word, yes. Although I'm using a FIFO queue and not a tree.   
      
   3. Eh?   
      
   4. Could use a hash table as well as the FIFO queue and check against   
   it before you insert into the queue.   
      
   Max Wilson   
      
   [ comp.ai is moderated. To submit, just post and be patient, or if ]   
   [ that fails mail your article to
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca