Optimization: Use max_tasks in Vehicles

Hi,

I have 6 jobs and 2 vehicles, I would like each vehicle to take 3 jobs/tasks, so I set the max_tasks to 3 on each vehicle, but I got response back that one vehicle with 2 jobs and another one with 4 jobs.

Any idea how to fix that?
Thanks!
URL

https://api.openrouteservice.org/optimization

Input:

{
    "jobs": [
        {
            "id": 1,
            "location": [
                -71.6425,
                42.23124
            ]
        },
        {
            "id": 2,
            "location": [
                -71.61347,
                42.24185
            ]
        },
        {
            "id": 3,
            "location": [
                -71.58705,
                42.27714
            ]
        },
        {
            "id": 4,
            "location": [
                -71.58342,
                42.29466
            ]
        },
        {
            "id": 5,
            "location": [
                -71.61029,
                42.30476
            ]
        },
        {
            "id": 6,
            "location": [
                -71.65312,
                42.25062
            ]
        }
    ],
    "vehicles": [
        {
            "id": 1,
            "profile": "driving-car",
            "start": [
                -71.6291,
                42.26958
            ],
            "max_tasks": 3
        },
        {
            "id": 2,
            "profile": "driving-car",
            "start": [
                -71.60866,
                42.28406
            ],
            "max_tasks": 3
        }
    ]
}

Output:

{
    "code": 0,
    "summary": {
        "cost": 2787,
        "unassigned": 0,
        "service": 0,
        "duration": 2787,
        "waiting_time": 0,
        "computing_times": {
            "loading": 77,
            "solving": 1
        }
    },
    "unassigned": [],
    "routes": [
        {
            "vehicle": 1,
            "cost": 1123,
            "service": 0,
            "duration": 1123,
            "waiting_time": 0,
            "steps": [
                {
                    "type": "start",
                    "location": [
                        -71.6291,
                        42.26958
                    ],
                    "arrival": 0,
                    "duration": 0
                },
                {
                    "type": "job",
                    "location": [
                        -71.65312,
                        42.25062
                    ],
                    "id": 6,
                    "service": 0,
                    "waiting_time": 0,
                    "job": 6,
                    "arrival": 368,
                    "duration": 368
                },
                {
                    "type": "job",
                    "location": [
                        -71.6425,
                        42.23124
                    ],
                    "id": 1,
                    "service": 0,
                    "waiting_time": 0,
                    "job": 1,
                    "arrival": 1123,
                    "duration": 1123
                }
            ]
        },
        {
            "vehicle": 2,
            "cost": 1664,
            "service": 0,
            "duration": 1664,
            "waiting_time": 0,
            "steps": [
                {
                    "type": "start",
                    "location": [
                        -71.60866,
                        42.28406
                    ],
                    "arrival": 0,
                    "duration": 0
                },
                {
                    "type": "job",
                    "location": [
                        -71.61029,
                        42.30476
                    ],
                    "id": 5,
                    "service": 0,
                    "waiting_time": 0,
                    "job": 5,
                    "arrival": 249,
                    "duration": 249
                },
                {
                    "type": "job",
                    "location": [
                        -71.58342,
                        42.29466
                    ],
                    "id": 4,
                    "service": 0,
                    "waiting_time": 0,
                    "job": 4,
                    "arrival": 633,
                    "duration": 633
                },
                {
                    "type": "job",
                    "location": [
                        -71.58705,
                        42.27714
                    ],
                    "id": 3,
                    "service": 0,
                    "waiting_time": 0,
                    "job": 3,
                    "arrival": 908,
                    "duration": 908
                },
                {
                    "type": "job",
                    "location": [
                        -71.61347,
                        42.24185
                    ],
                    "id": 2,
                    "service": 0,
                    "waiting_time": 0,
                    "job": 2,
                    "arrival": 1664,
                    "duration": 1664
                }
            ]
        }
    ]
}

Hey,

this seems to have been a bug in VROOM that has since been fixed. However, our server is still running v1.10.

We’ll be looking to update that in the near future. You could try using their demo server that should run the latest version.

Best regards

Hi,

Thank you very much for the quick reply and links!

We are planning to use the service in our app that we plan to launch in production in couple months. Can I ask if you have estimated date that will be upgraded to the new version?

Thanks!
Eric