Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

See http://gamedev.stackexchange.com/questions/46463/is-there-an-optimum-set-of-colors-for-10-players

I think a good solution would be to distribute points in the HSV cone in such a way that they are as evenly spread as possible.

I can calculate the sum of distances for all the points, and the find the maximum, but how to distribute the points?

How to approach such a problem?

share|improve this question
The tag (distribution-theory) refers to a completely dfferent subject. –  Did Dec 30 '12 at 22:35
add comment

1 Answer

up vote 2 down vote accepted

I don't believe there is a general non-numerical solution. One way to do this numerically would be to use simulated annealing or a similar approach. To use this method, you first define a energy function between each pair of points on the cone. For instance you could use: $$d(h_1,s_1,v_1,h_2,s_2,v_2)=\frac{1}{\sqrt{(h_1-h_2)^2+(s_1-s_2)^2+(v_1-v_2)^2}}$$ Then randomly choose 10 points on the cone, and with each step move each point a small random amount, recalculate the total energy, and decide whether you want to keep the new set of points. Continue iterating, and with a correct choice of the annealing schedule, you should converge to the "optimal" solution for the function you chose. This method has been used quite successfully on the Thomson problem, which is quite similar to yours.

share|improve this answer
Nice reference, thanks. This look a lot like the Self Organising Maps that I know from the AI field. I was hoping there was a nice analytical solution.. But your solution will yield a (local?) optimum. –  RobAu Dec 30 '12 at 21:54
It will yield a global optimum (with the right choice of schedule) - that's why simulated annealing is such a good choice :) –  nbubis Dec 30 '12 at 21:59
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.