the problem is:
given an unsorted NxM integer matrix with all positive numbers, find the largest sum by selecting elements from the matrix under the constrains: if A[i][j] gets selected, then all its 8 neighbors(if exists) can't be selected.
The matrix[i][j]'s 8 neighbors are: matrix[i-1][j], matrix[i+1][j], matrix[i][j+1], matrix[i][j-1], matrix[i+1][j+1], matrix[i-1][j-1], matrix[i+1][j-1], matrix[i-1][j+1]
backtracking solution is trivial, any other optimal approaches?