I have to model a chemical phenomenon. To do that, I decided to use a square grid, where I put "bars":
(The bars are represented in green). The grid and the bars can have variable dimensions. The bars can be horizontal or vertical, and the grid is periodic, i.e the first square of the first line is considered just next to the last square of the first line. Also, the number of bars is variable (really variable, I would say from 20 to 200).
My goal is to mimic some "minimization of interactions". Basically, each bar needs to be as far as possible from the others. More precisely, the distance between the green squares needs to be maximal. I need a way to find the best positioning.
But I have no idea how to do that. If the bars were single squares, I guess I would use some kind of brute force, and I would calculate the distance between all the squares for each possibility. But I'm not sure it is the good way, and it's not applicable here, for sure.
Would you have any idea about how to do that ?