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).
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.
]]>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?
]]>Leren
]]>For the original puzzle:
row B = 109
row D = 107
row F = 110col 2 = 104
col 4 = 115
col 6 = 107A7 = 5
G7 = 3That should narrow it down to one solution...
Those constraints still yield multiple solutions, but I don't know how many there are in total.
Here are twelve of them:
]]>
col 2 = 104
col 4 = 115
col 6 = 107
A7 = 5
G7 = 3
That should narrow it down to one solution...
]]>patchy1 wrote:Numbers can't repeat in any given row or column (like sudoku).
That would only apply to the eight odd-lettered/numbered rows and columns, I suppose.
Yes that's right
Row F is one of the six even-lettered/numbered rows and columns, so repeats in that row are allowed.
'4' is also repeated in column 6 of post #12's solution, but as that column is even-numbered, it is allowed too.
]]>No, there's at least one other (see image).
There may be more too, but I can't confirm that as the solver I used is just an advanced version of Excel Solver that looks for an 'optimum solution' (whatever that means). When that is found, the readout says, "Solver found a solution. All constraints and optimality conditions are satisfied."
I've tried to encourage the solver to begin searching from different points, but to no avail...these are the only two it finds. And I'm not sure what caused the solver to look in a different direction to find the second solution.
The standard Excel Solver was missing a constraint functionality I needed that the advanced one has.
https://onedrive.live.com/download?resid=C20C46B976D069EE!3546&authkey=!AIDJZzWJphAYQWM&v=3&ithint=photo%2cjpg
I tried the advanced solver on my post #4 puzzle and got a different result from the one I had. So that one also has multiple solutions.
Hmm...
But 4 occurs twice in F row.
]]>I found another 10 solutions to patchy1's puzzle by changing some optional processing settings, so that makes 12 solutions so far. But I think I'll stop there, as I have no means of proving how many there are, or what they are.
Yes, programming's good for something I can handle and when I can set aside enough time for it - and sometimes I prefer to go that route anyway. Fair enough if a problem's too difficult or time-consuming to do by hand...then I'd happily try to find a solution by any means. And I certainly didn't mind when the advanced solver came up with the answer!
]]>
I meant, are problems that are solved by such means too difficult (etc) to do by hand?
I would say that this problem probably requires a computer, even if you use math the resulting solution would still need a computer to evaluate.
I meant that you have a natural gift for programming, so why seek to do this by hand at all?
Had to use some serious computer assistance, though.
Here is where you should be asking how can I eliminate the part which required human intervention rather than trying to eliminate the computer. But since you are only around 28 years old I will have plenty of time to change your mind.
]]>I like Solver for this puzzle because it's so easy to set up. Once it's in the spreadsheet (fairly quick in Excel) it takes just a few minutes to create the Solver model.
Sometimes you are enigmatic to me.
I don't know what 'Linear programming and Quadratic programming' means. I meant, are problems that are solved by such means too difficult (etc) to do by hand?
I must go now...much to do.
]]>Can these be solved by hand?
Sometimes you are enigmatic to me.
]]>