0
$\begingroup$

I have the following optimization problem that I want to solve (note that the $X$ variable consists of a binary matrix subject to a single constraint).

First, some definitions:

My $X$ variable: $$ X = \underset{n\times m}{\underbrace{\pmatrix{ x_{11} & x_{12} & \dots &x_{1m} \\ x_{21} & \ddots \\ \vdots & & \ddots\\ x_{n1} & & & x_{nm} }}}\ \ \ \ \ x_{ij} \in \{ 0,1 \} $$

Other entities (constants) that I need to compute the cost function:

$$ A = \underset{n\times m}{\underbrace{\pmatrix{ a_{11} & a_{12} & \dots &a_{1m} \\ a_{21} & \ddots \\ \vdots & & \ddots\\ a_{n1} & & & a_{nm} }}}\ \ \ \ \ a_{ij} \in \{ 0,1 \} $$

$$ \mathbf{r} = \underset{m\times 1}{\underbrace{\pmatrix{r_1 \\ r_2 \\ \vdots \\ r_m}}}\ \ \ r_i = \frac{1}{\overline{r}}\ \ \ \ \forall i\in\{1,\dots,m\} $$

$$ \mathbf{o}^{(m)} = \underset{m\times 1}{\underbrace{\pmatrix{o_1 \\ o_2 \\ \vdots \\ o_m}}}\ \ \ o_i = 1\ \ \ \ \forall i\in\{1,\dots,m\} $$

$$ \mathbf{o}^{(n)} = \underset{n\times 1}{\underbrace{\pmatrix{o_1 \\ o_2 \\ \vdots \\ o_n}}}\ \ \ o_i = 1\ \ \ \ \forall i\in\{1,\dots,n\} $$

$$ \mathbf{t} = \underset{m\times 1}{\underbrace{\pmatrix{t_1 \\ t_2 \\ \vdots \\ t_m}}}\ \ \ t_i = \overline{t}\ \ \ \ \forall i\in\{1,\dots,m\} $$

$$ \mathbf{p} = \left(A - X\right)^T\mathbf{o}^{(n)} $$

I have just one constraint that is: $$ X\mathbf{o}^{(m)} = \mathbf{t} $$

The cost function that we want to minimize is:

$$ J = \frac{1}{2}\left(\mathbf{r} - \mathbf{p}\right)^T\left(\mathbf{r} - \mathbf{p}\right) $$

The search space is pretty huge since the number of solutions is ${\binom{n}{\overline{t}}}^m$. I'm pretty sure I can try to find a reasonable solution by using genetic algorithms, but is it possible to formulate and solve the problem by means of quadratic programming?

The main issue here is that I don't think I can rearrange my equations as follows (and $X$ in my case is a matrix, instead of a vector):

$$ J = \frac{1}{2}\mathbf{x}^TQ\mathbf{x} + \mathbf{c}^T\mathbf{x} $$ s.t. $$ A\mathbf{x} \le \mathbf{b} $$

$\endgroup$
6
  • $\begingroup$ Try to write it in a more compact way. It looks long and confusing. $\endgroup$ Commented Jul 12, 2022 at 19:13
  • $\begingroup$ also, you should state clearly what variables are known ( so constants ) and what variables are not known. Maybe just $x$ is the unknown but it's not clear. $\endgroup$ Commented Jul 12, 2022 at 19:43
  • 3
    $\begingroup$ If $y=r-p$ (this is a linear constraint) then your objective is $\frac12 y^Ty$ so your problem is quite trivially a binary QP, or binary SOCP, so you can use any solver capable of mixed-integer QP or SOCP. A modeling language like CVXPY, CVX or YALMIP will let you write the whole thing in just a few lines of code. It may still be very hard to solve to optimality though. $\endgroup$ Commented Jul 12, 2022 at 21:22
  • 3
    $\begingroup$ Extending the comment by @MichalAdamaszek: Since your constraints are linear in $X$ and your objective function is quadratic in $X,$ you can linearize the objective function by introducing additional variables and inequality constraints and then solve it using a mixed-integer linear program solver. Some solvers will handle the linearization for you; some may require you to do it yourself. $\endgroup$ Commented Jul 13, 2022 at 15:03
  • $\begingroup$ Thanks @MichalAdamaszek, so I guess I need to rearrange my constraint in order to obtain something that resembles $A\mathbf{y} \le \mathbf{b}$. Is it right? Unfortunately, I don't have much experience in QP, so if you can point me to any useful resource it would be really great. $\endgroup$ Commented Jul 13, 2022 at 16:45

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.