I've not yet convinced myself that this is soluble in the general case.
In the 2D case, if all the points in both groups have one coordinate in common, and there are an odd number of points in each group or in the more general case of all the points lying on a straight line at any arbitrary angle.:
+-----------+ +-----------+ +-----------+
| . | | | | . |
| x | | | | . |
| x | | | | . |
| . | |.xx . x . | | x |
| . | | | | x |
| x | | | | x |
+-----------+ +-----------+ +-----------+
Unless you consider the line passing through all the points satisfies the criteria of having an equal number of each type of point on either side; ie. none?
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |
Exactly. If all points lie on the same line, that line is the correct line.
Btw, where I am so far, I may actually end up using some kind of (VERY nonstandard) tree to get from n^2 to n*lg(n). That would make you right :-)
| [reply] |
Yes. The tree would have to be a "multi-dimensional R-B tree"--not that I have the foggiest clue how you would construct one (yet).
Okay, you've satified me on that case, but what about this one.
Two groups of 3 points; one of the first group and two of the second lie on a straight line. The other two points of the first group lie either side of that line ('scuse the crude drawings, but if I can't visualise it, I can't program it:):
+-------------+
| \ |
| x x |
| \ |
| \ |
| x . |
| \ |
| . |
+-------------+
No matter where you put the third point of the second group, other than on that line, the problem is insoluble. I think?
The same logic applies to the higher dimensions also. (I think).
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |