Generate all the permuatations of integers 1..N, and for each such sequence s_1..s_N, calculate the product of the values of the cells M(i,s_i) multiplied by a sign value p(s_1..s_i), which is 1 if i-s_1 is even, and -1 otherwise. Sum all these products.
Postscript
As polygene says, there are inefficient algorithms, and this one is O(N!), since it keeps recalculating shared subproducts. But it's intuitive and space efficient, if done lazily.
Oh, and the sign function above is wrong: P(s_1..s_i) is +1, if s_i has odd index in the sequence 1..N with s_1..s_{i-1} removed, and -1 for even index.