PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs223] Queue of positions to visit
Date: Wednesday, 15 Apr 2020, 08:55:49


    > Message Posted By: Unknown
    >
    > When we get the initial position, before moving onto the algorithm
    > provided in Note 3, we would have to create a queue of positions that are
    > one move away.

No, the first two lines of the algorithm are

  add the word INITIAL to the queue
  add the triple (INITIAL, NULL, 0) to the search table

You only add the positions that are one move away AFTER you
remove INITIAL from the queue.
=====

    > When doing so, should we be writing code that differentiates between
    > whether the dash is in the corner center, or at the edge of the puzzle?
    >
    > So, for example, if I has 12345678- then before the breadth first
    > algorithm I would create a queue that includes two positions, namely
    > 1234567-8 and 12345-786?

No, as noted above.

--Stan-
PREV INDEX NEXT