Constraint Types

Figure 1 - Constraints Panel - Soft Constraint

Two types of constraints can be specified in an Evolver model:

  • Hard - Conditions that must be satisfied for a solution to be valid. Trial solutions that do not satisfy hard constraints are discarded.
    • Precision - Precision defaults to 'Automatic', or it can be manually set to a non-negative integer value. Precision refers to violations of constraints that are so small that Evolver disregards them and will treat a solution as valid despite these small violations. This small imprecision in the handling of constraints relates to the fact that computers can only handle mathematical operations with finite precision.
    • Please note: It is generally recommended to leave the Precision option set to 'Automatic'. When set to 'Automatic', the Optimization Summary will report the actual precision number, which is the maximum violation of the constraint that was disregarded during analysis.

    • To change the Precision value, click the pulldown to select it and type any non-negative integer value.

  • Soft - Conditions that would be preferrable to satisy, but can be violated at a certain “penalty cost". The penalty cost is subtracted from or added to the target value to discourage invalid solutions. See Soft Constraints, below, for more information.
    • Penalty Function - The Penalty Function can be a formula, a cell reference, or a static value. Use the Select Cell button ( ) to select a cell.

Soft Constraints

Soft Constraints are conditions that should be satisfied as much as is possible, but are able to be violated as a compromise (to improve the target values of adjustable cells). When a soft constraint is violated, instead of being discarded (such as with hard constraints) a penalty is attached to the target. The amount of penalty is determined by a penalty function that is specific to the soft constraint.

Evolver has a default penalty function that is displayed when a soft constraint is created.  However, this formula can be replaced with any valid Excel formula

Any penalty function should include the keyword 'DEVIATION' (no quotes). This “placeholder” represents the absolute amount by which the constraint value is beyond its limit.

For each trial solution, Evolver checks whether the soft constraint has been satisfied; if not, it places the amount of deviation in the penalty formula and then calculates the amount of penalty to apply to the target cell value. The penalty amount is either added to (for minimization) or subtracted from (for maximization) the target cell value to penalize it. When a penalty is applied to the target cell due to an unsatisfied soft constraint, the amount of the penalty applied can be seen in the Evolver Watcher.  In addition, penalty values are shown in Optimization Log worksheets, created optionally after optimization.

Penalty functions can be implemented directly in the formulas within a model so that they become a part of the formula in the target cell.  If soft constraints are implemented in this manner, they should not be entered in the Model Definition window!

Please note: If a solution is implemented in a worksheet at the end of an optimization, the calculated target cell result shown in the spreadsheet will not include any penalties applied due to unsatisfied soft constraints.  The Optimization Log worksheet will include the penalized target cell value and the amount of penalty imposed due to each unsatisfied soft constraint.

Evolver includes an Excel workbook'Penalty Functions and Soft Constraints.xlsx' (Figure 2, below) that can be used to evaluate the effects of different penalty functions on specific soft constraints and target cell results.

To view this spreadsheet, go to Help > Example Spreadsheets. This will open a spreadsheet containing links to the other examples included with Evolver. The Penalty Function example workbook is the first workbook listed.

Figure 2 - Penalty Function Example Spreadsheet