### 3.5 Guidelines for Formulating Models

 When building an MP model the data really do define the problem. Once you have decided which data are relevant, the choice of decision variables and constraints is largely fixed. Each item of data must be used; and for each decision which the model has to make, there must be an item of data to direct the model's choice.If there is an item of data which has not been used, try to identify how it is used and add the necessary relationship. Follow this principle and the only constraints which you run the risk of omitting are material balances. Fortunately, these do not cause infeasibility in the resulting model, which is difficult to diagnose, but unboundedness or a solution which is, quite literally, too good to be true (because the model can effectively make things for nothing).The need for items of data to direct each of the decisions which the model makes is more subtle. Consider a two-stage distribution process in which identical goods are shipped from several factories to several depots and thence on to customers. The cost of the goods varies between factories and there are separate costs for each leg of the distribution process. It is wrong to define as the decision variables the quantity of goods to be shipped from each factory through each depot to each customer. Instead you should define separate decision variables for the quantity of goods to be distributed from each factory to each depot and from each depot to each customer.Defining a single set of two-stage decision variables purports to identify for each customer the factory where those goods were manufactured. From this one might be tempted to assess the profitability of supplying each customer, and even whether to continue to do so. Yet what data do we have to drive such decisions? The goods from each factory are identical. If we consider a depot which is supplied from two factories the costs of goods will differ depending on their source. The depot has to supply a number of customers. How do we decide which customers to supply with goods from each of the source factories? Without further information (such as that there are in practice differences between the goods from each factory and preferences among customers) we simply have no basis for a decision. Our model must reflect this.When writing a formulation, record against each data item, decision variable and constraint the units in which that item is measured (e.g. \$/tonne). Check that the units of all the terms (i.e. coefficient multiplied by decision variable) in each constraint are consistent with the stated units of that constraint. Pay particular attention to supposedly dimensionless data items, such as yield factors, and data with artificial units, such as quality indices. Yields may be expressed by mass (i.e. mass of output material as a fraction of mass of input material), by volume or by mol. If the associated decision variables are not measured the same way, conversion factors will be required, e.g. densities or molecular weights.In the following examples, the essence of the problem to be solved is defined by the subscripts and constants. Do also make sure that you define the units in which all data items and variables are measured.`previous contents next`