Lines in space - combinatorics, algorithms and applications