Courses/CS 461/Winter 2006/Darren Iwaki/week 8

From CSWiki

Jump to: navigation, search

[edit] Sudoku

Image:Sudo.jar Image:Input.txt
Image:dsud1.jpg Implemented in Java using GA (Genetic Algorithm)

Input: Program reads in a files called "input.txt" in which a Sudoku puzzle can be stored

Image:dsud2.jpg

Image:dsud3.jpg


Classes:
Image:DSoduko.java - main engine
Image:Dgameboard.java - stores a board and calculates fitness
Image:DPopulationBank.java - stores the possible chromosome strands that could be used to solve the puzzle


Fitness Algorithm

Column Penalty = duplicate in same column Row Penalty = duplicate in same row Box Penalty = duplicate in same box

Fitness = 216 - (Column Penalty + Row Penalty + Box Penalty )


Image:dsud4.jpg