The principle of finite descent
Preliminaries
Select 10 points at random in a unit square :
Permute elements i and j in a list :
Test if segments i (joining red[[i]] and blue[[i]]) and j (joining red[[j]] and blue[[j]]) intersect :
(See Annexe below)
Finite descent (first example)
10 red points and 10 blues points in a unit square :
A pleasant random choice constantly valid in this file :
Initial display :
The 20 points :
One-to-one pairing of the red and blue points (In the order 1-1, 2-2, ..., 10-10) (Total length, L, of the straight segments displayed) :
Progressive uncrossing of the segments. If the final uncrossing is incomplete, the cell must be manually reactivated until complete uncrossing is achieved :
Finite descent (second example)
The previous calculation started with bleu=Permutations[blue][[1]] (=blue i.e. Identity permutation). One can do better if starting with bleu=Permutations[blue][[1066281]] :
New starting point :
Intersection point (X = {xx, yx}) between two straight lines, ab et cd :