How to model a changing constraint in linear programming?

268 Views Asked by At

I have $N$ constraints like the following:

$$B_n \geq x_nA_n,\forall n\in\{1,2,\ldots,N\}$$

where $x_n$ is a binary variable and $A_n$ and $B_n$ are part of the input.

If I have $B=(B_1,B_2,\ldots,B_N)$, I am done. But the problem is that $B_n$ changes depending on the solution $x_n$. Explicitly,

$$B_{n+1}=B_n-x_nC_n.$$

So if $x_n=0$, then $B_{n+1}=B_n$ but if $x_{n}=1$, then $B_{n+1}=B_n-C_n$. Here I know, $A=(A_1,A_2,\ldots,A_N)$ and $C=(C_1,C_2,\ldots,C_N)$ but don't know $B=(B_1,B_2,\ldots,B_N)$.

Is there any way to model these constraints in linear programming?