Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

**Leren****Member**- Registered: 2017-04-19
- Posts: 3

An exhaustive search has revealed that the total number of solutions for the first puzzle (post 1) without any additional constraints is 19,879 and for the second puzzle (post 4) is 140,884.

Leren

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,695

Hi, Leren (Dutch for 'learn'), and welcome to the forum!

Well, that's interesting information! I'd suspected that there would be many more solutions to the OP's puzzle (post #1) than the few that I'd found with the Excel Solver add-in I referred to in other posts, but not as many as that!!!

How did you arrive at that total, and what program did you use?

"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

**Leren****Member**- Registered: 2017-04-19
- Posts: 3

You might have trouble believing this but I just looped through every possible value of all 40 blank cells subject to the given constraints. Now if there were no constraints that sounds like 7^ 40 steps, and even allowing that my

computer runs at about 140,000,000 steps/second, that would take something like 10^18 years. However the constraints reduce this dramatically, so that the whole process only took 470 seconds !

I just use visual basic in Excel, so lower level languages like C++ would no doubt be even faster. The trick is to pick your blank cell loops so that you can use a 30ish cell sum constraint as soon as possible.

I first came across this type of puzzle in a Sudoku forum that I am in, where someone could not solve one of these problems with the first and last rows being completely specified (in addition to the nine 30ish cells).

Well I just love a programming challenge and I looped through the 28 unspecified cells, and found the unique solution in less than perceptible time.

To find other similar puzzles I just did a google search and eventually found this thread, which naturally suggested the 40 blank cell problem which obviously would have multiple solutions.

Offline

**EliTorres25****Member**- Registered: 2017-11-03
- Posts: 4

That's a great idea. The fact he different squares share number columns ads a significant amount of difficulty to those squares.

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,695

phrontister (post #14) wrote:

The standard Excel Solver was missing a constraint functionality I needed that the advanced one has.

EDIT: I had a tiny sniff of success with the standard Excel Solver by scaling the grid down from 7x7 to 5x5. The solver doesn't allow (as far as I could tell) crossing of the 'AllDifferent' constraint (eg, a row crossing a column - because one of them is then treated as not containing all variables, which it must contain), and so I cooked up some workarounds (linear and nonlinear).

Only one 'worked': ie,

- a nonlinear one, with the 'GRG Nonlinear' solving method;

- for one particular scenario only, in which I helped it get started by providing the answers to 4 cells, leaving the other 17 for the solver to find...which it did!

- it failed on all other assignments.

I gave the standard Excel Solver a tweak or 2 and had another go at the 7x7 puzzle from patchy1's first post (without post #24's constraints)...and this time it worked.

The Solver stops computing at the first solution it finds, but, as mentioned in earlier posts, this puzzle has many solutions (both with post #24's constraints and without).

*Last edited by phrontister (2021-08-23 12:14:14)*

"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline