8
$\begingroup$

Let $0\leq \beta\leq 1$ be an objective variable. The size of $\beta$ is $N\!\times\!N$.

Now, how can I impose the following?

if $\beta_{i,j}>0$ then $\beta_{j,i}=0$

Big M notation can be one of the possible ways, however, I am unable to proceed.

[post in CVX forum]

$\endgroup$

1 Answer 1

6
$\begingroup$

Introduce binary variable $x_{i,j}$ to indicate whether $\beta_{i,j}>0$ and linear constraints: \begin{align} \beta_{i,j} &\le x_{i,j}\\ x_{i,j} + x_{j,i} &\le 1 \end{align} (The big-M here is 1.)

The first constraint enforces $$\beta_{i,j}>0 \implies x_{i,j} = 1.$$ The second constraint enforces $$x_{i,j} = 1 \implies x_{j,i} = 0.$$ The first constraint enforces $$x_{j,i} = 0 \implies \beta_{j,i} \le 0.$$ The lower bound on $\beta$ enforces $$\beta_{j,i} \le 0 \implies \beta_{j,i} = 0.$$ So $$\beta_{i,j}>0 \implies \beta_{j,i} = 0,$$ as desired.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.