This problem, known as the discrete median, has a polynomial-time exhaustivesearch algorithm: calculate the cost of each possible curve by summing over all other input curves.
this only happens for line segments of length larger than 10 15 .