This is one of those, " I wish I had listened better, retained more of my math class info..", questions. I did this with brute force, but I know there's a better more correct way of accomplishing this.
Given a 4 x 4 array of stations, and 8 groups(a-h). How to fill the array with group pair combinations so each pair(ab, ba) occurs only once, and each group occurs only once in each row and column? (If a is part of a pair in 1,1, it can no long appear in a grouping in row 1 or column 1)
Of course not all possible groupings happen.