Prioritizing vehicles / serving neighbourhoods

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

Prioritizing vehicles / serving neighbourhoods

Post by Bernd Welter »

I have a question about a recommended strategy for the following story:

Let's say
  • My vehicles are responsible for more or less dedicated "primary" areas: green vehicles, yellow vehicles, orange vehicles, red vehicles.
  • For an order there's a dedicated color, e.g. green.
  • now a gree order should be served based on some constraints / preferences:
    • red vehicles should not match at all
    • though orange, yellow and green can serve the order in general, I want an assignment to consider costs to control preferences:
      • if assignment is to "green vehicle": free of additional costs
      • if assignment is to "yellow vehicle": extra costs xx
      • if assignment is to "orange vehicle": extra costs yy ( alltogether 0 < xx < yy)
How to achieve this in the best way?
From a generic perspective I would prefer some kind of a n "adjacence" matrix approach...
Attachments
prioritizing vehicles.png
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:
TomDeDecker
Posts: 3
Joined: Tue Aug 22, 2023 2:32 pm

Re: Prioritizing vehicles

Post by TomDeDecker »

OptiFlow SaaS supports this in a pretty straightforward manner, through the order-vehicle costs feature.

These can be added at the order level: for each order, you can specify, based on the vehicle labels, which types of vehicles can take on the order, at what additional penalty cost. Notably, this cost can also be negative, if you want to award a certain bonus for picking a certain kind of vehicle, instead of a penalty.

When working via the Developer API instead, the feature to use is combination constraints of type FORBIDDEN_COMBINATION, with the addition of violationCosts.

(order Cat - vehicle Cat - violationCost)
AREA_GREEN - RED - (no cost)
AREA_GREEN - ORANGE - cost XX
AREA_GREEN - YELLOW - cost YY

We can omit GREEN vehicles, as these are free to execute the orders without additional costs.
For RED vehicles, we don't specify a violation cost, which turns this into a hard constraint.
For ORANGE and YELLOW, we do add a violation cost, to instead apply a soft constraint with associated penalties.

As far as generic approaches go, there isn't really one - figuring out the right set of combination constraints and costs will always be required during the modeling phase. I do want to note that for planners that value localized routes, the recently added compactness feature can be very useful as well. Based on the strength (value 0-1), it incentives OptiFlow to favor more trips that cover smaller geographical areas, similar (but not identical) to how the "clustering" feature works in SaaS.
Post Reply