Ocean wrote:Modified counting algorithm:
1. Find all locked pairs (type 1), but pretend they do not exist.
2. Make eliminations based on the locked pairs found in step 1.
---- If any new eliminations were done, go back to step 1.
3. Find all hidden singles, but pretend they do not exist.
4. Place the hidden singles found in step 3 and perform eliminations.
5. Increment step counter and repeat from step 1.
a problem with this and a few of the other proposals is that the step counter
is incremented at the end and may miss a bunch of uncounted moves in 2.
still no luck replicating anyone's step counts at any point in this thread
given that consensus was reached for what a step means in the inferior thread
maybe inferior counting can be extrapolated for ulterior and the inevitable
anterior excelsior exterior interior posterior senior threads to follow
motivation: come to an early and general agreement so that algorithms can
be designed to capture future threads like { inferior ulterior }
the basic principle is that the step count must be the same for all isomorphic
representations of a puzzle
this can be achieved by batching (the inferior choice), where all possible moves
at one step are first identified, and then they are applied as a group
alternatives would involve selecting subsets of possible moves, which
could become intractable
inferior step counts are easy
naked and hidden singles are batched
and the application of a batch of moves counts as a step
choices arise when more constraint techniques are added to the mix
first the techniques must be ordered -- easy enough
second, the place to increment the step must be identified
it seems each batch should count as a step, otherwise plugging inferior
requirements into e.g. ocean's modification above would result in 1 step
for all inferior puzzles
so here's the general proposal for step counting
let Ci, 1<=i<=n, be the constraint techniques to be applied in the order 1..n
count the steps leading to a solution by:
- Code: Select all
step = 0
count:
for i 1 .. n
if Ci progresses the solution (makes a placement or candidate elimination)
identify all Ci moves (placements/eliminations)
apply all Ci moves in one batch
increment step
goto count
if no Ci progresses the solution then
either the puzzle is solved or
the puzzle does not meet the Ci constraints
for inferior: n=1, C1=singles
for ulterior: n=2, C1=box-line, C2=hidden-singles