Algorithm to cover maximal number of points with one circle of given radius

后端 未结 10 1522
Happy的楠姐
Happy的楠姐 2020-12-23 14:19

Let\'s imagine we have a plane with some points on it. We also have a circle of given radius.

I need an algorithm that determines such position of the circle that it

10条回答
  •  轮回少年
    2020-12-23 14:30

    Might I suggest a density map? Find the min and max bounds for the x and y. Divide the range of the x and y bounds into bins having widths equal to the diameter of your circle. Count the number of points in each bin for the x and y separately. Now find the intersection on your density map between the highest ranked x bin with the highest ranked y bin.

    This is a VERY fast algorithm to quickly generalize large data sets but it is not always accurate, to improve accuracy you can slice the bins into smaller and smaller pieces or shift the bin positions to the left or right n times and use a voting system to select the answer that occurs most often between trials.

提交回复
热议问题