DS Optimization allows you to optimize the production dates/sequences and the resource assignment of existing operations/activities that were previously generated by the production planning run, manual planning, or the production planning optimizer. The purpose of optimization is to generate feasible production plans and increase the efficiency of production. Several optimization objectives (such as setup times, due date violations) can be weighted in such a way that the optimized schedule comes as close to the desired results/business requirements.
The DS Optimizer allows you to define the importance of different objective criteria in the fitness function.

The objective function of the DS Optimizer is a weighted sum of the following criteria:
- Makespan
- Total setup times
- Total setup costs
- Maximum delay costs
- Total delay costs
- Total mode costs
You can define the weights of the objective function in the Optimization Profile. The weights define how the trade-off between different objectives is evaluated by the DS Optimizer.

During optimization, the DS Optimizer tries to reduce the value of the objective function, that is, find a schedule in which the different times and costs - based on their weighting - are as small as possible. In general, it is not possible to meet all the scheduling goals to the same extent. Shortening setup times (by changing the order sequence) can, for example, lead to a violation of due dates. A balance must be kept in the weighting for the optimization algorithm because the better the setup times are optimized, the more the adherence to deadlines may suffer.
The following graph shows the trade-off between different objectives (setup and delay) by means of a simple example.

As explained before, the DS Optimizer creates different solutions and evaluates these solutions to decide, which one fits best to the business requirement. One solution (solution 1) might have sequenced the orders by their due date. While this sequence obviously minimizes the total delay, it incurs a lot of setup times. Another solution (solution 2) might have grouped the orders by similar setup groups, therefore significantly reducing the number of setups. However, in the second solution, this grouping has caused some orders (order C in the example) to be late.
What is the optimal solution in this situation? It depends on your requirements. The first solution maximizes the service level by producing all orders on-time, whereas the second solution maximizes efficiency by reducing non productive setup times. Depending on your industry or preferences, either solution may fit better to your needs. At times when resource utilization is high, your focus may be on efficiency, whereas in times with lower utilization you may prioritize service level over efficiency. Thus, weighing the objective criteria in the Optimization Profile allows you to influence the DS Optimizer result according to your business requirements.
To define the right weights, you must be aware of the exact definition of each objective criteria. The first optimization objective is the makespan.
The makespan is defined as the time between the start of the optimized plan and the end of the activity that is scheduled as the latest. Thus, the makespan defines the duration of the schedule for the complete set of orders selected for optimization. The reasoning for this objective is that the DS Optimizer can schedule all orders as early and as compactly as possible. This should maximize resource utilization especially on bottleneck resources.
The makespan is measured in seconds.
The second (and third) optimization criteria are setup times and setup costs.
You can use the DS Optimizer to optimize the use of single resources by reducing the total setup times and costs. The optimizer determines sequence dependent setup times and setup costs from the setup matrix.
In the objective function, the DS Optimizer interprets the values for the setup times and setup costs from the setup matrix as follows:
- Setup times can be maintained in any arbitrary time unit, for example hours, minutes, or seconds, in the setup matrix. The DS Optimizer converts all setup times into seconds to be able to calculate the setup efforts in a common unit of measure. For example, if you enter a setup time of 10 minutes in the setup matrix, the system uses the value of 600 (seconds) in the objective function.
- Setup costs are maintained without any unit of measurement in the setup matrix. In the objective function, the DS Optimizer uses the value entered in the setup matrix. If you enter, for example, setup costs with a value of 10 in the setup matrix, the DS Optimizer uses the value of 10 in the objective function.
Thus, in the objective function, the setup costs with a value of 10 correspond to a setup time of 10 seconds. You must take this relationship between setup times and setup costs into account when defining the objective function, that is, when specifying the weighting for the setup times and the setup costs. Note that the DS Optimizer displays the net duration of deallocated setup activities in the objective function as the setup time. The net duration of a deallocated setup activity is sequence-independent. Deallocated setup activities do not cause any setup costs. Thus, deallocated setup activities contribute a fixed constant to the objective function and are therefore not relevant for decision-making.
Note that setup cost is the only criteria which is not measured in seconds. Therefore, the scaling of the setup costs in the setup matrix or its weight in the objective function has to consider this time granularity.
The fourth (and fifth) optimization criteria are maximum and total delay.
You can use the optimization to optimize the schedule according to the costs that are associated with the delayed completion of orders or activities. The following optimization criteria are available:
- The sum of the delay costs in the optimization horizon
- The maximum delay costs
A delay exists, when either a receipt date/time is later than a requirement date/time or when the latest allowable start or finish date/time for an activity is before the actual start or finish date/time.
The order priority and the duration of the delay influence how much the delay is considered in the objective function. The delay cost is calculated as follows:
Delay costs = Costs dependent on priority x Duration of delay in seconds.
You can maintain the priority-dependent costs depending on the order priority. As the priority decreases, the costs must either decrease or stay the same. The order priority can be determined by the sales order, the planned independent requirement or - depending on the product - by the product master. You can define the source of an order's priority depending on the planning version in the Model and Version Management. The DS Optimizer uses the duration of the delay in seconds to calculate the delay costs.
In the Optimization Profile on the Costs tab, you can define different priority-dependent delay costs. The priority of an order can be between 1 (highest priority) and 255 (lowest priority). You define a maximum of six successive priority intervals in the Optimization Profile.
Example: By specifying the values 3, 6, and 9, you define the following priority intervals:
Order priority 1 to 3
Order priority 4 to 6
Order priority 7 to 9
The interval 10 to 255 occurs automatically as the fourth priority interval.
During optimization, in order to reduce delay costs, the DS Optimizer tries to schedule orders and activities that have a high priority with the smallest possible delay (if necessary, at the expense of orders and activities with lower priority for which greater delays are not so crucial).
The optimization criteria Total Delay minimizes the sum of all delays, whereas the optimization criteria Maximum Delay will only focus on the order with the highest delay costs. Therefore, the objective criteria Maximum Delay is important for preferring balancing delays among different orders compared to the objective criteria Total Delay.
Imagine a comparison of two solutions with the first solution showing only one delay for 10 days and another solution showing 10 delays of one day each. From the perspective of the Total Delay both solutions are equivalent (1x10 = 10x1). However, from the perspective of the Maximum Delay the second solution would be preferred over the first solution (maximum delay is one day versus 10 days).
The sixth and final optimization criteria, which you can weigh in the objective function, are mode costs.
You can use the DS Optimizer to optimize the schedule according to the sum of the mode costs for the activities. The mode costs for an activity are the costs that are incurred when executing an activity in a particular mode. They are calculated as follows from the fixed and variable costs:
Mode costs = Fixed costs + Variable costs x Duration of activity in seconds
You can maintain the fixed and variable costs in the Optimization Profile depending on the mode priority; as the priority decreases, the costs must either increase or remain the same.
Note
Should you require non decreasing mode costs per priority to model a specific requirement, you can deactivate this check via SAP Note 931003
Example: If you specify the following fixed costs in the Optimization Profile: 10 up to mode priority D, 20 up to mode priority H, 40 up to mode priority L, and otherwise 80, the mode costs are:
- 10 for activities that are scheduled in modes with priority A to D.
- 20 for activities that are scheduled in modes with priority E to H.
- 40 for activities that are scheduled in modes with priority I to L.
- 80 for activities that are scheduled in modes with priority M to O.
To reduce the costs for an activity, the DS Optimizer can choose a mode with lower costs for the activity during optimization; that is, it reschedules the activity to an alternative primary resource with lower mode costs.
The DS Optimizer uses the activity duration in seconds to calculate the mode costs.
Finally, the question on how to best balance the different objective criteria must get answered. One option can be to use a trial and error approach to find a suitable weighting that fits to your business requirements. A second approach can be to try to quantify the business requirements. For example, if a trade-off could be defined in a away, that one hour of additional setup time would be as bad as delaying an additional order by one day, then this would be an indicator that the weights for setup times and total delay should have a ratio of 24:1 to offset the different objectives (One hour setup time to 24 hours of delay).
In the optimization algorithm, there are some additional objective criteria present, that you cannot influence via weighting factors in the Optimization Profile.
The first one are deallocation costs. You can use the DS Optimizer to reduce the sum of the deallocation costs. Deallocation costs arise due to the deallocation of activities. The optimization assigns deallocation costs to a deallocated activity. These costs correspond to the shortest net duration of the modes of an activity. To reduce the deallocation costs for an activity, the DS Optimizer tries to schedule the activity without a delay during optimization. Optimization attempts to minimize the number of deallocated activities.
You cannot weight deallocation costs in the Optimization Profile to avoid inconsistent objective criteria. Instead, the DS optimizer calculates the weight internally such that a deallocated operation always causes higher costs than a scheduled one.
The second cost component that you cannot weigh in the Optimization Profile is the cost for fill level violations. Fill level violations can occur in tank planning scenarios, for example when more product is filled into a tank than its capacity can hold. Since it should be avoided in general that tanks go over the top, the optimizer calculates internally a penalty cost to avoid these situations. To keep consistency of this objective with other objective criteria, the weight is calculated internally and cannot be influenced via the Optimization Profile.

