Skip to main content
GuidesAPI ReferenceExamples

Configuration Parameters

|

Configuration Parameters class in Rest API define key settings that influence the behavior of the route optimization process. These settings determine aspects such as optimization goals, search time limits, and flexibility in handling orders. Proper configuration ensures that the algorithm meets the operational constraints of the routing problem.

Configuration Parameters Structure

Each Configuration Parameter consists of:

NameTypeDescription
NameStringThe name of the optimization/route configuration.
IgnoreTimeWindowbool

Specifies whether time-windows are ignored during optimization. Default is false.
⚠️ Not available for e-bikes

AllowDroppingOrdersbool

Specifies whether the algorithm is allowed to drop orders if no solution is found by visiting all of them. Default is false.
⚠️ Not available for e-bikes

BalancedRoutesInteger

Specifies the option to balance routes of an optimization.
⚠️ Not available for e-bikes
Possible values:
0 - None: No balancing.
1 - By time: Balance by time.
2 - By number of orders: Balance by the number of orders.

OptimizationCriterionInteger

Specifies the optimization criterion.
⚠️ For e-bikes, optimization is always by time
Possible values:
0 - Time: The problem will be optimized by distance.
1 - Distance: The problem will be optimized by time.

ArrangeCriterionInteger

Specifies the arrangement criterion for optimizing time.
⚠️ Not available for e-bikes
Used only if OptimizationCriterion = 1 (Distance).
Possible values:
0 - Matrix: Orders are arranged based on matrix distance.
1 - Euclidian: Uses the rounded straight-line (Euclidean) distance between orders.
2 - Exact Euclidian: Uses precise (decimal) straight-line distance between orders.
3 - Geodesic: Considers Earth's curvature in straight-line distance calculation.
4 - Manhattan: Uses the Manhattan (grid-based) distance formula.

OptimizationQualityInteger

Specifies the optimization quality (solution accuracy).
⚠️ For e-bikes, only Unoptimized (0) and Optimized (2) options are available
Possible values:
0 - Unoptimized: The algorithm will return an unoptimized solution.
1 - Fast: The algorithm will return the first solution found. (Not an accurate solution)
2 - Optimized: The algorithm will return an optimized solution.
3 - Best: The algorithm will return the best solution found in the specified time.

MaxSearchTimeunsigned int

Maximum time (in seconds) the algorithm can search for a solution. This parameter is considered only when the Optimization Quality is set to OQ_Best. Default is 300 seconds.
⚠️ Not available for e-bikes

MaxWaitTimeunsigned int

Maximum time (in seconds) that vehicles can wait at an order to align with the next order's time window. Default is INT_MAX.
⚠️ Not available for e-bikes

RouteTypeInteger

Specifies the route type.
Possible values:
0 - RoundRoute: The route will return at the first order (circuit).
1 - EndAnywhere: The route will end at the most efficient order selected by the algorithm.
2 - CustomEnd: The route will end at the specified order.

RestrictionsInteger

Specifies road restrictions for distance and time matrix calculations.
⚠️ This feature will be available in an upcoming release.
Possible values:
0 - None: No restrictions.
1 - Tolls: Avoid toll road restriction.
2 - Highways: Avoid highways restriction.

DistanceUnitInteger

Specifies the unit of distance used in optimization and routing calculations.
Possible values:
0 - Kilometers: Distance in kilometers.
1 - Miles: Distance in miles.

OrderSequenceOptionsOrdersSequenceMap

Specifies the association between different orders that should be visited in a certain order.
⚠️ Not available for e-bikes
Format: A map where each pair contains an enum and a list of lists, where each inner list is a sequence of order IDs.

Example

{
"configurationParameters": {
"name": "Test Optimization",
"ignoreTimeWindow": false,
"allowDroppingOrders": true,
"groupingOrders": false,
"balancedRoutes": 0,
"optimizationCriterion": 1,
"arrangeCriterion": 0,
"optimizationQuality": 2,
"maxTimeToOptimize": 600,
"maxWaitTime": 18000,
"routeType": 0,
"restrictions": 0,
"distanceUnit": 0,
"orderSequenceOptions": []
}
}

Explanation

This setup configures an optimization with the following characteristics:

  • "Test Optimization" as the instance name – Identifies the optimization session.
  • Time windows are respected (ignoreTimeWindow = false) – Ensures that orders are scheduled within their specified delivery windows.
  • Orders can be dropped if needed (allowDroppingOrders = true) – Allows the algorithm to exclude unserviceable orders.
  • No grouping of nearby orders (groupingOrders = false) – Each order is treated individually regardless of proximity.
  • No route balancing applied (balancedRoutes = None (0)) – The algorithm does not attempt to balance workloads across routes.
  • Optimization is based on travel distance (optimizationCriterion = Distance (1)) – The algorithm prioritizes routes with shorter total distance.
  • Arrangement is done using matrix-based distance (arrangeCriterion = Matrix (0)) – Orders are arranged based on distance matrix calculations.
  • Optimized solution quality is targeted (optimizationQuality = Optimized (2)) – Provides a well-refined solution without exhaustive search.
  • Maximum optimization time is limited to 600 seconds (maxTimeToOptimize = 600) – Constrains algorithm runtime for performance.
  • Vehicles can wait up to 5 hours at an order (maxWaitTime = 18000) – Allows schedule alignment with time windows.
  • Each route is circular (routeType = RoundRoute (0)) – Routes start and end at the same location.
  • No road restrictions applied (restrictions = None (0)) – All roads, including tolls and highways, are considered.
  • Distance is measured in kilometers (distanceUnit = Kilometers (0)) – Units used in optimization calculations.
  • No specific order sequence constraints (orderSequenceOptions = []) – Orders can be visited in any sequence.