How to figure out if any of the N lines in 3D space intersect? Let us assume that we have N lines in a three dimensional space. How can we figure out if any of these lines intersects any other line?
 
It would be great, if the problem was solved in terms of linear algebra. If it is not possible, why?


According to the section about the shortest line between two lines in 3D here 
: if there are $\mu_a$ and $\mu_b$ (the formulas are given) and $P_a(\mu_a)-P_b(\mu_b)=0$, then there is an intersection point. This is how you might want to find out, if two given lines in 3D intersect. 
If you are given $N$ lines, then just make that test as often as needed, which is $$\binom{N}{2}=N(N-1)/2$$ times.
