Convex optimization solution