32

Given $n$ points with integer coordinates in the plane, determine the maximum number of points that lie on the same circle (on its circumference, not its interior).

This can be done in $O(n^3)$ easily by trying $\binom{n}{3}$ combinations of points and counting the number of occurrences of all circles found with hash tables.

Question: Is there an algorithm with $o(n^3)$ time?

Bonus question: Is there an algorithm which has a better performance than $O(n^3)$ assuming the maximum size of the (individual) coordinates is $c\times w$ where $w$ is the size of a machine Word and $c$ a constant?

Thinh D. Nguyen
  • 2,313
  • 3
  • 24
  • 71
chubakueno
  • 451
  • 3
  • 5

1 Answers1

0

About the bonus question: if coordinates are somehow bounded and integer, there is a finite amount of possible coordinates to test. We can create a finite constant set of all the possible useful circles with their respective set of integer points lying in our bounded lattice (this is finite because there are at most $\text{grid size} \choose 3$ of them). Now create a matrix of lists, one per coordinate, and map each point to its respective list in the matrix. Iterate now the constant set of circles and their respective set of coordinates, and count how many of the given points are included. This can be implemented in $O(n)$.

izanbf1803
  • 69
  • 5