473,320 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Looking for really hard sudoku puzzles

jkmyoung
2,057 Expert 2GB
Does anyone have some super, super hard Sudoku puzzles?

Back in February this year, I had enough time to finally program a Sudoku solver in Java. Right now, I'm looking for solvable puzzles, but ones that my program cannot solve. However, most hard puzzles in the newspapers are solved within 2-3 cycles so far.

The ones I've found on google which are said to be hard, get solved in 3 cycles.

Any help would be very much appreciated!
========================================
The program works on the possible values for each cell.
1. Determine the possible values in each cell.
2. Check rows. If there is any value in which only 1 empty cell can take that value, set empty cell to that value.
3. Columns.
4. Nonets, (3X3 Squares.)
5. Indiviual cells.
Dec 17 '08
62 12102
JosAH
11,448 Expert 8TB
@NeoPa
That thing is incorrect (see my reply #49); no need to think about it any further.

kind regards,

Jos
Jan 22 '09 #51
NeoPa
32,556 Expert Mod 16PB
I did read it Jos, but I'm afraid I couldn't follow what you were saying :
8,7: 1
9,9: 6
Probably being a little dim, but there you are.

Also, it's nice to follow something through for oneself - hence the request for a separate (complete) solution for me to check through. From that I could highlight the exact spot where a value MUST be wrong.
Jan 22 '09 #52
JosAH
11,448 Expert 8TB
@NeoPa
That's what my little program did for me ;-) at the 8th row, 7th column, the value 1 already exists in the same row (or column or sub-square); same with the value 6 in the bottom right corner.

kind regards,

Jos
Jan 22 '09 #53
jkmyoung
2,057 Expert 2GB
...I shall have to find a better sudoku solver, which isn't blocked at work.
Jan 23 '09 #54
JosAH
11,448 Expert 8TB
@jkmyoung
Why don't you use my solver (see the article section)? You can do with it what you want (except selling it ;-)

kind regards,

Jos
Jan 23 '09 #55
jkmyoung
2,057 Expert 2GB
Perhaps. Was simply using the online solver as a quick reference. Am still stuck on what piece of logic to use and implement to solve puzzle 2.
Jan 23 '09 #56
NeoPa
32,556 Expert Mod 16PB
Good point JK. What I did with this puzzle was to take it to the limit using the algorithm already laid out in the earlier posts (I arrived at the same point as you in post #31 btw).

From there I took a trial-and-error approach. In fact I found that C1 could only be 4 or 8. I tried 8 and found that it couldn't produce a valid solution. Conversely, when I tried 4, it presented me with a unique solution.
Jan 23 '09 #57
JosAH
11,448 Expert 8TB
@NeoPa
So there you took a (manual) back tracking brute force approach, trying to find a solution. You could've used that approach from the start. Humans aren't very good at that but computers are ...

You're trying to solve that puzzle like everyone does: try to find as much of the puzzle by using a systematic approach and when that approach fails, simply search for further possibilities. I don't think that approach can be automated easily because there's (quite a bit) of heuristics involved when to apply the switch in approach: systemematic vs. searching.

kind regards,

Jos
Jan 24 '09 #58
NeoPa
32,556 Expert Mod 16PB
You may be right Jos. Personally I prefer to apply the logic if I can.

As I said before, I don't have the whole algorithm coded in my solver (It was never really designed as a solver per se) so I used the code for what it could tell me, then applied the rest of the algorithm manually (as it was I doing it, the brute force approach would have taken a lot longer and been much less fun). When that still left me short (The only example I can recall where this logic has done so) I used the brute force approach (quite simply as it turned out).

If I ever do take this project on further (unlikely) I think I would prefer to try to appy the logic as specified rather than the simpler brute force approach. Not because it couldn't do the job as quickly, but simply because it would be more challenging and 'fun'.
Jan 25 '09 #59
JosAH
11,448 Expert 8TB
@NeoPa
We're running around in circles this way: there are Sudoku problems that have more than one solution (see my second example, the empty puzzle). No logic whatsoever will give you a single solution because more than one solution is possible. No matter any fun, it won't give you a unique solution when more than one solution is possible unless you either apply some heuristics and 'local search' or you apply a brute force approach. I know these things, I've been there (still in it, sometimes over my head ;-) and done that. Feasibility checks can't help you when more than one solution exist. Local search is too 'narrow minded' to help you out of a multiple choice event and math simply lacks so all that remains is a stupid (not so) brute force strategy (see my old article in the howtos section).

kind regards,

Jos
Jan 26 '09 #60
NeoPa
32,556 Expert Mod 16PB
I see the circles Jos ;)

I guess we can agree to view things from different perspectives huh.
Jan 26 '09 #61
JosAH
11,448 Expert 8TB
@NeoPa
Yup; there's one difference though: I'm right and you're not; there are puzzles that are partially solved that don't have a unique solution (see the empty puzzle) and trying to find one by inferring feasibility rules doesn't make it ;-)

kind regards,

Jos
Jan 26 '09 #62
NeoPa
32,556 Expert Mod 16PB
@JosAH
Of course! How could I have been so blind? :D
Jan 26 '09 #63

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: sub1ime_uk | last post by:
Thought I'd offer a method for solving all possible 9x9 sudoku puzzles in one go. It'll takes a bit of time to run however (and 9x9 seems to be about as big as is reasonably possible before...
5
by: Stewart Gordon | last post by:
I have a few Sudoku puzzles on my site. http://www.stewartsplace.org.uk/mindbenders/ But adding extra columns and rows to separate the 3x3 blocks seems a rather kludgy approach, and the result...
12
by: kalinga1234 | last post by:
hy guys i am having a problem with my sudoku program which i coded using c++.; currently in my program if a duplicate number exist in either row/column/block i would make the particualr square...
4
by: hashimtk | last post by:
Hi, i done a sudoku solving program ,and i got solution for easy sudoku, Can u explain any logic to find out medium and hard sudoku.
10
by: doubleac | last post by:
Hi This is the first time for me asking for help in forums on the net. I hope ill make myself understood. And sorry for my bad english. I have 4 classes: Spelare, Händelser, SpelPlan and Start....
38
by: Boon | last post by:
Hello group, I've been toying with a simple sudoku solver. I meant for the code to be short and easy to understand. I figured "brute force is simple" -- who needs finesse, when you've got...
3
jkmyoung
by: jkmyoung | last post by:
Hey, are there any sudoku experts out there? Can anyone tell me the next step in solving this sudoku and explain it properly? I've used all the rules I can think of but am now stuck. 51--263--...
3
by: Ri0o | last post by:
hi, i have to make a sudoku solver using python quickdraw, i've started on it and this is what i got so far here is the link to the assignment...
1
by: 361162 | last post by:
Sudoku puzzles are made up of the numbers 1-9 arranged in a 9by9 grid, where every number must appear exactly once in every column, row and 3by3 block in order for the solution to be valid. Sudoku...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.