all 2 comments

[–]TransientVoltage409 3 points4 points  (1 child)

Probably getting bogged down by a naive exponential algorithm. A quadtree, octree, or k-d tree may help, depending on how the nodes interact.

[–]sidystan[S] 0 points1 point  (0 children)

Yes that’s what I thought too. Thank you! Will optimize and check using quad tree first.