Constraint Advanced Options
Clicking the 'More' button in the Advanced Options field opens the Constraint Advanced Options window.

Figure 1 - Constraint Advanced Options – Hard Constraint
This window includes the following options:
-
Constraint Type - Evolver supports two types of constraints.
-
Hard- Hard constraints are conditions that must be satisfied for a trial solution to be valid. Trial solutions that do not satisfy hard constraints are discarded.
Precision – Specifies Evolver’s tolerance to violations of constraints that are so small that they do not make solutions invalid. This small imprecision in the handling of constraints relates to the fact that computers can only handle mathematical operations with finite precision.
Typically, this field should be left in 'Automatic' mode which will use internal heuristics to handle these round-off error problems. But alternatively, a specific tolerance threshold can be specified.
-
Soft - Soft constraints are conditions that would be preferable to satisfy but can be violated at a certain “penalty” cost. This penalty cost is subtracted from or added to the target value to discourage invalid solutions. See Soft Constraints and Penalty Functions 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 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.

Figure 2 - Constraint Advanced Options – 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 3, 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 3 - Penalty Function Example Spreadsheet
To view this spreadsheet, go to Examples > Penalty Functions and Soft Constraints.