Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming

Reply
 
LinkBack Thread Tools
Old 07-06-09   #1 (permalink)
Overclocker
 
thealmightyone's Avatar
 
intel ati

Join Date: Jul 2006
Location: York, UK
Posts: 2,478

Rep: 179 thealmightyone is acknowledged by manythealmightyone is acknowledged by many
Unique Rep: 152
Trader Rating: 0
Default Sudoku solver, brute force, where to start?

I've written a sudoku solver in python that used logic methods to solve most, but not all, puzzles. I'm looking to write a guessSolution function to finish off puzzles that the logic methods could not completely solve, but not sure where to start, as I've never written a brute force algorithm before.

If anyone has wrote a brute force solver, how did your functions go about solving the puzzle?
__________________
System: Wolfdale
CPU
E8200
Motherboard
Gigabyte GA-P35-DS3L
Memory
4GB OCZ Platinum
Graphics Card
2900 Pro flashed to XT
Hard Drive
2x Seagate 250
Sound Card
Creative Audigy 4
Power Supply
620W Enermax Liberty
CPU cooling
TR Ultra Extreme
GPU cooling
HR-03
OS
Windows 7 64-bit
Monitor
19" BenQ LCD
thealmightyone is offline   Reply With Quote
Old 07-06-09   #2 (permalink)
4.0 GHz
 
MeeksMan13's Avatar
 
intel nvidia

Join Date: Dec 2008
Location: Dripping Springs/Denton
Posts: 850

Rep: 43 MeeksMan13 is acknowledged by some
Unique Rep: 41
Trader Rating: 1
Default

i had to write one for a course last semester. I'm not familiar with python, but for java, I had the sudoku be a 2d array with 0s as the blanks and generated 3 random numbers- x-coordinate, y-coordinate, and value and used the 3 numbers accordingly. And if it was legal, push the 2d array onto a stack. Then keep going.

It takes forEVER. You may wanna toss in some solving algorithms after guessing some numbers to try and speed it up
__________________
I'm a junior in college, Comp Sci major/math minor, if you wanna talk, send me a pm

The *OFFICIAL* HAF 932 Case Owners Club My HAF 932 Paint Job

Water Cooling (own red, need black)
Click below to show/hide Hidden Text Below!

TFC XChanger 360
1/2" Black Barbs
10' 7/16" Tygon

Bay Res
Apogee XT
Swiftech MCP655 Vario (have top)
Need: $205


Quote:
Once I went out and got drunk. then came home and thought it would be a good idea to overclock enough join the 100% overclockers club. Lesson learned: you CAN'T get to 6 GHz when you're hammered.-pfritzmorkin

System: The Factory
CPU
E8500 @ 4.25 gHz
Motherboard
EVGA 780i FTW
Memory
Patriot Viper 2 x 2 GB PC 8500
Graphics Card
2x GTX 260
Hard Drive
Samsung 750GB 7200 RPM; 300 GB Seagate
Sound Card
Creative X-Fi Platinum w/ FD Bay
Power Supply
OCZ 700w Fatal1ty Edition
Case
HAF 932 (Painted)
CPU cooling
Hyper Z600R (Apogee XT soon)
GPU cooling
Stock
OS
Windows 7 64 bit
Monitor
Acer 22" X223W
MeeksMan13 is offline   Reply With Quote
Old 07-06-09   #3 (permalink)
Overclocker
 
thealmightyone's Avatar
 
intel ati

Join Date: Jul 2006
Location: York, UK
Posts: 2,478

Rep: 179 thealmightyone is acknowledged by manythealmightyone is acknowledged by many
Unique Rep: 152
Trader Rating: 0
Default

Thanks for the reply.

I've just spent the last 10 mins working out how to do it. When I start guessing, I know what the unsolved cells are, and the remaining values each cell can take, which should greatly speed up the guessing process. Hopefully, it will be as easy to code as it was to write.
__________________
System: Wolfdale
CPU
E8200
Motherboard
Gigabyte GA-P35-DS3L
Memory
4GB OCZ Platinum
Graphics Card
2900 Pro flashed to XT
Hard Drive
2x Seagate 250
Sound Card
Creative Audigy 4
Power Supply
620W Enermax Liberty
CPU cooling
TR Ultra Extreme
GPU cooling
HR-03
OS
Windows 7 64-bit
Monitor
19" BenQ LCD
thealmightyone is offline   Reply With Quote
Old 07-06-09   #4 (permalink)
4.0 GHz
 
MeeksMan13's Avatar
 
intel nvidia

Join Date: Dec 2008
Location: Dripping Springs/Denton
Posts: 850

Rep: 43 MeeksMan13 is acknowledged by some
Unique Rep: 41
Trader Rating: 1
Default

Quote:
Originally Posted by thealmightyone View Post
Thanks for the reply.

I've just spent the last 10 mins working out how to do it. When I start guessing, I know what the unsolved cells are, and the remaining values each cell can take, which should greatly speed up the guessing process. Hopefully, it will be as easy to code as it was to write.
good deal. I hope you have better luck than me. I was kinda distracted by trouble with girls when that project was going on so my code got bogged down and barely worked lol
__________________
I'm a junior in college, Comp Sci major/math minor, if you wanna talk, send me a pm

The *OFFICIAL* HAF 932 Case Owners Club My HAF 932 Paint Job

Water Cooling (own red, need black)
Click below to show/hide Hidden Text Below!

TFC XChanger 360
1/2" Black Barbs
10' 7/16" Tygon

Bay Res
Apogee XT
Swiftech MCP655 Vario (have top)
Need: $205


Quote:
Once I went out and got drunk. then came home and thought it would be a good idea to overclock enough join the 100% overclockers club. Lesson learned: you CAN'T get to 6 GHz when you're hammered.-pfritzmorkin

System: The Factory
CPU
E8500 @ 4.25 gHz
Motherboard
EVGA 780i FTW
Memory
Patriot Viper 2 x 2 GB PC 8500
Graphics Card
2x GTX 260
Hard Drive
Samsung 750GB 7200 RPM; 300 GB Seagate
Sound Card
Creative X-Fi Platinum w/ FD Bay
Power Supply
OCZ 700w Fatal1ty Edition
Case
HAF 932 (Painted)
CPU cooling
Hyper Z600R (Apogee XT soon)
GPU cooling
Stock
OS
Windows 7 64 bit
Monitor
Acer 22" X223W
MeeksMan13 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 04:11 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License

Terms of Service / Forum Rules | Privacy Policy | DMCA Info | Advertising | Become an Official Vendor
Copyright © 2009 Shogun Interactive Development. Most rights reserved.
Page generated in 0.10568 seconds with 8 queries