Given n points , no three of them are collinear.
i and j , 2 points are friends if the circle formed with i &j as diameter does not contain any of the other points.
Give all such points in O(nlogn)
Given n points , no three of them are collinear. i and j ,
Share
You are trying to compute what is known as the relative neighborhood graph in the literature. The lune determined by the two points must be empty. There is quite a bit of literature on this topic. You could start with the Wikipedia article.
As user
tmyklebusays, it is a subset of the Delaunay triangulation.Correction. I misread the conditions, as Asiri kindly explained. The relevant graph is instead the Gabriel Graph, which also has a considerable literature: