GET
/
v2
/
vrp
/
jobs
/
{id}
/
explanation
Explanation
curl --request GET \
  --url https://api.solvice.io/v2/vrp/jobs/{id}/explanation \
  --header 'Authorization: <api-key>'
{
  "score": {
    "hard": -2000,
    "soft": -15000,
    "feasible": false
  },
  "conflicts": [
    {
      "constraint": "TIME_WINDOW_CONFLICT",
      "score": "-1000",
      "job": "Job-1",
      "resource": "vehicle-1"
    },
    {
      "constraint": "TAG_HARD",
      "score": "-1000",
      "job": "Job-2",
      "resource": "vehicle-1",
      "tag": "electrical"
    }
  ],
  "unresolved": [
    {
      "constraint": "TRAVEL_TIME",
      "score": "-15000"
    }
  ],
  "alternatives": {
    "Job-1": [
      {
        "job": "Job-1",
        "resource": "vehicle-2",
        "suggestedArrival": "2023-01-13T09:30:00Z",
        "latestArrival": "2023-01-13T10:00:00Z",
        "executedAfter": "Job-0",
        "score": {
          "hard": 0,
          "soft": -1500,
          "feasible": true
        }
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Api Key based authentication (apikey)

Path Parameters

id
string
required

Response

Status

Explains the conflicts of a certain routing solution and the unresolved constraints.

score
object
required

Score of the solution.

conflicts

Conflicts in the solution

Examples:
{
"constraint": "TIME_WINDOW_CONFLICT",
"score": "-1000",
"job": "Job-1",
"resource": "vehicle-1"
}
unresolved

Unresolved constraints in the solution

Examples:
{
"constraint": "TRAVEL_TIME",
"score": "-1500"
}
alternatives
object | null

When options.explanation.enabled is set to true, this field will contain the alternatives for the solution.The key is the job name and the value is the list of assignments. Each assignment contains the resource, the date, and the score. In this way, you can check the impact of the alternative on the score.

Examples:
{
"Job-1": [
{
"job": "Job-1",
"resource": "vehicle-2",
"suggestedArrival": "2023-01-13T09:30:00Z",
"latestArrival": "2023-01-13T10:00:00Z",
"executedAfter": "Job-0",
"score": {
"hard": 0,
"soft": -1500,
"feasible": true
}
}
]
}