# 如何（高效）判断数据是否线性可分

There are efficient algorithms that can be used both to find the convex hull (theqhull algorithm is based on anO(nlog(n)) quickhull approach I think), and to perform line-line intersection tests for a set of segments (sweepline atO(nlog(n))), so overall it seems that an efficient O(nlog(n)) algorithm should be possible.

This type of approach should also generalise to general k-way separation tests (where you havek groups of objects) by forming the convex hull and performing the intersection tests for each group.

It should also work in higher dimensions, although the intersection tests would start to become more challenging...

wikipedia对凸包的介绍：http://zh.wikipedia.org/wiki/%E5%87%B8%E5%8C%85

Håvard GeithusDarren Engwirda（以及其他人）的问答：http://stackoverflow.com/questions/9779179/determine-whether-the-two-classes-are-linearly-separable-algorithmically-in-2d