New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddDisjunction with negative penalty - crashes the solver #469

Closed
emakarov opened this Issue Sep 4, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@emakarov

emakarov commented Sep 4, 2017

Seems like #91 had the same problem. But proposed solution with SetDepot is no longer working, because SetDepot was removed from API.
So here's simplest case (ortools for python3, installed by pip, latest version):

from ortools.constraint_solver import pywrapcp
routing = pywrapcp.RoutingModel(101, 10, 0)
routing.AddDisjunction([1, 2], -1)

leads to
WARNING: Logging before InitGoogleLogging() is written to STDERR F0904 08:51:20.853919 2529715136 routing.cc:1326] Check failed: penalty >= 0 (-1 vs. 0) Penalty must be positive *** Check failure stack trace: *** Abort trap: 6

@furnon

This comment has been minimized.

Collaborator

furnon commented Sep 4, 2017

@emakarov

This comment has been minimized.

emakarov commented Sep 4, 2017

I see. but then, seems like documentation here
https://github.com/google/or-tools/blob/master/ortools/constraint_solver/routing.h#L520 is not very clear:

 "penalty" must be positive to make the disjunction optional; a negative
  // penalty will force one node of the disjunction to be performed, and
  // therefore p == 0.

sounds like penalty can be negative and in this case one node will be performed.

So, to achieve result when only one node can be performed, should I just use AddDisjunction without penalty argument?

@furnon

This comment has been minimized.

Collaborator

furnon commented Sep 4, 2017

@furnon

This comment has been minimized.

Collaborator

furnon commented Sep 4, 2017

@emakarov

This comment has been minimized.

emakarov commented Sep 5, 2017

thanks @furnon
could you kindly update the https://pypi.python.org/pypi/py3-ortools package?

@furnon

This comment has been minimized.

Collaborator

furnon commented Sep 5, 2017

@emakarov

This comment has been minimized.

emakarov commented Sep 5, 2017

sure, thanks.

@lperron

This comment has been minimized.

Collaborator

lperron commented Sep 13, 2017

release 6.4 is out with the fix.

@lperron lperron closed this Sep 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment