|start | find | index | login or register | edit|
by earl, 6638 days agowhile at the quite amazing REBOL DevCon 2005 (more on that later) viktor and i decided to write some simple sudoku solvers. viktor did so using REBOL, i used DLV. here is what i came up with (more discussion after the code!):
%this relies on a representation of the sudoku "board" as follows:
sudoku problem instances are then described using any amount of
even i myself was surprised at how concise DLV allows to express the problem and how quickly the program was written. i went on to some performance measurements and trying things at the console, answers appeared quickly, but not instantly, even for evil problems. so the thing was at least generally viable (while coding i pondered, more than once, the combinatorical space dlv has to potentially cope with).
if we compare the performance of the DLV solution given above and viktors REBOL solution to the c++ and prolog versions discussed on a TU Wien weblog and Arthur Whitney's K4 version, we get the following timings for "riddle 7":
prolog version: 2 ms (gplc --min-size)* out of competition, slightly different machine (2000mhz athlon xp vs 1800mhz intel pentium-m)
for now, i leave the interpretation of those results up to you. what i personally find very interesting is the performance achieved by the prolog version. that's a compiled program using GNU Prolog's constraint solving capabilities. it would be interesting how implementations using the constraint solving of SWI-Prolog, SICStus Prolog and ECLiPSe [CLP] compare to the results of gnu prolog.
both, gnu prolog and dlv have to solve a constraint-satisfaction problem and both use superficially similar methods to express the problem but seemingly quite different methods for solving it. for me, that definitely warrants more exploration into that area ;)
4 active users
|earl.strain.at • esa3 • online for 8313 days • c'est un vanilla site|