I am working now on search using Simulated Annealing and the function that estimates states can be expressed in an array of symbols as ("-1" means a black ball on the board, "0" - gap on the board, "1" - a white ball on the board). Initially balls located like this: "-1,-1,-1,-1,0,1,1,1" and the goal state is to reach sequence of "1,1,1,0,-1,-1,-1,-1". Cost of each transformation is 0 (zero). I need to know the algorithm that gives a coefficient of how close each successive state to the goal state. It will be used in the Simulated Annealing processing to select the best state. I suppose it's like an "ordinal hash code" of sequence, in sense that I can compare the codes to select the best one.
What I have tried:
Tried string comparison algorithms, but they don't fit to this case