powered by
Label first or last points, whichever are more spread out, and use a QP solver to make sure the labels do not collide.
"maxvar.qp"