How to evenly distribute sets of evenly-spaced points on a circle?

2.5k Views Asked by At

As part of a larger engineering problem, I need to distribute sets of various numbers of evenly-spaced points on a circle, as evenly as possible.

Each set in isolation needs to be spaced evenly. So a set of two, three, or four points would need its points spaced 180', 120', or 90' respectively. Then, a selection of those sets must be placed on a circle so the resulting superset of points are as evenly distributed as possible.

I don't have a formal math background so apologies if I'm not describing this perfectly, but I hope the following examples clarify what I'm trying to do.

Ex 1: A single set of two points. They need to be spaced evenly about a circle, so place them 180' apart. With no other sets, I'm done.

Ex 2: Three sets: S1 with 3 points, S2 with 2 points, and S3 with 1 point. S1's three points get spaced 120' apart. S2's points get spaced 180' apart. S3 is a single point. Now, how do I place those three sets on a circle so the resulting collection of points is as evenly spaced as possible? I can do this one manually by placing S1's points at 0', 120', and 240'; S2's points at 30' and 210', and S3's point at 300. Visually, this appears to be optimal, although I'm open to arguments that it's not:

enter image description here

However, I don't know how to generalize to larger numbers of sets. E.g. a real example that I'm trying to solve now is two sets of three points, four sets of two points, and one single-point set. Much harder to visually/ manually optimize. I thought at first that the optimal placement would have all points on a set of angles spaced by 360/(least common multiple of the set point counts and the total number of points) = 360/LCM(1,2,3,15)=12 in this case. However, when I tried manually placing on that subset of locations the result was obviously not optimal:

enter image description here

I feel like I get closer to an optimal solution by placing sets starting with the highest point counts, so above I placed the two 3-point sets, then the four 2-point sets, and finally the single-point set. Don't know if there's any validity to this.

The closest existing question I found was: Distribute points on a circle as evenly as possible. That problem starts with a constellation of points already placed, and adds more points, individually. The answer seems to propose that each new point should be placed to maximize minimum interval between the updated superset, which I don't think is correct anyway.

I see a bunch of other questions on math.se concerned with calculating actual coordinates of a single set of N points, which I don't think is directly relevant.

If anyone is aware of or can propose a direct solution to this problem, it would be greatly appreciated.

Also helpful would be input on what metrics would indicate the optimal solution or one solution (set of point placements) being better than another. E.g. comparing two candidate placements of a set of sets, if I calculate the minimum distance between any two neighbors, is the set that maximizes that number better? I think it is, but don't know how to prove that or actually arrive at that placement of points.

Finally, I'm implementing this in code, but I'm more hung up on the math right now which is why I'm asking it here, not on stackoverflow. However, I'd be open to an algorithmic solution, even brute force if that's the only option although it seems like the search space is huge so I expect that would take a long time.