There are two classes, let\'s call them X and O. A number of elements belonging to these classes are spread out in the xy-plane. Here is an example where the two classes are
You can probably apply linear programming to this problem. I'm not sure of its computational complexity in formal terms, but the technique is successfully applied to very large problems covering a wide range of domains.