-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Python CPSAT model is now (7.5) infeasible was not infeasible in 7.3 #1908
Comments
We fixed a few reasons for this on master. Can you compile and try it ?
Can you send us the failing model ? And the slower models ?
Thanks
Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53
00
Le mer. 4 mars 2020 à 15:47, Phibedy <notifications@github.com> a écrit :
… Version 7.5.7466 vs 7.3.7083
Language:
Python CP-SAT
Ubuntu 18.04.3 LTS
What I do:
- solve model multiple times with different cost functions
- fix some variables using model.Add(variable ==
solver.Value(variable))
- set hints for all variables
- solve again (with different cost function)
- works on 7.3, fails on 7.5
I am quite sure that the code I use is fine as I am just executing
* sudo pip3 install ortools==7.3.7083 --upgrade
* pytest ...
* -> works
* sudo pip3 install ortools==7.5.7466 --upgrade
* pytest ...
* -> fails
Is this a known bug or should I send you the proto via email (did not find
it anywhere)?
If so do you want both models or just the 7.5 one or each model from each
optimization step?
In addition in 7.5 it takes quite longer (in this case I have 3
optimization steps):
The number is the nth found solution, the time is in seconds
Step 1 (7.5):
[json]{"number": 24, "time": 76.26023958501173, "value": 23.0}
solved in 78.34767117101 seconds for state: 4
Step 2 (7.5):
[json]{"number": 10, "time": 70.49741753899434, "value": 56.0}
in 72.49534865799069 for state 4
Step 3 (7.5):
in 16.87480183399748 for state 3
Step 1 (7.3):
[json]{"number": 15, "time": 27.856430420011748, "value": 23.0}
solved in 29.05248812600621 seconds for state: 4
Step 2 (7.3):
[json]{"number": 11, "time": 41.622797275995254, "value": 56.0}
in 45.057837113999994 for state 4
Step 3 (7.3):
[json]{"number": 0, "time": 21.66252404000261, "value": 50.0}
in 22.549597756005824 for state 4
Thank you for your support :)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1908?email_source=notifications&email_token=ACUPL3MLLMM5567HRJRM5O3RFZSZLA5CNFSM4LBJNFQ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4ISM3VEA>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUPL3OYQBHUGE37XB6KMV3RFZSZLANCNFSM4LBJNFQQ>
.
|
@lperron Thank you for the fast response. Of course, just need some time to compile :) Just tried 7.4 and it worked (added times in issues) |
@lperron I have just sent you an email with the models and the log. I tried the current master branch and it fails to find a solution, too. Step 1 (current master)
Step 2 (current master)
Step 3 (current master)
|
I just ran it 100 times on my linux workstation.
It always returns OPTIMAL.
Are you sure the docker image is up to date ?
Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53
00
Le jeu. 5 mars 2020 à 11:29, Phibedy <notifications@github.com> a écrit :
… @lperron <https://github.com/lperron> I have just sent you an email with
the models and the log. I tried the current master branch and it fails to
find a solution, too.
Used docker image
<https://hub.docker.com/layers/syxolk/python-ortools/python3.7-ortools7.5-69c729/images/sha256-a4c32f9e47b2232874c724f046a17637e0c2213a1365610281b690cea93d4ddc>
The tests of the current master branch was done on a different machine,
therefore the measured time can't be compared, but I add them anyways:
Step 1 (current master)
[json]{"number": 8, "time": 22.41800951398909, "value": 23.0}
solved in 23.586646577343345 seconds for state: 4
Step 2 (current master)
[json]{"number": 6, "time": 25.17622970044613, "value": 56.0}
in 26.66402460820973 for state 4
Step 3 (current master)
in 11.983792051672935 for state 3
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1908?email_source=notifications&email_token=ACUPL3MZFZAJM7DN64EUMMDRF55INA5CNFSM4LBJNFQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN4VEDQ#issuecomment-595153422>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUPL3J6GKY3GFZYX34PEYLRF55INANCNFSM4LBJNFQQ>
.
|
Our ci server says:
How did you load the proto and run it? |
My mistake. Model 7.5/model-3 is indeed infeasible with presolve, and
feasible without it.
Just a small comment, you create table constraints with duplicate variables:
table { vars: 9843 vars: 9844 vars: 2336 vars: 2336 vars: 2336 vars: 2336
vars: 2336 vars: 2336 vars: 2336 vars: 2336 vars: 2336 vars: 2336 vars:
2336 vars: 2336 vars: 2336 vars: 2336 values: 1 values: 1 values: 1 values:
1 values: 1 values: 1 values: 1 values: 1 values: 1 values: 1 values: 1
values: 1 values: 1 values: 1 values: 1 values: 1 }
This is really costly :-)
Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53
00
Le jeu. 5 mars 2020 à 13:40, Phibedy <notifications@github.com> a écrit :
… Our ci server says:
- Ortools version says 7.6.9999
- The used image is: syxolk/python-ortools:python3.7-ortools7.5-69c729
which downloads ortools via:
RUN wget -q
https://github.com/google/or-tools/archive/69c7295289c8bcef185415e2ef3d76ffff18a849.zip
-O or-tools.zip so it should be fine.
How did you load the proto and run it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1908?email_source=notifications&email_token=ACUPL3K7BNTDNZMKD7QIOG3RF6MTHA5CNFSM4LBJNFQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN5CS3A#issuecomment-595208556>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUPL3JETS4YVPUJYP6MRRDRF6MTHANCNFSM4LBJNFQQ>
.
|
Thank you, I will have a look at it :). The log you send me via email seems to be quite useful, how can I enable it? |
parameter: log_search_progress:true
Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53
00
Le jeu. 5 mars 2020 à 13:52, Phibedy <notifications@github.com> a écrit :
… Thank you, I will have a look at it :). The log you send me via email
seems to be quite useful, how can I enable it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1908?email_source=notifications&email_token=ACUPL3JKWYW5IYHTDPJT43DRF6OAVA5CNFSM4LBJNFQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN5DW3Q#issuecomment-595213166>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUPL3LQJOC2Z2PEYWEZ3Q3RF6OAVANCNFSM4LBJNFQQ>
.
|
I am using AddAllowedAssignments, but I am quite sure that there are not the same variables inside the AddAllowedAssignments. If I call
and forcing them all to 1 is not the case either. The model creates tables like
So as you can see there are always two following variables 1, rest 0. |
It must happen during presolve. Most likely all these variables have an
affine relations between them.
Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53
00
Le jeu. 5 mars 2020 à 14:52, Phibedy <notifications@github.com> a écrit :
… My mistake. Model 7.5/model-3 is indeed infeasible with presolve, and
feasible without it. Just a small comment, you create table constraints
with duplicate variables: table { vars: 9843 vars: 9844 vars: 2336 vars:
2336 vars: 2336 vars: 2336 vars: 2336 vars: 2336 vars: 2336 vars: 2336
vars: 2336 vars: 2336 vars: 2336 vars: 2336 vars: 2336 vars: 2336 values: 1
values: 1 values: 1 values: 1 values: 1 values: 1 values: 1 values: 1
values: 1 values: 1 values: 1 values: 1 values: 1 values: 1 values: 1
values: 1 } This is really costly :-) Laurent Perron | Operations Research
| ***@***.*** | (33) 1 42 68 53 00 Le jeu. 5 mars 2020 à 13:40,
Phibedy ***@***.*** a écrit :
… <#m_-1775267191286147521_>
Our ci server says: - Ortools version says 7.6.9999 - The used image is:
syxolk/python-ortools:python3.7-ortools7.5-69c729 which downloads ortools
via: RUN wget -q
https://github.com/google/or-tools/archive/69c7295289c8bcef185415e2ef3d76ffff18a849.zip
-O or-tools.zip so it should be fine. How did you load the proto and run
it? — You are receiving this because you were mentioned. Reply to this
email directly, view it on GitHub <#1908
<#1908>?email_source=notifications&email_token=ACUPL3K7BNTDNZMKD7QIOG3RF6MTHA5CNFSM4LBJNFQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN5CS3A#issuecomment-595208556>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACUPL3JETS4YVPUJYP6MRRDRF6MTHANCNFSM4LBJNFQQ
.
I am using AddAllowedAssignments, but I am quite sure that there are not
the same variables inside the AddAllowedAssignments. If I call v.Index()
on all variables there are no duplicates in one AddAllowedAssignments call.
If I remove the AddAllowedAssignments calls the model is solvable (even
with version 7.5). How did you check if there are duplicated table
constraints, because there is no variable with index 2336 in my case?
The one I find is
9843
9844
16836
16837
26621
26622
37123
37124
43756
43757
49397
49398
58583
58584
64921
64922
and forcing them all to 1 is not the case either. The model creates tables
like
1
1
0
0
...
0
0
1
1
...
So as you can see there are always two following variables 1, rest 0.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1908?email_source=notifications&email_token=ACUPL3P5FYWVWCXKGHR46VDRF6VBDA5CNFSM4LBJNFQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN5KMHY#issuecomment-595240479>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUPL3OJPTFZ3ODDZ42P5ETRF6VBDANCNFSM4LBJNFQQ>
.
|
Great I will give it a try 👍 |
I found the bug and it should be fixed on master.
Thanks
Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53
00
Le jeu. 5 mars 2020 à 16:51, Phibedy <notifications@github.com> a écrit :
… Great I will give it a try 👍
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1908?email_source=notifications&email_token=ACUPL3ITZXWFELBEEHU74X3RF7C7LA5CNFSM4LBJNFQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN5ZFUY#issuecomment-595301075>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUPL3OUIJJROOG3OV4A4OLRF7C7LANCNFSM4LBJNFQQ>
.
|
Version 7.5.7466 vs 7.3.7083
Language:
Python CP-SAT
Ubuntu 18.04.3 LTS
What I do:
model.Add(variable == solver.Value(variable))
I am quite sure that the code I use is fine as I am just executing
Is this a known bug or should I send you the proto via email (did not find it anywhere)?
If so do you want both models or just the 7.5 one or each model from each optimization step?
In addition in 7.5 it takes quite longer (in this case I have 3 optimization steps):
The number is the nth found solution, the time is in seconds
Step 1 (7.5):
Step 2 (7.5):
Step 3 (7.5):
Step 1 (7.3):
Step 2 (7.3):
Step 3 (7.3):
Edit for 7.4
Thank you for your support :)
The text was updated successfully, but these errors were encountered: