This problem is easily convertable to a simple 1d structure (DNA). However, I can't think of a structure/sex concept that makes much sense at all. So simplist asexual way is to generate a DNA array of N integers 1-N, and shuffle it. The first 8 numbers are the people in one row, the next 8 are the next row...
Easist steps with a mutation rate of M (about N/20, but M should be at least 2.) would be:
1 generate 20 random starting DNA (via shuffling the numbers)
2 score each one (count how many connections internally between each set of eight)
3 sort them decreasing by score, and display highest.
4 create a DNA mutation array of N bools.
5 For each element in mutation array, set it to (rand(1, N)>=M). If less than two elements are true, set one or two random ones to true (so at least two are true). [F, f, t, f, t, f, f, t]
6 replace DNA#20 (worst=dead) with one of the top 19 (#20 to be a child of a winner), weighted so that better DNAs are picked more. [4, 2, 8, 1, 5, 7, 3, 6]
7 rotate the elements in the child DNA (#20) who's corresponding element in the mutation array is true. 1->7->6. [4, 2, 8, 6, 5, 1, 3, 7] (if you have duplicate and/or missing numbers in a DNA, bug is probably here)
8 if its a duplicate of anything else in the list, goto 4.
8 score it
9 insert sort it back into the list. If its now highest, print it.
10 goto 4, (infinite loop)
The intent here is to have the top 20 at all times, and each number 1-N should be in each DNA. After testing it, run it for a day or two, and the last line on the screen is your answer.
[Edit]I did think of a breeding concept, but its far slower than the rest. If you add this, you can remove the 2 minimum of the mutation.
These steps go after step 6:
6.1 create breed array of bools, where each i is set to (rand(1,3)==1) (closer to 1-sqrt(.5)=29.289% is best, but 1/3=33.333% is close)
6.2 pick a different DNA from the top 19 (weighted towards the best ranks). I'll call this male, and the one copied to #20 female.
6.3 for each element i where breed array is true, find male[i] in the female's DNA, (we'll call this index j), and swap (i, j) in the female's DNA.
The rand(1,3) does tend toward the father slightly (5/9), but that seems ok, as everyone has equal chance to be mother/father.