Effective optimization: Utilization and why you should avoid cost-functions
In this blog I want to cover two frequent questions:
- I want to have only FORs with more than x% utilization
- I want to distribute the freight between two FORs in a specific way
I want to discuss this scope from different views. We will start with some thoughts what the optimizer can do to influence the utilization. After that we will look at the non-delivery cost to model filler products to increase the utilization. After an introduction of the feature minimal utilization we will end with a very deep look into the load cost functions.
What can the optimizer do for utilization?
Let’s look from the engine side on the utilization. If you call the optimizer you define a selection of the fright you want to plan. That means the backlog for planning is defined completely. The optimizer cannot decide to add some other Freight Units just to fill the truck. It might only decide to not plan some freight.
The optimizer engine has two remaining possibilities to achieve a high utilization.
a) It can select the best fitting resource for a freight order
b) It can decide about the distribution of the freight units to the freight orders, to get combination filling a truck nearly completely.
Method a) seems clear. It is, what we usually expect. Don’t use a large track, if you can do it with a smaller one. By setting the right costs for the truck this should work. You just need a little bit more cost for the larger trucks.
Method b) is more sophisticated. Let’s assume we have some Freight Units from location A to location B. Now we have an additional Freight Unit from C to B. should we add it to the Freight Order from A to B to get a higher utilization in a FOR A->C->B?
- If we speak about the utilization, we improved it only for the stage A->C. The stage C->B is new but with the former utilization of A->B. that means we improved the stage with the highest utilization only. It is important to mention, that the optimizer always considers the most utilized stage as the utilization of a freight order.
- It might be, we drive some extra distance to include C into this freight order. Do we want that? Where is the threshold, which decides if it is better to consolidate with a high utilization or to split and find a plan with less distance?
The second point shows us, that the min utilization is directly influencing the consolidation of the freight units into freight orders. That means we have to define the rules for the utilization very carefully. As the optimizer cannot create additional freight units, it is forced to check such consolidations, if we add utilization as constraint or penalty.
Therefore the penalties for not reaching the target utilization must be very small. Otherwise the optimization will end up in freight order with a high utilization on one leg but a terrible routing.
It is a usual practice, that you have some filling materials. If your truck is not full, but you need to start the transport, you load some additional products, which are usually cheap and recently transported. For example if you supply a store you might put some toilet-paper on top of the other products just to fill the truck. This allows you to save some capacity for the next days.
It might be one possibility to ignore this additional filling freight in planning completely. Execution decides about the additional products and you just reduce the transportation demand of the following days.
But if you want to plan the filling-products, we must select them for the optimization run, so that the engine can decide, if they are additionally planned or not. In this case we have to express, which Freight Units are important and must be transported today. And which fright units are filler and optional. You do that via a determination to define very low non-delivery cost for the filler freight units, but high non-deliver cost for the important freight. If your transportation cost for resources and distances is somewhere between, the optimizer will create freight orders for the important freight units. It will use up the remaining capacity for the filler products. But it will not be able to create new freight orders if the cost for an additional freight order is higher than the non-delivery-cost of the fillers.
This cost setting might be a little tricky. Because of that I want to mention to alternatives. The second one is my favorite, as it doesn’t touch attributes of the freight unit and therefore has no side-effects.
- Instead of non-delivery cost you can use the time windows. The important freight units have concrete hard time windows. The windows of the fillers are much larger. Perhaps a week instead of a day in daily planning. This allows the optimizer to add filler to the other products. At the end the remaining fillers are planned in their own FOR which can be deleted afterwards.
- You work with two Freight unit selections. First plan the important Freight units only. In a second run you use the incremental planning to add as much fillers to the existing freight orders of the important products. You must forbid to create any new freight order. Since TM 9.4 you can do that in the planning cost profile. In older releases you have to define very high fix cost to avoid new freight orders. The second run can be very fast. Usually I use the time automatic and select the option” fastest”. As no new freight orders are needed only the adding to the existing ones is needed, which is done very fast.
The thought above showed, that considering the utilization as goal during the optimization needs a very sophisticated penalty setting for under-utilization. To circumvent this issue TM supports a feature under-utilization beginning with version 9.4.
The idea is not to handle the utilization during the optimization, but to do only a simple post-processing to clean up the freight orders. The optimizer is planning as usual. Only at the end it is checking if there are freight orders below the specified minimal utilization. Then it tries to re-plan this freight unit and to put it on other freight orders. Doing so only very view freight units should remain on the under-utilized freight orders. After the optimization the manual planner has to decide, what to do with these remaining freight orders.
So far I don’t have much feedback on this feature. Your feedback would be very welcome.
Another feature in this area are the load-cost-functions. load-cost-functions are a feature in standa alone TM. But they are no longer supported inside S/4. If you want to use them in S/4, you need to do that via BAdI.
For load-cost- functions we have a lot of feedback, mostly because they are so difficult to use. Because of that the first rule for load-cost-functions: Please check first if the two–step approach or the minimal utilization is a good approach for you. Only after that start to think of the load-cost functions.
Very often we receive models with a load-cost function like that:
The idea behind was to express, that a load above a threshold is ok. Below this threshold it is bad. First of all we need to see, that we have additional cost and we run in all the issues about the consolidation like described above. We risk crazy routings and consolidations. Because of that the second rule for load cost functions: Use only very small penalties.
The load-cost function should influence the optimizer in such a way, that it prefers full loads instead of several small loads. Let’s think about the effect on the optimization algorithm. As you might know the most important step is the insertion of a freight unit into a partial plan:
The described load cost function is penalizing the creation of a new freight order for the next freight unit. But it doesn’t really help the engine to decide between several freight orders, which are not utilized enough. This means after planning the first freight units and crating some freight orders into different directions the optimizer has already some load-cost, but doesn’t see how to resolve that, as it adds freight unit by freight unit without look-ahead. So the optimizer has to pay several load-cost in the hope to reduce it later. For the optimizer this look like a fitness- function for the overall plan like that:
If you play golf you might see the problem to get the ball into the small whole. For the optimizer it is the same. It is much easier if we have a fitness landscape like in the following diagram. We speak about convex problems, which are usually much easier to solve, as you can improve in small steps and the landscape is guiding you to the optimal solution. Of course this would be boring for golf. But it is a big help for optimization
We can help the optimizer and add some guidance into the cost function by making it convex. We can express, that the cost function for a newly added freight order should be high if there is no load. And it should be low, if we nearly reach or fulfill the threshold for utilization. This leads us to a cost function like that:
Beside of all this hints, the cost functions still have the tricky influence into the routing a consolidation. Because of that, let’s repeat and complete the golden rules for load-cost functions.
- Check if you can reach you goal without load-cost functions (for example several runs or min. utilization)
- Use very small penalties.
- Guide the engine with an convex load cost function
- Check your results very carefully.
Please note that TM for S/4HANA no longer supports maintaining load cost functions in the planning profile. If you want to use it despite rule #1 you must fall back on using the preprocessing BAdI.