Closed emman91 closed 3 years ago
Please read the difference between a simplex solver and a MIP solver. Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53 00
Le mer. 18 nov. 2020 à 11:19, emman91 notifications@github.com a écrit :
What version of OR-tools and what language are you using?
Version: 8.2 installed via pip (python 3.8) Language: Python
Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
GLOP
What operating system (Linux, Windows, ...) and version?
Linux 20.04 LTS in a virtual machine
What did you do? Steps to reproduce the behavior:
Run the follwing script:
[image: image] https://user-images.githubusercontent.com/74408817/99512160-7380a080-2989-11eb-901e-1892dcff4f91.png
[image: image] https://user-images.githubusercontent.com/74408817/99512349-a460d580-2989-11eb-8163-897d9bdb594c.png
[image: image] https://user-images.githubusercontent.com/74408817/99512431-bc385980-2989-11eb-9c68-68fd8db16660.png
What did you expect to see
Normaly, all elements of Sol1 should be interger and even binary (0 or 1) Sol 1 = [ 0 0 1 0 0 0 1 0 0 0 1 0 0 1 1 ] Sol 2 = [875 425 187.5 1050 1012.5] (solutions found with my equivalent Matlab program)
What did you see instead?
[image: image] https://user-images.githubusercontent.com/74408817/99515602-754c6300-298d-11eb-92fb-d1e4540a424c.png
As you can see the elements of Sol 1 are not or equal to 0 or 1 but between. The sum of each column is well equal to 1 as expected. For the third column, instead of [ 1 0 0] i get [0.69 0 0.31]. Similar results with the 5th column ([0.45 0 0.55 instead of [0 0 1]) Theses wrong values (real and not binary) affect of course the third and fifth values of sol2 which are not correct.
Normally, for my problem i can have several solutions. I saw that with "pywrapcp" (instead of "pywraplp") it is possible. I tried first with "pywrapcp" but i didn't succed to multiply my integer variable with some constants values, which can be rounded as integer if needed. That's why i moved to "pywraplp". Is there a simple way to get all solutions with pywraplp ?
Thanks for looking into this! Emman
Make sure you include information that can help us debug (full error message, model Proto).
Anything else we should know about your project / environment
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/2233, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUPL3LY5Z3Z2QNSUKACEYTSQONRXANCNFSM4TZYQSQQ .
Thansk for your fast reply. I know what is a MIP solver (Mixed linear problem) and i know that the solver i have used does not solve MIP. As i said, i can convert my problem into a full integer problem if needed. My question was why in the linear solver (GLOP, pywraplp) , a variable declared as integer with solver.IntVar return a real value in the solution. Emman
Is there any solver for MIP under apache 2.0 ?
You may use the Coin-OR CBC solver which is under a EPL v2 license ref: https://github.com/coin-or/Cbc/blob/master/LICENSE
Yes but according to my knowledge, with EPL v2 you have to give your code, which is not the case with apache v2, right ?
And about my issue with GLOP with pywraplp, why a variable declared as integer with solver.IntVar return a real value in the solution ? have you some ideas ?
I would say glop is a pure linear solver to all intVar are converted to floating point value since integer constraint is not supported.
Yes but according to my knowledge, with EPL v2 you have to give your code, which is not the case with apache v2, right ?
Yes and no, you only have to publish the EPL code is you have modified it, it's a weak copyleft so simply using Cbc verbatim should be OK IMHO.
so my initial personnal code is not public until the moment i modify it ?
Only if you modify the code of the cbc solver.
Le mer. 18 nov. 2020 à 12:39, emman91 notifications@github.com a écrit :
so my initial personnal code is not public until the moment i modify it ?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/2233#issuecomment-729623712, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUPL3IIUX7SJSOO4BHLRBDSQOW7VANCNFSM4TZYQSQQ .
Forcing the variables to have integer values is exactly the difference between a simplex and a mip solver.
You can also use SAT_INTEGER_PROGRAMMING be to solve your problem. It is part of or-tools.
Le mer. 18 nov. 2020 à 12:23, emman91 notifications@github.com a écrit :
And about my issue with GLOP with pywraplp, why a variable declared as integer with solver.IntVar return a real value in the solution ? have you some ideas ?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/2233#issuecomment-729615474, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUPL3I6TNRWN3LZ5TYPILDSQOVB7ANCNFSM4TZYQSQQ .
What version of OR-tools and what language are you using?
Version: 8.2 installed via pip (python 3.8) Language: Python
Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
GLOP
(except GLOP is there any solver with is under license apache 2 ?)
What operating system (Linux, Windows, ...) and version?
Linux 20.04 LTS in a virtual machine
What did you do? Steps to reproduce the behavior:
Run the follwing script:
What did you expect to see
Normaly, all elements of Sol1 should be interger and even binary (0 or 1) Sol 1 = [
0 0 1 0 0 0 1 0 0 0 1 0 0 1 1 ] Sol 2 = [875 425 187.5 1050 1012.5] (solutions found with my equivalent Matlab program)
What did you see instead?
As you can see the elements of Sol 1 are not or equal to 0 or 1 but between. The sum of each column is well equal to 1 as expected. For the third column, instead of [ 1 0 0] i get [0.69 0 0.31]. Similar results with the 5th column ([0.45 0 0.55 instead of [0 0 1]) Theses wrong values (real and not binary) affect of course the third and fifth values of sol2 which are not correct.
Normally, for my problem i can have several solutions. I saw that with "pywrapcp" (instead of "pywraplp") it is possible. I tried first with "pywrapcp" but i didn't succed to multiply my integer variable with some constants values, which can be rounded as integer if needed. That's why i moved to "pywraplp". Is there a simple way to get all solutions with pywraplp ?
This problem of mixing a variable which is a matrix of integers values and a variable which is a vector of double value. Other solver like CP-SAT, Routing Solver, BOP, Gurobi can do the job ? My constraint is to use apache v2 license solvers.
Thanks for looking into this! Emman
Make sure you include information that can help us debug (full error message, model Proto).
Anything else we should know about your project / environment