# Linear programming with correction term based on decision vector

I had a linear programming problem where I am optimizing some function

$$f(x) = \sum_{j}x_jq_jp_j - \sum_{i}\left(\sum_{j}x_jq_jC_{ij} \right) c_i$$

Where $$q, p, C, c$$ are known.

I now want to extend this problem to something where my $$p$$ vector depends on the $$x$$ vector.

That is, I want to change the value of $$p_j$$ depending on the $$x_j$$ and original $$p_j$$. In particular, I want to do it in the following way. Let's take the example where:

$$x = [1,0,1]^T$$ and $$p=[30,20,50]^T$$

In this case, I would like my vector $$p$$ to be altered using the following rule: redistribute the % lost in $$p$$ following the multiplication with $$x$$ over all other $$p$$. So in this case, because the second element of $$x$$ is 0, I want to redistribute the 20/100 lost over the other $$p$$, such that $$p_{new} = [36,0,60]$$ (the other elements became 20% higher)

I am not sure how to incorporate this logic into my linear programming problem.

• Hey, your x variables are binary and you want p = 0 whenever x = 0, and the summation of p values should be the same right? Should it be in linear format? because you can easily model it using multiplications of the binary variable(which is also possible to linearize later)?? – Oguz Toragay May 12 '20 at 14:36
• I don't think I fully follow.. It is indeed true that p=0 when x=0, but summation of x is not the same. Like in the example, initially it was 30+20+50=100, and after it was 36+0+60=96. – BarkingCat May 12 '20 at 14:43
• Never mind, I didn't fully read the question... – Oguz Toragay May 12 '20 at 14:49
• Are you only redistributing when $x_j=0$ (as opposed to when $x_j$ is "small"? In your example, what would $M$ be? You wrote it as if it would be a multiplicand, but it sounds more like a function of the first summation in the objective. – prubin May 12 '20 at 15:58
• Ah yeah you are right. Multiplying by M makes no sense here. So the solution would probably look different.. Indeed we are only redistributing when $x_j=0$ – BarkingCat May 12 '20 at 18:33