reinterpretcat / vrp

A Vehicle Routing Problem solver
https://reinterpretcat.github.io/vrp/
Apache License 2.0
331 stars 68 forks source link

`minimize-tours` objective seems to be used in any case if `maximize-tours` didn't #50

Closed iedmrc closed 2 years ago

iedmrc commented 2 years ago

Hi, Tried different combinations of objectives and came up with solutions that only have one tour (without using any constraints such as times, capacity etc..) except if I use maximize-tours. Some examples:

Returns a route with just one tour:

    "objectives": [
        [
            {
                "type": "minimize-unassigned"
            }
        ],
        [
            {
                "type": "minimize-cost"
            }
        ]
    ]
    "objectives": [
      [
        {
          "type": "minimize-unassigned"
        }
      ],
      [
        {
          "type": "tour-order",
         "options": {
            "isConstrained": false
          }
        }
      ],
      [
        {
          "type": "minimize-cost"
        },
        {
          "type": "balance-activities",
          "options": {
            "threshold": 0.01
          }
        }
      ]
    ]

and so on..

Only if I add maximize-tours to the objectives I get more than one tour.

    "objectives": [
        [
            {
                "type": "minimize-unassigned"
            }
        ],
      [
        {
          "type": "maximize-tours"
        }
      ],
        [
            {
                "type": "minimize-cost"
            }
        ]
    ]

Is minimize-tours a default objective in any case? If not, I'm totally sure that there are such cases that are less costly by using more vehicles (i.e. more tours).

reinterpretcat commented 2 years ago

No, minimize-tours is not default and not used when not specified. However, minimization of tours can happen implicitly if you have fixed vehicle cost specified.

iedmrc commented 2 years ago

Thanks, it worked! Sorry for missing this info. Do we have any details on docs about that?

reinterpretcat commented 2 years ago

No, that's a bit related to implementation details