Count constraints
The various count constraints act as "Number of" constraints. These enable you to limit the number of sites, work centers, flows, inventory and production locations to be used within a model structure.
In all count constraints, the formulation uses two decision variables to formulate the constraint:
- A continuous decision variable
- A binary decision variable
The following is an example using flow count constraints, but other count constraints (inventory, production) follow the same logic. For the Flow Count Constraint:
- The continuous decision variable is flow (source, destination, product, mode, time period).
- The binary decision variable is aggflow (source, destination, product, mode, time period).
The decision variables are constructed as two constraints in the problem formulation as follows:
- Sum of flow <= BigM*aggflow
This is to make sure that the binary decision variable is 1 when there is positive flow.
- Sum of aggflow <= Constraint Value
This is to count the binaries and make sure the count does not exceed the count value you provided in the count constraint record.
In the count constraint tables, the columns not designated with "Aggregated" determine the sets used to sum the flow variable. For example, in Flow Count Constraints, these are the Period, Site, Destination, Product and Mode.
The fields designated with “Aggregated” determine on the indices over which the flow variable is summed in the first constraint (#1) described above. For example, in Flow Count Constraints, these are the Source Aggregated, Destination Aggregated, Product Aggregated, Mode Aggregated and Period Aggregated columns.
When deciding how to set the “Aggregated” columns, for columns you want to use for the count, set those to “No”. The binary decision variable (aggflow) is created for the columns that are not aggregated. Those binaries are counted in the second constraint (#2 above).
Assume the following record in the Flow Count Constraints table. Three customers (CZ1, CZ2 and CZ3) single source all products from one of two manufacturers (MFG1 and MFG2):
Period |
Source |
Destination |
Product |
Mode |
Period Aggregated |
Source Aggregated |
Destination Aggregated |
Product Aggregated |
Mode Aggregated |
Count Type |
Count Value |
“(ALL_Periods)” |
Site group: MFG1 and MFG2 |
Site group: |
“(ALL_Products)” |
“(ALL_Modes)” |
Yes |
No |
Yes |
Yes |
Yes |
Max or Fixed |
1 |
In this case, we are counting over the sources (only Source Aggregated is set to “No”). The set used for the source field has 2 elements in it (MFG1 and MFG2), so this means we have 2 binary variables.
In another example, a DC single sources products P1, P2 and P3. This Flow Count Constraint results in as many alternatives (binaries) as there are available sources for DC1.
Period |
Source |
Destination |
Product |
Mode |
Period Aggregated |
Source Aggregated |
Destination Aggregated |
Product Aggregated |
Mode Aggregated |
Count Type |
Count Value |
“(ALL_Periods)” |
“(ALL_Sites)” |
DC1 |
Product group: |
“(ALL_Modes)” |
Yes |
No |
Yes |
Yes |
Yes |
Max or Fixed |
1 |
Flow count constraints
Flow count constraints place restrictions on the number of transportation links (or paths) between sites.
The dimensions of a flow count constraint are:
- Source: The source of the flow
- Destination: The destination of the flow
- Product: The product flowing
- Mode: The method of transportation
- Period: The time in which the flow occurs
At least one of the “Aggregated” columns in the Flow Count Constraint must be set to "Yes" and at least one of the “Aggregated” columns must be set to "No" for the constraint to be applied.
For example, let’s take a look at flow count constraints that can be placed between 3 MFGs and 1 DC.
"No more than 2 transportation links of product A from MFG (1 to 3) to DC1"
3 of the 5 dimensions of a flow count are in use for this constraint: source site, destination site, and product. Since the constraint did not specify a mode or time period, assume (as the software will) that the constraint between MFG and DC1 is for ALL modes and ALL periods.
To understand how to apply the "no more than 2 transportation links" component of the constraint, please view the sections on constraint type and the constraint basis.
Inventory count constraints
Inventory count constraints place restrictions on the number of sites at which goods are held.
The dimensions of an inventory count constraint are:
- Site: The place where inventory is held
- Product: The product being held
- Period: The time in which inventory is held
At least one of the “Aggregated” columns in the Inventory Count Constraint must be set to "Yes" and at least one of the “Aggregated” columns must be set to "No" for the constraint to be applied.
For example, let’s take a look at inventory count constraint that can be placed on DCs.
"No more than 1 DC can be used to store inventory of product A"
2 of the 3 dimensions of an inventory count are in use for this constraint: site and product. Since the constraint did not specify a time period, assume (as the software will) that the constraint at the DCs is for ALL periods.
To understand how to apply the "no more than 1 DC" component of the constraint, please view the sections on constraint type and constraint basis.
Production count constraints
Production count constraints place restrictions on the number of sites at which production takes place.
The dimensions of a production count constraint are:
- Site: The locations where production takes place
- Product: The product being produced
- Period: The time in which the production occurs
At least one of the “Aggregated” columns in the Production Count Constraint must be set to "Yes" and at least one of the “Aggregated” columns must be set to "No" for the constraint to be applied.
For example, let’s take a look at production count constraint that can be placed on MFGs.
"No more than 2 MFGs can produce Product A"
2 of the 3 dimensions of a production count are in use for this constraint: site and product. Since the constraint did not specify a time period, assume (as the software will) that the constraint at MFGs is across ALL periods.
To understand how to apply the "no more than 2 MFGs" component of the constraint, please view the sections on constraint type and constraint basis.
Site constraints
Site constraints place restriction on the number of sites that can be open.
The dimensions of a site constraint are:
- Site: The locations on which the restriction is placed. When selecting a group for use with a site constraint, select "All" as the basis for the group.
- Period: The time in which the restriction is placed
For example, let’s take a look at site constraint that can be placed on DCs.
"No more than 2 DCs can be open"
1 of the 2 dimensions of a site constraint is in use for this constraint: site. Since the constraint did not specify a time period, assume (as the software will) that the constraint at the DCs is for ALL periods.
To understand how to apply the "no more than 2 DCs" component of the constraint, please view the sections on constraint type and constraint basis.
Work center constraints
Work Center constraints place restriction on the number of work centers that can be open.
The dimensions of a work center constraint are:
- Work Center: The work centers on which the restriction is placed. When selecting a group for use with a work center constraint, select "All" as the basis for the group.
- Site: The locations on which the restriction is placed.
- Period: The time in which the restriction is placed.
Last modified: Friday May 12, 2023