How to understand and use Violations and UnscheduledOrders (xtour1)

This forum deals with any kind of trip optimization based on xTour1, xTour2 and the Developer APIs "RouteOptimization" and "SequenceOptimization". No matter whether it is automatic planning or manual dispatching, refering to transport orders or service planning.
Attention: this does not refer to PTV Optiflow SaaS and PTV Developer RouteOptimization Optiflow.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2689
Joined: Mon Apr 14, 2014 10:28 am
Contact:

How to understand and use Violations and UnscheduledOrders (xtour1)

Post by Bernd Welter »

Hi there,

every once in a while users of an optimization tool face some of the following conditions:

After an automated planning call one or more orders remain unscheduled or the result tour is supposed to be "not optimal" ("I guess I have a better sequence in mind"). Now the dispatcher wants to know the cause for such a result.

To support the search for the cause we offer two elegant mechanisms I'd like to draw your attention to:
#1: perform a so-called "UnscheduledOrderAnalysis". This will tell you about orders which remain unscheduled after a creative phase (such as construction or improvement)
#2: cross check whether "the better sequence" is really valid, i.e. whether it takes care of 100% of the given restrictions. If not: "it is not a better sequence" which means "the dispatchers assumption was wrong".

Now let's check #1 first:

Be aware that potential causes can be separated into the following categories:
  • The order itself is the cause! No resource would be able to deal with the order because of insufficient skills, not matching opening times (or not both at the same time). This is UNSCHEDULED_DUE_TO_VEHICLES (The stop was not planned due to the vehicles. For example there was no suitable vehicle or there are already other stops in the tour.)
  • Though there would be resources matching all required skills, opening times and capacity restrictions there is some other (global) restriction that prevents us from scheduling the order, e.g. there are too many orders at all so a tour would exceed an operating interval or maximum tour length. This is a UNSCHEDULED_DUE_TO_PLAN.
  • Well: sometimes an order could be scheduled but we just didn't find the solution. Maybe the algorithm requires more time for an improvement phase or the heuristics just fail due to suboptimal processing sequence. This kind of a cause is called FEASIBLE: The stop is not scheduled in the input plan but it could be scheduled without a violation. The reason why this stop is not scheduled is most likely the fact that the construction step refuses to schedule stops that do not match some general conditions such as the maximum earliness. The improvement stop will schedule the stop then, so please switch on the improvement stop. Correction 17.5.2023: Even an active ImprovementStep does NOT guarantee that such a feasible order gets scheduled. This is because IMPRO is also just a heuristic!
To trigger the UnscheduledOrderAnalysis in xTour you can either
  • use the UnscheduledOrderAnalysisParams class in combination with an input plan and a set of order IDs
  • or use the StandardParams (or any subclass) property maximumNumberOfUnscheduledOrdersToBeAnalyzed which will then determine and analyze some of the unscheduled orders.

Depending on the number of unscheduled orders to be analyzed the performance of a call may decrease.

#2 "better sequence": To evaluate whether the dispatchers assumption is right just provide the input plan based on the better sequence in combination with CalculationParams. Then check whether the output plan is violated (assumption was wrong) or not. In the later case our heuristics may just have failed.

Best regards,
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:
clvo
Posts: 6
Joined: Thu Jun 02, 2022 7:42 am

Re: How to understand and use Violations and UnscheduledOrders

Post by clvo »

Hello Bernd,

you wrote:
To trigger the UnscheduledOrderAnalysis in xTour you can either
use the UnscheduledOrderAnalysisParams class in combination with an input plan and a set of order IDs
or use the StandardParams (or any subclass) property maximumNumberOfUnscheduledOrdersToBeAnalyzed which will then determine and analyze some of the unscheduled orders.
Is there also a possibility to find out why orders are not planned with the Sequence-Optimization-API?
Because I have a sample where I cannot understand/findout why orders are not planned...
Thanks in advance!
BR Claus
User avatar
Bernd Welter
Site Admin
Posts: 2689
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: How to understand and use Violations and UnscheduledOrders

Post by Bernd Welter »

Hello Claus,

at least it is more complicated /less supported out of the box. I recommend that you first get back to me 1:1 (just send the request to me via email).
I will check it and if needed I will include dev. Here's some core info:

Meanwhile PTV offers a real set of "transport optimization APIs" and the answer to "how to analyze unscheduled orders?" depends on the API:
PTV xTour1Use the built-in unscheduledOrderAnalysis based on
PTV xTour2Requires to apply So this approach is based on some additional, more or less complex business logic:
  • Order is returned as "unplanneable" : construct a single input trip for each vehicle (Vehicle.StartLocation / Order / Vehicle.EndLocation) and check which violations occur. Uses ChangeToursRequest
  • Order is returned as "unplanned but not unplanneable" : request changeToursActions for each trip and insertion position and check ... uses FindChangeToursProposalsRequest
PTV Developer : PTV Sequence Optimization APIIs based on the same VRP solver as PTV xTour2 but from the four xTour2 methods only the standard "planTours" is covered in Developer.
PTV Developer : PTV Route Optimization APISame as PTV Sequence Optimization API
PTV Developer : PTV Route Optimization OPTIFLOW API as of today (29.08.2024) this API does not offer an analysis feature :cry:


C u,
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:
Post Reply