1
$\begingroup$

Being given a radius $R$ and $N$ points on a $x-y$ plane , I want to draw a circle with radius $R$ such that it maximizes the number of points enclosed.

My Approach: If there a circle C that encloses $M$ points, then by slightly moving C it will touch at least two points.

So, essentially we just need to check all circles which touch (at least) 2 points:

  • For each pair of points in the given set, construct a circle with radius R that touches both points. For each point pair there are at most two such circles.
  • For each constructed circle, check for if each given point if it is inside it. Return the circle that encloses the maximum number of points.

    Time Complexity $O(N^3)$

Is there an algorithm that can reduce my time complexity ?

  • 0
    First you need three points to define a circle2017-01-11
  • 0
    Clarification - surely you don't want to maximise the number of points enclosed - you want all points enclosed.2017-01-11
  • 0
    I want to maximize see the first statement2017-01-11
  • 0
    Sorry - I have read the question more carefully now.2017-01-12
  • 0
    An idea (is it a good one ?): Consider the (theoretical) function $f$ which, to a given (x,y) associates the number of points inside the circle centered i, (x,y) whith radius $R$. We are looking for the maximum of $f(x,y)$, without of course having a full knowledge of $f$. In certain cases, wouldn't a kind of (discrete) **gradient ascent** be efficient with only some computations of values $f(x,y)$ ?2017-01-14

0 Answers 0