I'm just asking because I'm curious. I was seeking references on the following problem, that a friend exposed to me last holidays :
Problem
Given $n$ red points and $n$ blue points in the plane in general position (no 3 of them are aligned), find a pairing of the red points with the blue points such that the segments it draws are all disjoint.
This problem is always solvable, and admits several proof. A proof I know goes like this :
Start with an arbitrary pairing, and look for intersections of the segments it defines, if there are none you're done. If you found one, do the following operation :
r r r r
\ / | |
X => | |
/ \ | |
b b b b
(uncross the crossing you have found), you may create new crossings with this operation. If you repeat this operation, you cannot cycle, because the triangle inequality shows that the sum of the length of the segments is strictly decreasing. So you will eventually get stuck at a configuration with no crossings.
Questions
- What is the complexity of the algorithm described in the proof ?
- What is the best known algorithm to solve this problem ?
I wouldn't be surprised to learn that this problem is a classic in computational geometry, however googling didn't give me references. Since some computational geometers are active on MO, I thought I could get interesting answers here.