Potential Cost factors in Optiflow API

Questions refering to the Optiflow based API within PTV Developer (launched on 20.12.2023)
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2929
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Potential Cost factors in Optiflow API

Post by Bernd Welter »

As you know: Optiflow optimizes tour structures based on costs. A question that appears often on my screen is
Which cost factors are supported by Optiflow?
:!: The potential factors in API will be extended!

As of today (26.11.2024) the Route Optimization Optiflow API offers many different cost factors such as
  • Per Vehicle: Defines the costs for using the vehicle to execute tasks.
    • fix costs (Specifies the fixed cost for assigning a route to the vehicle.)
    • per kilometer (Specifies the cost for every kilometer driven with the vehicle.)
    • per hour (Specifies the cost for every hour the vehicle is used.)
    • per stop (Specifies the cost for every stop on the route of the vehicle.)
    • per overtimes: A list of overtime costs that describe an increasing cost if the route duration exceeds a threshold. For each exceeded threshold, the extra fixed cost and the additional cost for the extra hours contribute to the total cost of the route.
      • threshold : The threshold for the route duration (seconds) above which the extra cost per hour applies.
      • extraFixed : Specifies the extra fixed cost when exceeding the threshold.
      • extraPerHour : Specifies the extra cost for every hour above the threshold.
    • overdistances: A list of overdistance costs that describe an increasing cost if the total distance of a route exceeds a threshold. For each exceeded threshold, the extra fixed cost and the additional cost for the extra kilometers contribute to the total cost of the route.
      • threshold : The threshold for the route's total distance (meters) above which the extra cost per kilometer applies.
      • extraFixed: Specifies the extra fixed cost when exceeding the threshold.
      • extraPerKilometer : Specifies the extra cost for every kilometer above the threshold.
    • overstops : A list of overstop costs that describe an increasing cost if the number of stops of a route exceeds a threshold. For each exceeded threshold, the extra fixed cost and the additional cost for the extra stops contribute to the total cost of the route.
      • threshold : The threshold for the route's number of stops above which the extra cost per stop applies.
      • extraFixed : Specifies the extra fixed cost when exceeding the threshold.
      • extraPerStop : Specifies the extra cost for every stop above the threshold.
    • repositioningEfforts: Specifies a list of repositioning effort costs that describe an increasing cost if the route's repositioning effort exceeds a threshold. When two orders are loaded into the same compartment and delivered in the same order, we refer to them as a non-last-in-first-out (non-LIFO) pair. Any non-LIFO pair of orders requires repositioning in the vehicle, as the last picked-up order obstructs the first order that needs to be delivered. The effort involved in this repositioning is the minimum effort required for the two orders. The total repositioning effort for the route is the sum of the repositioning efforts for all non-LIFO pairs of orders.
      • threshold : The threshold for the repositioning effort from which the cost per effort applies.
      • extraPerEffort : Specifies the extra cost for every unit of effort above the threshold. If the threshold of multiple repositioning effort costs is exceeded, the extra costs per effort are added.
  • Per Location:
    • costPerAppointment : Describes the cost for assigning an appointment to this time slot.
    • per concurrent ramp...
      • vehicleSlots.cost : The cost incurred when assigning at least one stop to this vehicle slot.
      • violationCostPerExtraSlot : The additional cost incurred for using an extra vehicle slot beyond the available ones. This must be greater than or equal to the cost of each vehicle slot.
  • Per Order
    • Outsourcing costs: Defines the cost for not scheduling the order on a route. This cost is weighed against the cost of scheduling the order on a route. When omitted the optimization will try to schedule the order regardless of the added cost.
  • per violated Constraint:
    • combinations.orderVehicle.violationCost : The cost incurred when an order-vehicle combination does not meet this constraint. When omitted, all order-vehicle combinations must satisfy this constraint.
    :!: There are more constraints defined but not all of them offer a violation cost property. These constraints are hard constraints.
  • Per Resource (1.24.0 / 26.09.2025): Defines the costs for assigning the resource to vehicles.
    • fixed : A one-time fixed cost incurred when this resource is used, regardless of how many vehicles use it.
    • perVehicle : The cost charged for each vehicle that uses this resource.
    • overVehicles.threshold : The threshold for the number of vehicles assigned to the resource above which the extra costs apply.
    • overVehicles.extraFixed : Specifies the extra fixed cost when exceeding the threshold.
    • overVehicles.extraPerVehicle : Specifies the extra cost for every assigned vehicle above the threshold.
This list covers a subset of a way bigger set of contributing factors and we will extend the API step by step.
If you spot a cost factor in the SaaS Excel definition you are interested in get back to us and we can check whether and when it is on our roadmap.

Bernd
Attachments
Decrease of total cost during a 1min planning (gathered every 5 seconds). This visualization shows the different contributions including the decrease of unscheduled orders (red).
Decrease of total cost during a 1min planning (gathered every 5 seconds). This visualization shows the different contributions including the decrease of unscheduled orders (red).
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
User avatar
Bernd Welter
Site Admin
Posts: 2929
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Potential Cost factors in Optiflow API

Post by Bernd Welter »

By the way:

check the section Cost+vs.+Objective in the official SaaS documentation!

Thanks to Tim for redirecting me!

Enjoy your christmas vacation and get well into 2025 ;-)
bernd nikolaus 2019.face only.jpg
bernd nikolaus 2019.face only.jpg (18.42 KiB) Viewed 6498 times
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
User avatar
Bernd Welter
Site Admin
Posts: 2929
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Potential Cost factors in Optiflow API

Post by Bernd Welter »

added the resource costs ("resources" are available as of 25.09.2025 / 1.24.0) to the article
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply