12.3 Cost Functions and Constraints

• Cost functions quantify things that we want to minimize, or maximize. These should be aligned with system objectives. Typical cost functions include,

- money

- time

- some combination of factors

• Systems also have constraints that limit available solutions

• Expressed as a function of variables that provides a value

• Consider the example of building a fenced pasture. In this case when the area becomes too large, there is a reduced value. We want to maximize the value of V.

 

Figure 12.1 Example cost function for building a fence around a pasture

• The cost function can be written as..

 

Figure 12.2 A subroutine for cost function calculation

• Constraints are boundaries that cannot be crossed.

• Example of constraints, the pasture cannot be larger than one 1600m be 1600m beacuse of the constraints of an existing road system.

 

Figure 12.3 Example constraint functions for a pasture

• The cost function can be written as..

 

Figure 12.4 A subroutine for cost function calculation

• Slack variables allow constraints to be considered as part of the cost function. Helps with a system with many local minimum.

 

Figure 12.5 Example of slack variables for including constraints

• The cost function can be written as..

 

Figure 12.6 A subroutine for cost function calculation