Or-tools: NotImplementedError: Wrong number or type of arguments for overloaded function

Created on 11 Jun 2019  路  3Comments  路  Source: google/or-tools

File "/home/x/.local/lib/python2.7/site-packages/ortools/constraint_solver/pywrapcp.py", line 3150, in __init__
    this = _pywrapcp.new_RoutingIndexManager(*args)
NotImplementedError: Wrong number or type of arguments for overloaded function 'new_RoutingIndexManager'.
  Possible C/C++ prototypes are:
    operations_research::RoutingIndexManager::RoutingIndexManager(int,int,operations_research::RoutingIndexManager::NodeIndex)
    operations_research::RoutingIndexManager::RoutingIndexManager(int,int,std::vector< operations_research::RoutingIndexManager::NodeIndex > const &,std::vector< operations_research::RoutingIndexManager::NodeIndex > const &)

I am frequently getting the following error from pywrapcp.RoutingIndexManager(). It happens when I remove the data['depot'] = 0 and/or when I experiment with different constraints. This is _not_ the same as routing.status().

This is fairly reproducible and I would appreciate any insights/suggestions.

Help Needed Python Routing Solver

Most helpful comment

https://developers.google.com/optimization/reference/constraint_solver/routing_index_manager/RoutingIndexManager/ I cannot use both data['depot'] and data['starts'] and data['ends'] simultaneously.

All 3 comments

https://developers.google.com/optimization/reference/constraint_solver/routing_index_manager/RoutingIndexManager/ I cannot use both data['depot'] and data['starts'] and data['ends'] simultaneously.

I meet the same problem!!!

You can't, but if your depot is at 0,0 you can just input:

manager = pywrapcp.RoutingIndexManager(len(data['distance_matrix']),
                                       data['num_vehicles'], data['starts'], data['ends'])

and to make sure you start at the depot, you will need to put zeroes in data['starts'] and data['ends'] and deviate from those zeroes if you want to start or end somewhere different.

Was this page helpful?
0 / 5 - 0 ratings