🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: sci.electronics.design
Article #1404

Re: Puzzles

#1404
From: Waldek Hebisch
Date: Fri, 20 Nov 2026 19:05
271 lines
12098 bytes
Don Y <blockedofcourse@foo.invalid> wrote:
> On 11/15/2026 7:13 AM, Waldek Hebisch wrote:
> 
>>> --7-1-2-5
>>> --6----7-
>>> 9----73-1
>>> 73----8--
>>> --27---13
>>> 8-135-7-6
>>> ---296137
>>> --3-7----
>>> 279-3-6-8
>>>
>>> But, at that point, you have to make a guess.
>> 
>> No, I can get at least to:
>> 
>> --791-265
>> --6----7-
>> 9----7381
>> 73----8--
>> --27---13
>> 8-135-7-6
>> --8296137
>> --3-7----
>> 279-3-6-8
> 
> The difference between your state and mine resolves to:
> 
> ---9---6-
> ---------
> -------8-
> ---------
> ---------
> ---------
> --8------
> ---------
> ---------
> 
> suggesting you deduced one of these moves could be reasoned
> from the current state of the solution WITHOUT GUESSING.
> I don't see that to be the case (but, if I am wrong, you can
> indicate which was the "next" move that you reasoned after
> my state).

I made a mistake in my reasoning, so my movements were not
fully justified.  I created a propagation program and it
get to the point but can not move beyond what you get.
This is probably not most powerful propagation program,
but I doubt that better normal propagation rules would
help.

OTOH one can claim that single binary decision is rally not
guessing.  Several so called "advanced strategies" look for
promising places subject to binary decision and egzamine
consequences of both alternatives.  More precisely, for
each square of the grid one notes possible numbers in this
square.  When trying one alternative you propagete info
getting tightened possibilites.  Then you try the second
alternative and propagate info.  Then you form logical
sum of the two alternatives.  If it is more restrictive
then the starting state you made a progress.  Different
advanced strategies differ in their choice of decision
and on amout of propagation that is performed.  In a
sense ultimate advanced strategy would try any
possible binary decision and fully propagate consquences.

The case when sudoku is solved by propagatin after a
single decision is just a simple case of advanced strategy.
In general, after making progress you need to continue
with solution process.  Note that whan using advanced
strategies you temporarily have two candidates for
partial solution, but never more than two.  IIUC
published hard sudokus are usually not solvable just
using normal propagation, you are supposed to use
some advanced strategy, possibly multiple times.
I think that there exist sudokus that are not solvable
by any advanced strategy like above (that depending
only on binary choice).

So gessing (or recursive search) is really needed when
you need to deal simultaneousy with larger number of
possibilities.
<snip> 
>>>>>> So you may simply generate random sudoku and reject
>>>>>> ones that do not have unique solution.  Slightly harder may
>>>>>> deciding how hard given sudoku is for people (you do not want them
>>>>>> too easy, but also you do not want ones that only computer
>>>>>> can solve).
>>>>>
>>>>> Exactly.  What *criteria* does an algorithm use to create a puzzle
>>>>> of a given complexity?  How do you even MEASURE the compleity?
>>>>> Is it simply a matter of the number of prefilled squares that are
>>>>> presented to the player?  Or, do the *choices* of those squares
>>>>> significantly impact the difficulty level?
>>>>
>>>> I would say that difficulty depends on complexity of algorithm
>>>> needed to solve it.  Basicaly anybody can to simple
>>>> propagation, if it leads to solution, then the sudoku is
>>>> easy.  If more complex propagation rules are needed, then
>>>> it is harder.  People seem to be quite reluctant to
>>>> systematically check alternatives, but if number of
>>>> alternatives is small, than IMO the sudoku is stil
>>>> reasonable.  Of course, people that know only simple
>>>> propagation may be forced to check alternatives in
>>>> cases where better propagation rules would lead to
>>>> unique possibility.
>>>
>>>
>>>> Number of prefilled squares determines number of squares
>>>> to fill, so in a sense amount of work, but otherwise
>>>> I do not think that corelation with difficulty is
>>>> very strong.
>>>
>>> But, as this program has difficulty levels, it has used
>>> SOME criteria to determine how to create suitable puzzles.
>> 
>> As I wrote, you can judge difficulty based on rules
>> needed to solve it and beyond that by number of decision
> 
> I suspect the criteria actually implemented aren't that sophisticated;
> more probably, "reveal X cells" where X decreases with difficulty
> (providing less deductible constraint for the player)

You can look at:

https://www.sudokuwiki.org/Sudoku_Creation_and_Grading.pdf

It claims approach that I suggested.  Also older systems
like 'serate' claim to use method of this sort.

>> points.  Concerning methods, in several situations random
>> generation works well to produce varied objects.  You
>> may need to think about good distribution, for example
>> I use random generation of expressions, but my first
>> attempts tended to produce expressions with undesirable
>> characteristics.  Later, I learned about better
>> distribution.
>> 
>>>>> Or, is it easier to just PREcompute the set of potential puzzles
>>>>> using symbolic representations of the numbers, select one at
>>>>> random, apply rotation/flip transforms to further "randomize"
>>>>> it and then bind digits to the symbols??  If the number of such
>>>>> "templates" is small, then simply storing them might be more
>>>>> efficient than generating them.
>>>>
>>>> I am not sure how much effort is needed for generation.  Solver
>>>> solves your one in less than 2ms.  Similarly, starting from
>>>> empty square (of course in such case there are multiple
>>>> solution, but solver produces just one of them).  So, one
>>>> can make several solution attempts, changing candidate
>>>> sudoku for better properties and still have subsecond
>>>> generation time.
>>>
>>> The issue is identifying the criteria that one can use to
>>> determine "deterministic" solvability when *creating* the
>>> puzzle.  With a crossword, it is obvious that a created
>>> puzzle is solvable because you created it in its solved state
>>> and the clues are supposedly correctly associated with each
>>> entry.
>> 
>> I am not sure why you repeat "when creating".  You can
>> generate first and discard bad ones later.  Or, if that
>> is too expensive you can mutate generated bad case till
>> it is satisfactory.
> 
> It seems the best approach is to generate a solution and
> then decide how much of it to *reveal* to the player,
> based on his level of difficulty.  After all, you have
> to be able to generate *a* solution for the puzzle.

Maybe.  The paper above claim approach of this sort.
But usual convention seem to be to pubish minimal sudokus,
that is when you remove any of the clues then solution
is no longer unique.  It seems that when you try to
build easily solvable sudoku you may get stuck with
nonminimal sudoku that can not be turned into easily
solvable one with smaller number of cues.  So you
probaly need either recursive search for easily
solvable ones or generate randomly and filter on
difficulty.

>>>>> E.g., weed out all words that are shorter or longer than the shortest
>>>>> unsolved clue (repeat throughout the solving stage).
>>>>
>>>> I am not sure what you want to say here.  Of course you need
>>>> some lingustic knowledge in form of word list and for each
>>>> word you need possible questions/clues.  You may wish some
>>>> form of semantic markup if you aim at specific theme.
>>>
>>> The mechanistic way of fitting words to a grid is easy.
>>> There are optimizations you can use to keep pruning the list
>>> of available "candidates" to place into the puzzle.
>>>
>>> But, the harder problem is how those words map back to their
>>> clues.
>> 
>> I suppose that this is done via precomputed table.  I guess
>> that in old times crossword makers had a list of words,
>> maybe as explict set of cards, maybe implicity as content
>> of dictionaries and similar works on their bookshelf.
> 
> In an automated solution, I would just tag each word with
> criteria that the "designer" could use as filters.
> 
> E.g., "baseball" seems a common theme in many crosswords
> that I've solved.  So, I would tag words associated with
> baseball with "#baseball" and would bias the algorithm to
> select those over "non-baseball" words.

Yes, I was thinking of marking of similar sort.

> The actual clues associated with each word would be more difficult
> to predefine as the theme can let you bias the clues to make
> the solution easier or more difficult (at your perogative).
> 
> But, I think -- given a completed grid -- a human could exploit
> his creativity to fabricate an appropriate set of clues, having
> the "fitting" already handled for him.
> 
>> In modern times you could try to create needed table using
>> data mining combined with available language resources like
>> WordNet.
>> 
>>>   The crossword app in the Nook lets you choose
>>> difficulty level, themeless, etc.
>>>
>>> Some of the difficulty lies in creating ambiguous clues;
>>> clues that suggest one word but actually mean another
>>> (often playing on different parts of speech, etc.)
>> 
>> I guess now LLM could help with this, but in the past this
>> probably needed human work.
>> 
>>> But, when you want to tie the clues (and solution words)
>>> together in a theme, that limits the clues you can offer
>>> and the words to which they reduce.
>>>
>>> I don't see an easy way to impose these criteria
>>> algorithmically.  How do you decide on a theme?  How
>>> do you rationalize a solution as being consistent with
>>> that theme?
>> 
>> AFAICS this is play with probabilities.  I the past humans
>> would provide marked data, now there are data mining
>> techniques and LLM-s.  Doing this needs a lot of raw
>> data and a lot of compute power, so an app almost
>> surely uses precomputed tables.
> 
> Humans are needed to create ORIGINAL puzzles -- themes
> that may not have been tried, word combinations, etc.
> (when I was a kid, crosswords were prohibited from having
> anything more than single word answers)
> 
> And, to create "cleverer" clues that rely on puns, etc.
> instead of simple dictionary definitions.

I suspect that now relativly small LLMs can do this.  After
all that is really core functionality of LLMs, they produce
text that is likely in context of earlier text.  So if
you provide a few examples and a word, then LLM should be able
to produce new clue fitting to the word and to the style
and theme of earlier example clues.

Now, if you do _not_ want accidental puns and want strict
adherence to scientific knowledge, then it get more
tricky.  Also, censorship to avoid racist/sexist content
looks tricky.

-- 
                              Waldek Hebisch
Technical Details
Message-ID: <11dq5ld$37h31$1@paganini.bofh.team>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!paganini.bofh.team!not-for-mail
References: <11ctgil$1ll56$1@dont-email.me> <11d4l69$nmdf$1@paganini.bofh.team> <11d5h3q$clc0$1@dont-email.me> <11dbb79$1j1jt$1@paganini.bofh.team> <11dbhfm$2hd3d$1@dont-email.me> <11dcen5$1ku24$1@paganini.bofh.team> <11dirs3$tunv$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!paganini.bofh.team!not-for-mail
From: antispam@fricas.org (Waldek Hebisch)
Newsgroups: sci.electronics.design
Subject: Re: Puzzles
Date: Fri, 20 Nov 2026 19:05:19 -0000 (UTC)
Organization: bofh.team Usenet service
Message-ID: <11dq5ld$37h31$1@paganini.bofh.team>
References: <11ctgil$1ll56$1@dont-email.me> <11d4l69$nmdf$1@paganini.bofh.team> <11d5h3q$clc0$1@dont-email.me> <11dbb79$1j1jt$1@paganini.bofh.team> <11dbhfm$2hd3d$1@dont-email.me> <11dcen5$1ku24$1@paganini.bofh.team> <11dirs3$tunv$1@dont-email.me>
Injection-Date: Fri, 20 Nov 2026 19:05:19 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="3392609"; mail-complaints-to="usenet@bofh.team"; posting-host="d028f9ad2fa2c51f22dbfed0d81d7daf"; posting-account="69e66f1681224ab92235b464ce7a90b6"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
X-Postfilter: Postfilter-NG 2026.10.2