Hi Guys,
I try to solve this problem:
http://br.spoj.pl/problems/BSUDO/
Using backtracking + bit representation but my solution get TLE
Some idea??
My backtracking function is here:
int linha[N]; //line
int coluna[N]; //column
int box[N];
char A[N+1][N+1];
int mask [] = {
#define B(i) 1i
Can anyone tell me how to write a generic code for any board size of sudoku?
I mean we can write code for a normal 9x9 sudoku board..What about
16x16,25x25...??
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on
can anybody give me the steps you need to check while writing a
program to simulate sudoku
i don't want the exact codejust algorithm would me more than
sufficient.
suggest also the suitable languages for implementing that..VB or
java or any other
--
You received this
I think that Quantum Neural Network is a good choice for sudoku. You can find
some of paper about it at scholar.google.com.
I implemented it by Java and it worked fine :)
On Oct 4, 2011, at 11:21 PM, himanshu kansal wrote:
can anybody give me the steps you need to check while writing a
What could be a good strategy to check if the given Sudoku puzzle is
indeed solvable? Can you think of anything other than actually trying
to solve it and later finding it is not solvable.
Even good ideas for optimizations are welcome.
--Navneet
--
You received this message because you are
Given a n by n matrix. Suggest an algorithm to verify its correctness
given a configuration. User can enter numbers only between 1 to n.
I need this in 2 ways -
1. for the n by n matrix, suggest an elegant way for validating it.
2. suggest a data structure for this sudoku so that the structure
here is the code..
#define bi (i)
#define bj (GRID_SIZE+j)
#define bk (int)((GRID_SIZE*2)+(glb_sqrt*(i/glb_sqrt)+(j/glb_sqrt)))
/*glb_sqrt should be the square root of grid_size (i.e. 3 if its a 9x9
sudoku). */
/* #define bk (int)((GRID_SIZE*2)+(5*(i/5)+(j/5))) */
/*
* This function will
Forgot to mention that you have to fill the bitmap before calling this
routine. This code is the part of the actual sudoku solver code. Here
is the bitmap filling code which is very simple..
void fill_bitmap(int *bmp)
{
int i, j;
for (i = 0; i GRID_SIZE; i++) {
Hi Guys,
I am wondering if you guys have any idea on algorithm used for solving
Sudoku puzzles. In particular if you guys know about any method to
calculate the difficulty level of a given sudoku it will be great. I do
understand that the number of filled in cells alone is not a measure of