So basically "alternatives" are required for different purposes:
- A user wants to compare different approaches based on different input settings
- illusion of choice you want to enable a user to pick something by himself based on whatever criteria applies
- 3 vehicle profiles
- small / medium / large truck
- truck uses ferries without special handling / truck avoids ferries / truck does not use ferries at all
- 3 times of departure
- 3 tarrifs for "price per kilometer"
- or any other variability
Besides these approaches the ABSTRACT approach also offers a built-in mechanism for "alternative routing". As you may know the abstract approach computes the "price" of a segment based on a virtual tarrif scheme which is influenced by many (often quite confusing) malus values and the "optimal route" is the route that minimizes the abstract costs.
Now computing alternatives based on ABSTRACT simply means to proceed as follows:
- Compute the base route aka zero alternative
- then increase the price for all segments of the zero route and calculate the first alternative
- then increase the price for the 1st alternatives segments, too - and so on.
And for all the AlternativeRoute computed under the roof we simply return the driving time, distance, polygon and the binary path which can be used to quickly recalculate the complete route object for an alternative if needed. Check the PathWaypoint! This approach works only with pure A:B routing with 2 stops. As it is based on "abstract" costs (which are no longer returned in the xRoute2) it is often difficult for the user to understand the meaning of such alternatives.
If you want more info - get back to me.
Best regards,
Bernd