Indirection is a computer programming concept that describes a computer's ability to reference a value through a name or container, rather than the value itself. Each time that a value is referenced through such a name or container is known as a level of indirection.

In Optimizer, the line items that you use for objectives and constraints fall into one of three categories:

  • a variable
  • dependent upon a variable
  • are independent of variables

Any line items that are dependent upon variables that you used in your objective or constraint formulas can only have one level of indirection (although formula components that are independent of variables can have more than one level of indirection). This means that formulas can refer to line items that are a variable or that contain a variable, but they can't refer to line items that refer to another line item containing a variable. This concept is illustrated in the diagram below.

Chart shows an example of a line item with two levels of indirection. A constraint formula refers to a line item that contains a formula, which itself makes reference to a line item containing a variable. This final line item has two levels of indirection.
Line itemFormulaLine item category
xN/AVariable
yN/AVariable
zN/AVariable
AN/AIndependent of variables
BN/AIndependent of variables
CN/AIndependent of variables
DN/AIndependent of variables
EN/AIndependent of variables
FN/AIndependent of variables
GE * FFormula independent of variables
ConstraintA * x + B * First Indirection 1 + First Indirection 2 >= CConstraint
First Indirection 1D * yVariable-dependent formula
First Indirection 2E * Second IndirectionVariable-dependent formula
Second IndirectionF * zVariable-dependent formula

If you attempt to use the constraint formula in the diagram above in an optimization, an error will be displayed. For example:

Process failed. Click below for details.

Factory Assignment Optimization

Action failed. The Objective 'Direct Assignment Costs' does not exist. Edit the Optimizer action to remove the line item.

The message states that an objective (or constraint) doesn't exist because it uses a variable with two levels of indirection, which Optimizer isn't able to process.

In the diagram, the error occurs because the line item First Indirection 2 refers to a second line item Second Indirection, which contains a formula that uses a variable.

You can remodel optimization problems to account for the single indirection limitation. Make sure that any variables are referenced directly in the first level of indirection. To remodel an optimization problem, follow these steps:

  1. Identify how any formulas in the first and second level of indirection interact with variables.
  2. Isolate the variables and any attached operators; then create new line items containing the rest of the contents of these formulas.
  3. Use the new line items in the first level of indirection, combining them with the variables to create new formulas that directly reference the variables.

See the diagram below for an example of how to work around the indirection limitation.

A revised version of the earlier chart. All elements that previously interacted with the variable with two levels of indirection are now part of a formula in a new line item. This new line item has been combined directly with the variable, thereby avoiding the second level of indirection.

To get to this stage, follow these steps:

  1. Identify that the indirection problem originates in Second Indirection, and by extension First Indirection 2
  2. Examine the formulas used in these line items and consolidate them: E * F * z
  3. Isolate the variable and its operator, * z
  4. Create a new line item, G, that contains the remainder of the formula, E * F
  5. Use the new line item G to create a new formula in First Indirection 2G * z, recombining the new line item with the isolated variable and its operator.

By creating the new line item G and using it in a formula with the variable z, we can remove the second level of indirection. This means our constraint formula will work and the optimization can run without error.