Article View: sci.electronics.design
Article #1270Re: Puzzles
From: Waldek Hebisch
Date: Sun, 15 Nov 2026 14:13
Date: Sun, 15 Nov 2026 14:13
304 lines
12658 bytes
12658 bytes
Don Y <blockedofcourse@foo.invalid> wrote:
> On 11/14/2026 9:08 PM, Waldek Hebisch wrote:
>> Don Y <blockedofcourse@foo.invalid> wrote:
>>> On 11/12/2026 8:15 AM, Waldek Hebisch wrote:
>>>> Don Y <blockedofcourse@foo.invalid> wrote:
>>>
>>>>> Which got me thinking about how you would dynamically create such a puzzle,
>>>>> given that it would have to be solvable (algorithmically, not just by chance).
>>>>
>>>> AFAIK all Sudoku puzzles are algorithmically solvable, that is you
>>>> can check if there is a unique solution (and find a solution when
>>>> it exists).
>>>
>>> That doesn't make for an *engaging* problem.
>>>
>>> At one end of the spectrum, I can put three numbers on the grid and
>>> leave the rest to the "player". A multitude of possible solutions
>>> so their efforts are largely just time consuming with very low level
>>> of reasoning.
>>>
>>> At the other end, I can populate the grid *slectively* such that only
>>> one solution is possible.
>>>
>>> Yet, if arriving at that solution involves "taking a guess" at
>>> any stage (because you can't deterministically rule out particular
>>> candidates), then it is far less fulfilling as you can "guess"
>>> wrong and then have to backtrack to that point to "make the other
>>> choice".
>>>
>>> Here is just such a puzzle:
>>>
>>> --7-1-2-5
>>> --6----7-
>>> 9----7--1
>>> -3----8--
>>> --27---1-
>>> 8-135-7-6
>>> ----9613-
>>> ---------
>>> 2---3---8
>>>
>>> You can unambiguously deduce every step in the completion of the grid
>>> up to this point (spoiler alert):
>>>
>>> --7-1-2-5
>>> --6----7-
>>> 9----7--1
>>> 73----8--
>>> --27---1-
>>> 8-135-7-6
>>> ---296137
>>> xx3-7----
>>> 279-3---8
>>>
>>> [I *think* this is the most resolved the puzzle can become but haven't
>>> spent more than a few minutes examining its current state]
>>
>> One can easiliy deduce more:
>>
>> --7-1-2-5
>> --6----7-
>> 9----73-1
>> 73----8--
>> --27---1-
>> 8-135-7-6
>> ---296137
>> --3-7----
>> 279-3---8
>
> --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
At this point I have a lot of extra information, but I do not
know if this information is enough to find next square
(my single guess was made at this point). Solver tells me
that starting from this it still needs 2 decisions, when
I give it the next (guessed) state it say that it needs
1 decision. So simple propagation will not work, but
more complex rules may work (as apparently happens with
the second decision point, which solver needs, but I do
not need).
> And, have to carefully consider WHERE you make that guess
> if you don't want to end up having to make ANOTHER guess.
>
> I don't consider puzzles that rely on guesswork to be
> particularly appealing as you can rationalize not doing ANY
> deductive work and just guessing at the whole thing!
Well, if you are too eager to make guesses, then you are
likely to spend a lot of time pursuing wrong paths.
Consequently, you are unlikely to find solution in
reasonable time.
>> and several steps beyond that. As one point I did a binary
>> guess, I guessed correctly and after that I got a solution.
>>
>> Actually, at later step I made a mistake, so I tried the
>> other possiblity which led me to contradiction. Consequently
>
> Exactly. But, then you have to "backup". Easy for a machine
> algorithm but a lot harder to do "in your head"
I was not doing it in my head. I have kept copies of
the state after making a move (or a few if they were
obiously related). I did it in a computer file, but
the same would also work on the paper (given sufficient
supply of scratch paper). So backtracking itself is not
hard. The problem is amount of work you need to do
if you backtrack too eagerly.
>> I suspected that this may be a "bad" sudoku, without
>> solution. But I created a solver and it found solution.
>> Comparing I fund place where I made an error and restarting
>> from this place I got solution.
>
> IME, all of the puzzles have been solvable. But, often require
> a guess.
>
> Minesweeper is similarly annoying as some puzzles resolve to a
> point where you can't unambiguously determine the next "safe"
> square.
I think it is supposed to be a feature. If you make too many
guesses you will sooner or later hit a mine and loose. Minimizing
guesses siginficantly increases chance of winning.
> This is disappointing as you've invested time and been screwed through
> no fault or deficiency of your own.
Goal of creators usually is not pure satisfaction of users.
Rather, they want you to come for more. If you win every
time than you will quickly become bored. OTOH "I almost
made it" encourages another trial.
There is old puzzle of 15. You have 4 by 4 grid and movable
squares with numbers from 1 to 15 fitted into it. One
square is empty and you can move any neighbouring movable
square into the empty position, in effect exchanging empty
square with one of the neighbours. The goal it to put
squares in order. But there are to classes of positions,
one class which can be ordered and the second one where the
best you can do is to get at distance of one exchange to
the ordered state. Apparently, all puzzles are sold in
unsolvable position. OK, all such puzles (a few) that I
got in my hand were in such state. One can disassemble
the puzzle and put it back in another state, but I doubt
the users did it. Rather, I think that manufacturers
decided that they can sell more selling them in unsolvable
state.
>>>> 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
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.
>>>>> Which got me thinking of the tougher problem: creating a *crossword* from
>>>>> scratch! Without just relying on an exhaustive attempt to paste words from
>>>>> a (constrained) glossary onto a grid.
>>>>
>>>> AFAIK modern version of exhaustive search are much more efficient
>>>> than naive versions. I do not think that reasonably sized crossword
>>>> abd glossary would be a problem for them.
>>>
>>> You don't do an exhaustive search as you have the same "clues" that a
>>> crossword solver would have.
>>>
>>> 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 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.
--
Waldek Hebisch
Technical Details
Message-ID:
<11dcen5$1ku24$1@paganini.bofh.team>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!paganini.bofh.team!not-for-mailReferences:
<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>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.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: Sun, 15 Nov 2026 14:13:59 -0000 (UTC)
Organization: bofh.team Usenet service
Message-ID: <11dcen5$1ku24$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>
Injection-Date: Sun, 15 Nov 2026 14:13:59 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="1734724"; 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