I have two sets of n nodes. Now I want to connect each node from one set with another node from the other set. The resulting graph should have no intersections.
I know of several sweep line algorithms (Bentley-Ottmann-Algorithm to check where intersections occur, but I couldn't find an algorithm to solve those intersections, except for a brute-force approach.
Each node from one set can be connected to any other node within the other set.
Any pointers to (an efficient) algorithm that solves this problem? No implementation needed.
EDIT1:
Here is one solution to the problem for n=7
:
The black dots are a set of nodes and the red dotes are a set. Each black node has to be connected to one red node so that the lines connecting them are not crossing.
EDIT2:
To further clarify: The positions of all the nodes are fixed and the resulting graph will have n edges. I also don't have any proof that a solution exists, but I couldn't create an example where there was no solution. I'm sure there is a proof out there somewhere that creating such a planar graph is always possible. Also, only one solution is needed, not all possible solutions.