"cannot serve required skill"

I ran the optimization for 5 services, 3 of which required a specific skill. One of the available vehicles had the required skill; two of these services were assigned, while one was not, and the error message stated: ‘cannot serve required skill.’

Can you provide a reason for this? I would expect all three orders requiring the skill to be assigned to the same vehicle.

{
    "configuration": {
        "routing": {
            "calc_points": true,
            "return_snapped_waypoints": true
        }
    },
    "objectives": [
        {
            "type": "min",
            "value": "completion_time"
        }
    ],
    "vehicles": [
        {
            "vehicle_id": "AUT004",
            "type_id": "small_truck",
            "start_address": {
                "location_id": "sede_nuova_cogea",
                "lon": 7.7150116,
                "lat": 44.9719126
            },
            "return_to_depot": true,
            "skills": [],
            "shifts": [
                {
                    "shift_id": "05:00_16:00",
                    "start_address": {
                        "location_id": "sede_nuova_cogea",
                        "lon": 7.7150116,
                        "lat": 44.9719126
                    },
                    "earliest_start": 1725937200,
                    "latest_end": 1725976800
                }
            ],
            "break": {
                "earliest": 1725958800,
                "latest": 1725962400,
                "duration": 3600
            },
            "earliest_start": 1725937200,
            "latest_end": 1725976800,
            "max_driving_time": 18000
        },
        {
            "vehicle_id": "AUT003",
            "type_id": "small_truck",
            "start_address": {
                "location_id": "sede_nuova_cogea",
                "lon": 7.7150116,
                "lat": 44.9719126
            },
            "return_to_depot": true,
            "skills": [],
            "shifts": [
                {
                    "shift_id": "09:00_18:00",
                    "start_address": {
                        "location_id": "sede_nuova_cogea",
                        "lon": 7.7150116,
                        "lat": 44.9719126
                    },
                    "earliest_start": 1725951600,
                    "latest_end": 1725984000
                }
            ],
            "break": {
                "earliest": 1725966000,
                "latest": 1725969600,
                "duration": 3600
            },
            "earliest_start": 1725951600,
            "latest_end": 1725984000,
            "max_driving_time": 28800
        },
        {
            "vehicle_id": "AUT002",
            "type_id": "small_truck",
            "start_address": {
                "location_id": "sede_nuova_cogea",
                "lon": 7.7150116,
                "lat": 44.9719126
            },
            "return_to_depot": true,
            "skills": [
                "PERMISSION_001"
            ],
            "shifts": [
                {
                    "shift_id": "05:00_14:00",
                    "start_address": {
                        "location_id": "sede_nuova_cogea",
                        "lon": 7.7150116,
                        "lat": 44.9719126
                    },
                    "earliest_start": 1725937200,
                    "latest_end": 1725969600
                }
            ],
            "break": {
                "earliest": 1725955200,
                "latest": 1725958800,
                "duration": 3600
            },
            "earliest_start": 1725937200,
            "latest_end": 1725969600,
            "max_driving_time": 3600
        }
    ],
    "vehicle_types": [
        {
            "type_id": "small_truck",
            "profile": "small_truck",
            "capacity": [
                7000,
                7000
            ]
        }
    ],
    "services": [
        {
            "id": "929$17",
            "name": "Via Carlo Alberto, 42\r\rTORINO\rITALY",
            "duration": 300,
            "address": {
                "location_id": "Via Carlo Alberto, 42\r\rTORINO\rITALY",
                "street_hint": "Via Carlo Alberto, 42\r\rTORINO\rITALY",
                "lon": 7.6819519,
                "lat": 45.0624859
            },
            "type": "delivery",
            "size": [
                300,
                300
            ],
            "required_skills": [
                "PERMISSION_001"
            ],
            "time_windows": [
                {
                    "earliest": 1725955200,
                    "latest": 1725966000
                }
            ]
        },
        {
            "id": "930$17",
            "name": "Via Resegone, 25\r\r20084 RIVOLI\rITALY",
            "duration": 300,
            "address": {
                "location_id": "Via Resegone, 25\r\r20084 RIVOLI\rITALY",
                "street_hint": "Via Resegone, 25\r\r20084 RIVOLI\rITALY",
                "lon": 9.1553843,
                "lat": 45.3954587
            },
            "type": "delivery",
            "required_skills": [
                "PERMISSION_001"
            ],
            "time_windows": [
                {
                    "earliest": 1725919200,
                    "latest": 1726005540
                }
            ]
        },
        {
            "id": "931$17",
            "name": "Via Madama Cristina, 53\r\rTORINO\rITALY",
            "duration": 300,
            "address": {
                "location_id": "Via Madama Cristina, 53\r\rTORINO\rITALY",
                "street_hint": "Via Madama Cristina, 53\r\rTORINO\rITALY",
                "lon": 7.679192,
                "lat": 45.0524391
            },
            "type": "delivery",
            "size": [
                300,
                300
            ],
            "required_skills": [
                "PERMISSION_001"
            ],
            "time_windows": [
                {
                    "earliest": 1725951600,
                    "latest": 1725984000
                }
            ]
        },
        {
            "id": "42$33",
            "name": "Destinazione 1",
            "address": {
                "location_id": "Destinazione 1",
                "street_hint": "Destinazione 1",
                "lon": 7.6271546,
                "lat": 45.0972003
            },
            "type": "service"
        },
        {
            "id": "7$1250000001",
            "name": "Via XX Settembre, 79\r\r10128 TORINO\rITALY",
            "duration": 300,
            "address": {
                "location_id": "Via XX Settembre, 79\r\r10128 TORINO\rITALY",
                "street_hint": "Via XX Settembre, 79\r\r10128 TORINO\rITALY",
                "lon": 7.68146668754212,
                "lat": 45.06869854999999
            },
            "type": "delivery",
            "size": [
                0,
                0
            ]
        }
    ]
}

The problem is that service 930$17 is located here, i.e. 1h30min from the depot.

And you specified "max_driving_time": 3600. Unfortunately in this case it does not directly point to this “reason” because if you lift the skill constraint it would also be able to include the service (for a different vehicle).

So please be aware of potential confusing (but in the end not wrong) reasons we return :slight_smile: … The reasons we return are also based on a heuristic and are not guaranteed to be “correct”. Maybe we should return more than one reason in case more than one is likely.