A
Andreas Schmitt
Hi,
I have a small problem here. I put in a paper today, which was basically a
programming project for a
sudoku solver.
I got the programm working without a problem, but somehow the algorithm
isn't running as fast as I thought it would.
I talked to some of my colleagues and they basically told me that their
algorithms were mostly not more complex than
mine. Mostly even more simply, yet their programs solved a certain set of
100 sudokus in under 2 minutes, where
mine needed 15 minutes.
I activated all optimization options, used /O2 in Visual C++ but that only
gave me like 2 seconds less computing time.
I went throught the algorithm over and over and I am sure that it does work
correctly, I put it on 20000 different sudokus
in a file I found and it solved them all in a time of about 1.6 seconds per
sudoku, which is simply not fast enough.
Problem is I don't have any idea why it is so slow, while other programs
which do basically do exactly the same are
doing it so much faster.
Don't missunderstand me, I don't want to get you to help me get more points,
I put the project in already anyway.
It's just that I will only get a score for the project, but no explanation
on why it was so slow and since I am simply
curious on what I did wrong I would appreciate if anyone her could give me a
hint or two.
I will upload the code under the following link so I don't have to put it in
here, since even just writing the functions which
actually do compute the algorithm would still be too much for a post here.
I don't want to short it down though, since I want to show you the actual
code as is so you can find anything
that might be slowing it down too much.
I know looking through all that code is a little work, but I would really
appreciate any help.
Again, my problem is not correctness or how to do it, but how to do it
faster, a lot faster.
Thanks in advance... here's the link:
http://www.wcrevival.de/joker/CSudokuRiddle_cpp.txt
I have a small problem here. I put in a paper today, which was basically a
programming project for a
sudoku solver.
I got the programm working without a problem, but somehow the algorithm
isn't running as fast as I thought it would.
I talked to some of my colleagues and they basically told me that their
algorithms were mostly not more complex than
mine. Mostly even more simply, yet their programs solved a certain set of
100 sudokus in under 2 minutes, where
mine needed 15 minutes.
I activated all optimization options, used /O2 in Visual C++ but that only
gave me like 2 seconds less computing time.
I went throught the algorithm over and over and I am sure that it does work
correctly, I put it on 20000 different sudokus
in a file I found and it solved them all in a time of about 1.6 seconds per
sudoku, which is simply not fast enough.
Problem is I don't have any idea why it is so slow, while other programs
which do basically do exactly the same are
doing it so much faster.
Don't missunderstand me, I don't want to get you to help me get more points,
I put the project in already anyway.
It's just that I will only get a score for the project, but no explanation
on why it was so slow and since I am simply
curious on what I did wrong I would appreciate if anyone her could give me a
hint or two.
I will upload the code under the following link so I don't have to put it in
here, since even just writing the functions which
actually do compute the algorithm would still be too much for a post here.
I don't want to short it down though, since I want to show you the actual
code as is so you can find anything
that might be slowing it down too much.
I know looking through all that code is a little work, but I would really
appreciate any help.
Again, my problem is not correctness or how to do it, but how to do it
faster, a lot faster.
Thanks in advance... here's the link:
http://www.wcrevival.de/joker/CSudokuRiddle_cpp.txt