This code can only solve the 3 * 3 matrix:
list = Permutations[Range[9], {9}];
matrix = Partition[#, 3] & /@ list;
answer = Det /@ matrix;
m = Max[answer];
pos = Flatten[Position[answer, m]];
matrix[[#]] & /@ pos
Det[%[[1]]]
But how to quickly and efficiently find the solution in the case of 5 * 5 or even 6 * 6 matrix.
Click on the link to see a specific statement of this problem.
Needs["Combinatorica`"];
n = 3; n2 = n^2; dMax = 0; mMax = {}; p =
Range[n2]; Do[m = Partition[p, n]; d = Det[m];
If[d > dMax, dMax = d; mMax = m];
p = Combinatorica`NextPermutation[p], {k, n2!}];
{dMax, mMax}
The MaximizeOverPermutations
function in this link can't find the exact value of 6 * 6 quickly.
The mathematical method in this article may be beneficial to reduce the amount of calculation:
detM[n_] := n^n (n^2 + 1)/2 ((n^3 + n^2 + n + 1)/12)^((n - 1)/2)
detM[6.]