I want to place the boxes in a top box. The area of the boxes are fixed. Also the shape will be rectangular. But the width & height can change. Also there will be connections among the boxes. The more connection, the more near that boxes' CG should be.
cvxopt library can be used. Please refer below link for that.
[url removed, login to view]
Algorithm is attached. (Can be changed if needed)