Function to return the maximum trace possible for a sub - matrix of the given matrix
function MaxTraceSub ( mat ) { var max_trace = 0 ; for ( i = 0 ; i < N ; i ++ ) { for ( j = 0 ; j < N ; j ++ ) { var r = i , s = j , trace = 0 ;