Interessen

Künstliche Intelligenz, Software-Entwicklung, Open-Source und Webprogrammierung. Faible für technische Spielereien, mechanische Tastaturen und Kaffeezubereitung :-)

Demo-Projekte aus dem Bereich Künstliche Intelligenz

vericonf

Produkt-Konfigurator am Beispiel der LKW Baureihe Actros von Merzedes Benz:

http://iqludo-tools.de:8080/vericonf

verimed

Berechnung von Interaktionen zwischen Medikamenten:

http://iqludo-tools.de:8080/verimed

vereakt

Erkennung von möglichen Gefahren durch chemische Reaktionen:

http://iqludo-tools.de:8080/vereakt

Sonstiges

Sudoku (english)

Some time ago I wrote a logic based solver for constraint problems and wanted to see how it performs in comparison to dedicated solutions for harder puzzles like Sudoku. After searching the internet Norvigs article Solving Every Sudoku Puzzle came up quickly. Norvigs Sudoku solver is written in python. Variable ordering, constraint propagation and full house rule are used as techniques. Both, reading and rewriting to Java, was a great joy for me, so I decided to share my version.

Download

sudoku.jar (Sudoku solver, Java sources and classes)

top95.txt (bunch of hard Sudoku puzzles, for testing)

Using and Running Java Sudoku Solver

First add sudoku.jar as library to class path. Than Sudoku puzzles can be solved in Java code as simple as:

Sudoku sudoku = new Sudoku();

sudoku.solve("4.....8.5.3..........7......2.....6.....8.4......1.......6.3.7.5..2.....1.4......");

System.out.println(sudoku.getSolution().toStringGrid());

To use the Sudoku Solver as standalone applicaton just drop into terminal:

java -jar sudoku.jar 4.....8.5.3..........7......2.....6.....8.4......1.......6.3.7.5..2.....1.4......


4 1 7 | 3 6 9 | 8 2 5

6 3 2 | 1 5 8 | 9 4 7

9 5 8 | 7 2 4 | 3 1 6

------+-------+------

8 2 5 | 4 3 7 | 1 6 9

7 9 1 | 5 8 6 | 4 3 2

3 4 6 | 9 1 2 | 7 5 8

------+-------+------

2 8 9 | 6 4 3 | 5 7 1

5 7 3 | 2 9 1 | 6 8 4

1 6 4 | 8 7 5 | 2 9 3


9ms

For testing several selected puzzles can be solved in a bunch. Place top95.txt file from above into the working directory and run:

java -cp sudoku.jar sudoku.Sudoku95

...

That's it, enjoy! :-)