VRP Response

Solution

The solution endpoint returns the solution of the solve job. It contains the score, the trips and the violations.

NameTypeDescription
statusStringStatus of the Response (QUEUED, SOLVING, SOLVED or ERROR)
score[Score]Score tells you how good a solution is.
unresolvedanyConstraints that are violated
trips[Trip]Actual solution: trips per workingtime/day and per resource
totalWaitTimeInSecondsinteger(int64)Wait time for all resources
totalTravelTimeInSecondsinteger(int64)Travel time for all resources
totalTravelDistanceInMetersinteger(int64)Travel distance for all resources
totalServiceTimeInSecondsinteger(int64)Service time for all resources
unserved[string]When options.partialPlanning is set, then this might result in a list of jobs that are unserved and not in the planning.
violations[Violation]A constraint that is broken in the current solution with a certain value (penalty) and a certain level (hard, soft, medium).]
workloadFairnessnumber(double)How fair a certain workload is divided over the resources.

Example:

{
  "score": {
    "hardScore": 0,
    "mediumScore": -25200,
    "softScore": -6924,
    "feasible": true
  },
  "trips": [
    {
      "visits": [
        {
          "arrival": "2023-01-13T08:44:54",
          "job": "JOB-6",
          "location": "50.89633806889935;4.45161298168845"
        },
        {
          "arrival": "2023-01-13T10:21:25",
          "job": "JOB-5",
          "location": "50.94837893617721;4.001604640663746"
        },
        {
          "arrival": "2023-01-13T11:55:17",
          "job": "JOB-10",
          "location": "50.78868282668716;4.167956383823208"
        }
      ],
      "resource": "R-1",
      "date": "2023-01-13",
      "departureTime": "2023-01-13T08:00:00",
      "waitTime": 0,
      "travelTime": 6917,
      "workTime": 17717,
      "serviceTime": 10800
    }
  ],
  "totalTravelTimeInSeconds": 6917,
  "totalServiceTimeInSeconds": 10800,
  "workloadFairness": 0.5,
  "unserved": [
    "JOB-1",
    "JOB-2",
    "JOB-3",
    "JOB-4",
    "JOB-7",
    "JOB-8",
    "JOB-9"
  ],
  "status": "SOLVED"
}

Score

NameTypeDescription
hardScoreinteger(int64)The score of the constraints that are hard. This should be 0 in order to be feasible.
mediumScoreinteger(int64)The score of the constraints that are medium.
softScoreinteger(int64)The score of the constraints that are soft.
feasiblebooleanFeasibility of the solution is determined by the fact if there are violated hard constraints or not.

Trip

NameTypeDescription
visitsVisitVisits of the trip.
resourcestringResource name
datestringDate of the trip
departureTimestringDeparture time of the trip
waitTimeinteger(int64)Wait time of the trip
travelTimeinteger(int64)Travel time of the trip
workTimeinteger(int64)Work time of the trip
serviceTimeinteger(int64)Service time of the trip

Visit

NameTypeDescription
arrivalstringArrival time of a job
jobstringJob name
locationstringLocation of the visit

Score

Explanation

The explanation endpoint returns the score and the constraints that are violated in the current solution.
It can give the insights into why a solve was like it is.

NameTypeDescription
scoreScoreScore
conflictsConflictConflicts
unresolvedUnresolvedUnresolved constraints

Example:

{
  "score": {
    "hardScore": 0,
    "mediumScore": -25200,
    "softScore": -6924,
    "feasible": true
  },
  "unresolved": [
    {
      "constraint": "JOB_DAY_INDEX",
      "score": "-7soft"
    },
    {
      "constraint": "TRAVEL_TIME",
      "score": "-6917soft"
    },
    {
      "constraint": "UNUSED_RESOURCES",
      "score": "-25200medium"
    }
  ]
}

Unresolved

NameTypeDescription
constraintstringRouting constraint name
scorestringscore of this constraint

Conflict

NameTypeDescription
constraintRoutingConstraintRouting constraint name
scorestringscore of this constraint
jobstringjob name in this conflict
resourcestringresource name in this conflict
tagstringtag name in this conflict

Constraint

NameDescriptionImpact
UNUSED_RESOURCESThere are resources that are not used.medium
JOB_DAY_INDEXThe job is not planned on the day it should be planned.soft
TRAVEL_TIMEThe travel time is too long.soft
JOB_TIME_WINDOWThe job is not planned in the time window.soft
JOB_SKILLSThe job is not planned on a resource that has the required skills.soft
PRIORITYA priority job that should be in the planningsoft