find N intersection points(closest points) among M lines

22 Views Asked by At

There is algorithm problem, I have N (around 10000) 3D Lines, and I know there are around 20 (maybe 21, or 22) intersection points among these lines (the point may not exactly on the lines). Are there any efficient algorithm to solve this problem. My thought is calculate intersection point (or closest points) for any of two lines. Then use K mean to calculate the center of these cloud points.