I am generating positions in a randomly fashingrandom fashion. The in
In the game world instanciated, instantiated elements do have a radius, and shouldn't overlap.
The problem is that they will overlap because I use a usual random number generator combined with other fancynessfanciness. I I can't use other random number generation algorithms where I can guarantee that the elements will never overlap.
A way to solve this is to use a spartial datastructurespatial data structure and search for the nearest neightborsneighbors in that tree. When iI insert a Element toan element into that tree i, I update it accordingly.
This solution would do the work and it would be fast but my question is:
Is there a dedicated algorithm without that Tree implementation complexity which is faster than O(n²)
?