This is a problem I have formulated myself during some research I am undertaking, however, I am an engineering student and dont have the mathematical prowess to solve it. I have been attempting to use several heuristic methods such as genetic algorithms, and have come up with some ok results but I thought I would put it out there to see if anyone had some pointers or ideas about an analytical solution.

I have typed up the problem... if anything is unclear, and you are willing to help out just ask and I'll attempt to make things clearer.

Any thoughts or ideas would be greatly appreciated!

NOTE: n does not have to be general, taking any specific value such as n=8 would be fine.