question: public int eval ( INode state ) { EightPuzzleNode node = ( EightPuzzleNode ) state ; int sumDistance = 0 ; sumDistance += node . cell ( 1 , 0 ) - node . cell ( 1 , 2 ) ; sumDistance += node . cell ( 2 , 0 ) - node . cell ( 0 , 2 ) ; sumDistance += node . cell ( 2 , 1 ) - node . cell ( 0 , 1 ) ; sumDistance += node . cell ( 2 , 2 ) - node . cell ( 0 , 0 ) ; return Math . abs ( 16 - sumDistance ) ; }
target:  Eval = g(n) + W(n), where g(n) is length of the path from initial to node n, and W(n) computes difference of opposite cells.