Self-intersection of optimal geodesics