8

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]

user199
  • 83
  • 2

1 Answers1

6

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.

RobPratt
  • 32,006
  • 1
  • 44
  • 84