Sudoku solver evaluation function
        Posted  
        
            by 
                Rich
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Rich
        
        
        
        Published on 2010-12-23T00:39:31Z
        Indexed on 
            2010/12/23
            0:54 UTC
        
        
        Read the original article
        Hit count: 500
        
Hi,
So I'm trying to write a simple genetic algorithm for solving a sudoku (not the most efficient way, I know, but it's just to practice evolutionary algorithms). I'm having some problems coming up with an efficient evaluation function to test if the puzzle is solved or not and how many errors there are. My first instinct would be to check if each row and column of the matrix (doing it in octave, which is similar to matlab) have unique elements by ordering them, checking for duplicates and then putting them back the way they were, which seems long winded. Any thoughts?
Sorry if this has been asked before...
© Stack Overflow or respective owner