Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You should look into constraint satisfaction algorithms and SAT solving algorithms. With these you can encode almost all logic puzzles meant for humans fairly easily. For example for sudoku you just say that each cell contains a number {1..9}, and that all the rows, columns and blocks cannot contain duplicates. This is usually done with a declaration like alldifferent(cell1, cell2, cell3 ..., cell9), where alldifferent is a built-in constraint in any constraint solver worth its salt. These algorithms usually solve the complete logic puzzle in less than a millisecond.

Note that these are algorithms for combinatorial logic problems/puzzles, not for searching game trees.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: