This came up when a friend talked about a programming competition, and we wondered what the best approach was:
Given a list of points, find the centre of a circle of predetermined size that covers the most points. If there are several such circles, its only important to find one of them.
Example input: 1000 points, in a 500x500 space, and a circle of 60 diameter.
Unless I've missed something obvious I think there is a simple answer.
For a rectangular area MxN, number of points P, radius R:
This is O(P), assuming P is the variable of interest.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With