Using expression based costs

Expression based costs allow you to define costs (fixed, variable, piecewise or stepwise) to any flow, inventory or production values. You use the same expression concept as in Expression Constraints to define quantity, weight or volume values to which costs can then be applied.

  • Fixed Cost – Enter the fixed cost to be applied to the expression. You can define the cost as a single value, or specify a step cost. For example, if you define the Fixed Cost using Step Costs such as:

    Name

    Minimum Quantity

    Cost

    FixedCost

    0

    5000

    FixedCost

    250

    40000

    FixedCost

    1000

    75000

If the constraint value is 600, the Fixed Cost will be 40000. The Fixed Cost Component is evaluated as "greater than or equal to". So in this case, any throughput greater than (or equal to) 250 up to 1000 can incur 40000 in fixed costs. Each step includes the “boundary” values. The first step can apply to the values of 0 and 250, and the second step can apply to the values of 250 and 1000.

  • Variable Cost – Enter the cost to be applied to the quantity, weight or volume as defined by the expression. You can define the cost as a single value, or specify a step cost. The cost will be calculated based on the Variable Cost Type you select. For example, assume you have a Variable Cost with Step Costs:

    Name

    Minimum Quantity

    Cost

    ExpVarCost

    0

    5

    ExpVarCost

    250

    4

    ExpVarCost

    1000

    3

The Variable Cost Component is evaluated as "greater than or equal to". So in this case, every unit greater than or equal to 250 and less than or equal to 1000 can incur a $4 cost. Each step includes the “boundary” values. The first step can apply to the values of 0 and 250, and the second step can apply to the values of 250 and 1000.

When you define a single step cost, such as <500,6>, this is treated as a linear cost - all units are applied a cost of 6.

When you define step costs where the lowest capacity is greater than 0, such as <250,7><500,6>, Network Optimization assumes a lowest capacity of 0 when evaluating costs. You will receive a warning regarding this step cost when you run Network Optimization.

For additional information about how step costs are evaluated, refer to Step costs in network optimization.

The Expression Based Costs table lets you define a fixed cost, a variable cost or both and apply it to a named constraint or use it within the Expression Constraints table. The Variable Cost can be applied in one of the following ways, based on the Variable Cost Type:

  • Linear – A single variable cost is applied for all quantity, weight or volume as defined by the expression. You must enter a single value for the Variable Cost Component when using Linear as the Variable Cost Type. Step costs are not supported for this cost type.
  • Incremental – Piecewise costs are calculated based on quantity break points. For example, assume you have set up the Variable Cost Component with Step Costs such as:

    Name

    Minimum Quantity

    Cost

    ExpCost

    0

    1.50

    ExpCost

    5000

    1.25

    ExpCost

    10000

    1.00

and the flow is 20,000 units for the referenced expression. The total cost will be:

(5,000 - 0)*1.50 + (10,000 - 5,000)*1.25 + (20,000 - 10,000)*1.00 = 23,750

  • All Item – The cost is based on the break in which the total quantity occurs. Given the same Step Costs example from above, with a flow of 20,000 units, the total cost will be:

20,000 * 1.0 = 20,000

When using All Item, if the Throughput exactly matches a breakpoint, such 5000 in the example above, the cost can be either 1.50 or 1.25. Since the solver seeks to minimize cost, the value of 1.25 would be used in this example.
For Incremental and All Item types, the value should include at least two steps. If you define only one step, this is actually acting as a Linear cost and should be defined as a Linear cost with a single value.

As an example, we can apply an expression based cost to the flow between the MFG site and DC_A for Product1 over the model horizon. First, define the Flow Constraint:

Name

Period Name

Source Site

Destination Site

Product Name

Constraint Value

Constraint Type

FlowMFG

(ALL_Periods) (All)

MFG

DC_A

Product1

 

Define

The Expression Based Costs record is as shown below:

Name

Expression

Fixed Cost

Variable Cost

Variable Cost Type

FlowCost1

FlowMFG

1000

VarCostSteps

Incremental

The Step Costs are:

Name

Minimum Quantity

Cost

VarCostSteps

0

2

VarCostSteps

500

1

In this case, the cost record is called FlowCost1 and is applied to the Flow Constraint with Expression FlowMFG. A Fixed Cost of 1000 is incurred. Using an Incremental Variable Cost, the first 500 units of flow incur a cost of 2 per unit, and any flow over the first 500 units incurs a cost of 1 per unit. If there was a total flow from MFG to DC_A of 1200 units, the total cost based on this expression based cost is:

1000 + (2 * 500) + ((1200 - 500) * 1) = 2700

When applying the cost to an Expression Constraint, the costs are incurred based on the constraint activity, rather than the actual flow, inventory or production.

Last modified: Friday May 12, 2023

Is this useful?