I am thinking about the algorithm for the following well-known mathematical problem.
- $n$ red points and $n$ blue points in the plane in general position are given. Find the matching $\{r_1, b_1\}, \ldots, \{r_n, b_n\}$ such that no two line segments $r_ib_i$ and $r_jb_j$ cross.
I came up with the following divide and conquer method:
- Draw a line $\ell$ which simultaneously divides red points and blue points equally (Ham Sandwich Theorem guarantees the exitence).
- Solve the problem recursively for each side of $\ell$
Surprisingly, there are O($n$) algorithm for Step 1 (see http://cgm.cs.mcgill.ca/~athens/cs507/Projects/2002/DanielleMacNevin/algorithm-pg1.html). Therefore the time complexity is O($n \log n$) in total.
Is there a faster algorithm than this?