SuDoku
-
- DBB Fleet Admiral
- Posts: 2367
- Joined: Thu Jun 14, 2001 2:01 am
- Location: Israel
Both, depending on how much time you're willing to spend. I'd write a recursive algorithm that builds a pattern tree.
Without any optimisations, you just generate the entire tree and pick the solution. However, I'm sure you can optimise by severely cutting away subtrees which you know won't yield a solution. For instance, when you write any given number in any given space, you know it can't come up again in the same column nor the same row. That's one fifth of the subtree you can toss out the window on each level of recursion.
Etc. etc. I'm bored
Without any optimisations, you just generate the entire tree and pick the solution. However, I'm sure you can optimise by severely cutting away subtrees which you know won't yield a solution. For instance, when you write any given number in any given space, you know it can't come up again in the same column nor the same row. That's one fifth of the subtree you can toss out the window on each level of recursion.
Etc. etc. I'm bored

- TheCops
- DBB Fleet Admiral
- Posts: 2475
- Joined: Sat Oct 05, 2002 2:01 am
- Location: minneapolis, mn
- Contact:
oh, no wonder you so damn funkay.Tricord wrote:Both, depending on how much time you're willing to spend. I'd write a recursive algorithm that builds a pattern tree.
Without any optimisations, you just generate the entire tree and pick the solution. However, I'm sure you can optimise by severely cutting away subtrees which you know won't yield a solution. For instance, when you write any given number in any given space, you know it can't come up again in the same column nor the same row. That's one fifth of the subtree you can toss out the window on each level of recursion.
Etc. etc. I'm bored
- TheCops
- DBB Fleet Admiral
- Posts: 2475
- Joined: Sat Oct 05, 2002 2:01 am
- Location: minneapolis, mn
- Contact:
Not too well actually... normally the spring starts out with a bang (heh). But no caulk uses this spring as of yet. Itâ??s really sad, I wish I were married and could have a submissive piece of meat do my dishes. But you know, Iâ??m working it out.Dedman wrote:Hey Copsy, hows that caulk doing?
/hijack
One of my oldest friends is a fitness freak, clown, army brat and he is kickin my arse into shape. Itâ??s amazing what less than a month can do to this mortal coil.
You may laugh, but Iâ??m doing 4 sets of 15 reps army push ups and 2 sets of 15 standard crunches and 2 sets of 15 reverse crunches a day. Every week and a half I add an additional 5 reps. Not bad for a skinny rock n roll kid.
If you want you can email me or PM me... but I assume your are publicly making fun of me... which you will always fail at because Iâ??m the most self-deprecating person I know.