Is there an Algorithm/Technique that can be used to place items where the spacing between items is at best evenly distributed.
For example I have circles with varying sizes (radius) that can be be placed in a rectangle box (grid) , where the y coordinate is already fixed, and the circles can only be moved horizontally (by varying the x-coordinate). Are there algorithms/techniques that can place the circles evenly.
Here is an example of how they might be initially set, and after processing where those items ideally should end up (note the y-values are fixed).
ATM I am thinking of going through each item individually and calculating the distance from the other items and adding the total distances, for all items. Then running through all the possible possible layouts and using the largest total distance as the optimal layout. But this seems inefficient.
I have heard of Force Directed Layout but it seems overkill for this, and I am not sure if that allows you to fix points in one dimension.
thanks