2

Let $\mathcal{U} = \{ [x_1, ..., x_n] \in \mathbb{R}^n : 0 \leq x_i \leq 1\}$ be the unit hypercube and $C \in \mathbb{R}^n\setminus\mathcal{U}$ fixed. Let us consider the following problem $$ \max_{X \in \mathcal{U}} \hspace{0.5cm}\|X - C\|^2.$$

Is there a known polynomial algorithm to solve the above? We can assume that $\|C\|$ is large enough.

C Marius
  • 507
  • 2
  • 7

3 Answers3

6

This answers a comment by the OP, to explain why the other answers are correct. It is due to the following standard result.

A concave objective subject to compact convex constraints has a global minimum at an extreme of the constraints.

You're maximizing a convex objective, which is equivalent to minimizing the negative of the objective, which is concave. The constraints are compact (bounded feasible set) and convex, so the result applies. Extreme of the constraints has $x_i$ at 0 or 1. Hence the answers from the other posters follow.

Mark L. Stone
  • 13,392
  • 1
  • 31
  • 67
  • 2
    To make a great answer even better, it might be worth noting that the problem is particularly simple when the constraint set is an axis-aligned (hyper)cuboid and the objective is (a monotone function of) the Euclidean distance to a fixed reference point, since (using the Pythagorean theorem) the $n$-dimensional optimization task can then be trivially split into $n$ independent one-dimensional tasks. – Ilmari Karonen Dec 02 '20 at 21:24
  • @Ilmari Karonen Yes, n vs $2^n$. – Mark L. Stone Dec 03 '20 at 02:33
4

As $x_i\in[0,1]$ we just need to compare the values of the endpoints since $(x_i-c_i)^2$ is minimised at $x_i=c_i$. It is easy to see that $x_i=0$ gives the maximum whenever $c_i\ge1/2$ and $x_i=1$ otherwise.

Thus we can treat $x_i$ as binary variables for the purpose of maximisation (see In an integer program, how I can force a binary variable to equal 1 if some condition holds? for integer programming formulations).

3

The solution is given by $x_i= 0$ if $abs(c_i) > abs(c_i -1)$ else $x_i = 1$.

user3680510
  • 3,655
  • 6
  • 26