Bug 384546 - Generated killer sudoku puzzle with multiple valid solutions (ksudoku 1.3)
Summary: Generated killer sudoku puzzle with multiple valid solutions (ksudoku 1.3)
Status: RESOLVED NOT A BUG
Alias: None
Product: ksudoku
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Ian Wadham
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-10 07:08 UTC by Steve Soule
Modified: 2022-11-13 01:44 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot showing the three-solution puzzle. (226.17 KB, image/png)
2017-09-10 07:08 UTC, Steve Soule
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Soule 2017-09-10 07:08:37 UTC
Created attachment 107779 [details]
Screenshot showing the three-solution puzzle.

I've encountered a "killer sudoku" puzzle at the "unlimited" difficulty setting that appears to have three solutions instead of just one.  A screenshot is attached.  "Show Errors" is on, so the already-marked boxes are correct (according to both me and ksudoku).  In the 18-cage in the upper-right corner, '7' can be in any of three boxes, and each leads to a valid solution.  Ksudoku incorrectly considers just one of these three solutions to be valid.  (Please forgive me if I'm wrong and am wasting your time.)
Comment 1 Justin Zobel 2022-11-10 08:51:45 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 2 Steve Soule 2022-11-10 14:50:28 UTC
Your demand that I reproduce the bug is not reasonable, since that would require a random number generator to produce precisely the same values as it did before.
Comment 3 Ian Wadham 2022-11-12 02:37:34 UTC
(In reply to Steve Soule from comment #2)
> Your demand that I reproduce the bug is not reasonable, since that would
> require a random number generator to produce precisely the same values as it
> did before.

@Steve: Not quite true. You can re-enter the cages and the initial clues, using the Enter In A Puzzle and Check buttons on the main-menu screen. A message comes up to tell you how to do that - see also the KSudoku Handbook.
https://docs.kde.org/trunk5/en/ksudoku/ksudoku/interface.html#welcome-screen
Comment 4 Ian Wadham 2022-11-12 03:05:48 UTC
@Steve: I am the author of the puzzle generators and solvers in KSudoku.

My congratulations to you on reaching Unlimited level in Killer KSudoku, but I am sorry, this is not a bug: the puzzle you show in your screenshot does indeed have a unique solution. The Notes you show are correct for normal constraints on rows, columns and 3x3 boxes and they can make cages add up correctly, BUT you have missed one further constraint, which applies to Killer KSudoku cages but not Mathdoku cages. All the digits in a Killer cage must be unique. In the cage with total 23 at top center, there is already a 1, so you cannot have a 1 in the bottom-right cell of that cage. It must be a 2. That forces the cell to its left to be a 7 and then the cage with total 18 must have unique contents. There is only one place its 7 can go. Thanks for the interesting case!
Comment 5 Steve Soule 2022-11-12 15:16:24 UTC
You're right, of course.  I don't know what I was thinking.  I'm sorry for wasting your time.
Comment 6 Ian Wadham 2022-11-13 01:44:31 UTC
Not at all, Steve. No worries. I enjoyed the challenge!

I was also a little worried that I might have left a time-limit in the algorithm that checks that the solution is unique. It runs until all possibilities are exhausted, which could take some time at Unlimited difficulty-level on the machines of 10 years ago. I keyed in your puzzle and KSudoku duly reported a unique solution. So all is OK.