Relative Neighborhood

This component performs the relative neighbourhood graph in a set of points.

When you need to select the neighbors of a point in a set of points, you can choose between different methods such as Delaunay, by proximity… This method is halfway between these two, it returns a subset of Delaunay’s triangulation with a certain filter consistent with the distance between the whole set of points. The premise is that a point p is a relative neighbor of a point q if there is no other point r closer to p and q than they are to each other. For example, a set of agents on a plane want to eat each other, they will evaluate as relative neighbors to all those who can eat it without worrying about those who can eat others before.

This animation is produced by moving each red point towards its relative neighbours.

This connectivity is useful for bio-inspired algorithms, visual computing or pattern recognition. I’ve uploaded it to Github in case anyone wants to optimize it.

RelativeNeighborhood.gha
RelativeNeighborhoodSample.gh

It can be a good addition to GH2.

Sample file requires Anemone.
Graphics made with Squid.

7 Likes