Defining Decision Constraints in an Optimization Model | Vose Software

Defining Decision Constraints in an Optimization Model

Decision Constraints define rules on the acceptable values for decision variables. They are checked at the beginning of a simulation run when a new set of decision variables is being tested. For example, a constraint might be that the minimum stock held is three units, or that the maximum number of people not receiving an appropriate level of service is ten, or that 100% of a manufactured product is distributed between shipments.

Adding a  normal constraint

Clicking the upper Add button in the Decision Constraints tab opens a dialog for you to select the spreadsheet location where the decision constraint is to be placed. This is then entered into the Address field and can be edited later by double-clicking this field.

Address is the cell position of the decision constraint that is to be monitored. This cell should already have a formula entered for the Optimizer to work with.

Name is a text field that identifies the constraint.

Type provides a dropdown list of constraint options: Min; Max; Between or Equals.

Value1 specifies the value of the constraint. When Type is Equals, the constraint is that the formula in the cell is precisely equal to Value1; when Type is Min the constraint is that the formula is greater than or equal to Value1; and if Type is Max the constraint is that the formula is less than or equal to Value1. Value1 will nearly always be a fixed value: if it is linked to a spreadsheet cell, ensure that the cell referred to is not generating random values.

Value2 field is only available if Type is Between, in which case the constraint is that the formula in the cell lies between Value1 and Value2. Value2 must be > Value1. ModelRisk will generate an error message if not and will switch the constraint off, showing it to be invalid in the dialog box.

Enabled is a tick box switching the constraint on and off. In the Excel formula, this appears as TRUE or FALSE respectively.

Entering the information as shown above will add the constraint to the Optimization Settings. In the example above, where the first variable ‘Component 2’ in the cell is constrained to have a minimum of 0, the following formula now appears:

= [formula] + VoseOptConstraintMin("Component2",0,TRUE)

where [formula] is the equation that was in the cell before the constraint was added.

Adding a  constraint based on a formula

Clicking the lower Add button in the String Constraints section allows you to create constraint based on a formula:

You can build up a formula based on standard Excel notation and include any decision variables by clicking the Add variables button:

The formula can be edited or deleted later by clicking the Edit and Delete buttons respectively.

VoseOptimization Decision Constraints functions

ModelRisk incorporates three functions for defining decision constraints:

VoseOptConstraintMin(Name, Value, Enabled)

VoseOptConstraintMax(Name, Value, Enabled)

VoseOptConstraintEquals(Name, Value, Enabled)

VoseOptDecisionList(Name, List, Enabled) for a variable taking a value from a list of possible candidates

VoseOptConstraintString(Name, String, Enabled) if a constraint can be formulated by a single string involving decision variables

Options for the function parameters are:

Name: a text field identifying the decision variable to the user

Value: any numerical value

Enabled: a Boolean parameter taking either TRUE (or equivalently 1) when the decision constraint is to be used, or FALSE (or equivalently 0) when the decision constraint is not to be used.

Example model

Optimization example model



Monte Carlo simulation in Excel. Learn more

Spreadsheet risk analysis modeling


Adding risk and uncertainty to your project schedule. Learn more

Project risk analysis


Enterprise Risk Management software (ERM)

Learn more about our enterprise risk analysis management software tool, Pelican

Enterprise risk management software introduction