linear programming formulation

119 Views Asked by At

I want to formulate equations for this problem. I have previously looked at many examples and I am new to this.

Suppose I have n total fruit plantations and s number of just apple plantations.

I want to place s and (n-s) plantations on an m by m grid of field.

The objective function should be minimizing the area of the grid field where n fruits are to be planted.

Also, I need to control the (n-s) plantations/grid points. That means for all the plantations except the apple plantations, I might place multiple plantations on the same grid point.

Please help.

1

There are 1 best solutions below

8
On BEST ANSWER

You need three sets of decision variables. Let binary variable $a_{i,j}$ indicate whether an apple plantation is placed at grid point $(i,j)$. Let nonnegative integer variable $b_{i,j}$ be the number of non-apple fruit plantations placed at $(i,j)$. Let binary variable $f_{i,j}$ indicate whether at least one fruit plantation is placed at $(i,j)$. The problem is to minimize $\sum_{i,j} f_{i,j}$ subject to linear constraints: \begin{align} \sum_{i,j} a_{i,j} &= s \tag1\\ \sum_{i,j} b_{i,j} &= n-s \tag2\\ a_{i,j} &\le f_{i,j} &&\text{for all $i,j$} \tag3\\ b_{i,j} &\le (n-s) f_{i,j} &&\text{for all $i,j$} \tag4\\ b_{i,j} &\le (n-s) (1 - a_{i,j}) &&\text{for all $i,j$} \tag5 \end{align} Constraint $(1)$ places all $s$ apple plantations. Constraint $(2)$ places all $n-s$ non-apple plantations. Constraint $(3)$ enforces $a_{i,j}=1 \implies f_{i,j}=1$. Constraint $(4)$ enforces $b_{i,j}>0 \implies f_{i,j}=1$. Constraint $(5)$ enforces $a_{i,j}=1 \implies b_{i,j}=0$.