14.3 Constraints

In Farmer Jean’s case, obviously if we just wanted to maximise profits, we should just grow more and more of the profit maximising plant. But this is often not possible because of limited constraints. For example, you may not have unlimited budget, or unlimited time, or you may also need to fulfil certain criteria as part of your contract with your distributor.

Formally, we represent these constraints as mathematical inequalities or equations. The inequalities can be less than, greater than, or strictly equal. On the left hand side we put a function of our decision variables, and on the right hand side we put the value of the constraint.

So for example, if you have to “deliver within budget”, this means that your total cost of your decisions must be less than/equal to your budget. If you have to “deliver at least 50 units of product”, this means that number of product produced must be greater than or equal to 50. You may have to allocate working shifts to give exactly 40 hours of work per staff. So basically these constraints can be greater or less than or equal to some number.

Examples Translates to:
Deliver within Budget Total Cost \(\leq\) Budget
Deliver at least 50 units of product Product \(\geq\) 50
Allocation must contain exactly 40 hours of work Working Hours \(=\) 40
Implicit: Products, hours of work must be non-negative Product \(\geq\) 0
Hours \(\geq\) 0

We also often have constraint called non-negativity constraints. For many of these decision variables that have real world meaning, they often cannot be negative. So we often specify that each of the decision variables must be greater than or equal to 0. These are important to specify explicitly, and in fact R assumes this.

Jean the Farmer: Constraints

Coming back to Farmer Jean, she has two types of constraints. First, she doesn’t have unlimited budget, with which she needs to pay the cost of growing each crop. So we can write this as the cost of producing parsnips times the amount of parsnips (\(0.20X_1\)), and the cost of producing kale times the amount of kale (\(0.70X_2\)), the sum of these two must be less than equal to 100.

The second constraint she has is that she only has 200 plots of land. So the total amount of crops she grows has to fit into these plots. So \(X_1\) + \(X_2\) must be less than or equal to 200.

And finally we have the non-negativity constraints.

Name Constraints
Budget Constraints \(0.20X_1 + 0.70 X_2 \leq 100\)
Space Constraints \(X_1 + X_2 \leq 200\)
Non-negativity \(X_1 \geq 0\)
\(X_2 \geq 0\)