# Mixed Integer Programming - How to model the dependency of two variables in an objective function

I have two variables $$a$$ and $$b$$, in which $$a$$ is the amount of goods and $$b$$ is the amount of boxes of the given sizes. So $$b$$ (box size + number) is dependent on a (goods quantity). If $$a$$ is allocated to a given path, then $$b$$ will increase based on $$a$$, based on a rule to increase the number of boxes and select the best size.

The objective is to minimize the total cost of using boxes for all paths (i.e. tells the proportion of $$a$$ that is allocated to path_1, path_2, path_n, where the combined cost (spending on boxes) is minimal.)

Problem: How to express the relationship between $$a$$ and $$b$$ in the model? Should I model their dependency in the objective function or in the constraint? If constraint, how to describe such a relationship?

$$\begin{equation} \begin{array}{ll} \text{minimize} & \sum_{i} c_ib_i \\ \text{subject to} & a \leq A_i \rightarrow b_i = n_i \end{array} \end{equation}$$
where $$A_i$$ is meant to be the path allocation and $$n_i$$ the number of boxes assigned. The $$\rightarrow$$ constraint is called an indicator constraint, and most modern MIP solvers support it. I would start with this.
• $a \leq A_i \rightarrow b_i = n_i$ is not really an indicator constraint. Indicator constraints have the form $\delta=0 \text{ (or 1)} \Rightarrow \text{linear constraint}$ (where $\delta$ is a binary variable, a.k.a. indicator variable). – Erwin Kalvelagen Mar 25 at 0:29