Hi ALex,
thanks for your reaction !
I get this error message again:
Found existing installation: docplex 2.11.176
Cannot uninstall 'docplex'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Tried on the terminal, settings of PyCharm , pip install --upgrade docplex==2.14.186, and pip install docplex==2.14.186 and tried to uinstall it as well. got the same message
Any ideas?
best,
Original Message:
Sent: Tue June 16, 2020 09:18 AM
From: ALEX FLEISCHER
Subject: solve a relaxed version of a model
Hi
you should move to a more recent docplex version.
See https://pypi.org/project/docplex/#history
regards
------------------------------
ALEX FLEISCHER
Original Message:
Sent: Tue June 16, 2020 08:49 AM
From: s charaf
Subject: solve a relaxed version of a model
Hi Alex,
Thanks for your reaction.
As you can see in my first post, when importing the LinearRelaxer() ,i get this error message :
####
from docplex.mp.utils import DocplexLinearRelaxationError
ImportError: cannot import name 'DocplexLinearRelaxationError' from 'docplex.mp.utils' (C/...)
####
The same error message appears when copying pasting your code.
Do you have an idea how to fix this ?
Best,
Original Message:
Sent: Tue June 16, 2020 08:16 AM
From: ALEX FLEISCHER
Subject: solve a relaxed version of a model
Hi,
in https://www.linkedin.com/pulse/making-optimization-simple-python-alex-fleischer/
you have a relaxation example in docplex
AlexFleischerParis/zoodocplex
and for linear relaxation
from docplex.mp.model import Modelfrom docplex.mp.relax_linear import LinearRelaxermdl = Model(name='buses')nbbus40 = mdl.integer_var(name='nbBus40')nbbus30 = mdl.integer_var(name='nbBus30')mdl.add_constraint(nbbus40*40 + nbbus30*30 >= 300, 'kids')mdl.minimize(nbbus40*500 + nbbus30*400)mdl.solve()for v in mdl.iter_integer_vars(): print(v," = ",v.solution_value)mdl.report()print()print("------- starting linear relaxation")print()rx=LinearRelaxer()mdl2=rx.linear_relaxation(mdl)mdl2.solve()for v in mdl2.iter_continuous_vars(): print(v," = ",v.solution_value)
regards
------------------------------
ALEX FLEISCHER
Original Message:
Sent: Tue June 16, 2020 05:07 AM
From: s charaf
Subject: solve a relaxed version of a model
Hi Daniel,
Thanks for your reaction.
Well, at first I was only thinking of the first type.
However, the second type can also be helpful. I am implementing a branch and price algorithm.
In other words, if there is a method that could do the first type, then I am taking it, and if there is another one that do both then I am also happy to know about it.
Best,
Original Message:
Sent: Tue June 16, 2020 03:01 AM
From: Daniel Junglas
Subject: solve a relaxed version of a model
There are two types of relaxations:
- The original model in which all binary and integer variables have been converted to continuous variables.
- The original model in which all other constraints are allowed to be violated.
Which of the two do you want to solve?
------------------------------
Daniel Junglas
Original Message:
Sent: Mon June 15, 2020 12:25 PM
From: s charaf
Subject: solve a relaxed version of a model
Hi,
Is it possible to solve a relaxed version of an ilp model using only a built-in method? I am using python API, docplex.mp.
I found LinearRelaxer in docplex.mp.relax_linear , however I keep getting this error message:
####
from docplex.mp.utils import DocplexLinearRelaxationError
ImportError: cannot import name 'DocplexLinearRelaxationError' from 'docplex.mp.utils' (C/...)
####
Any ideas?
best,
#DecisionOptimization