Or-tools: CP Solver - Python: Diet example memory error

Created on 30 Oct 2018  路  4Comments  路  Source: google/or-tools

The example related to python CP Solver diet_1.py has resulted in some memory issues:

WARNING: Logging before InitGoogleLogging() is written to STDERR
I1030 11:12:09.786314  4353 search.cc:244] Start search (memory used = 26.40 MB)
I1030 11:12:09.786371  4353 search.cc:244] Root node processed (time = 0 ms, constraints = 8, memory used = 26.40 MB)
I1030 11:12:09.786394  4353 search.cc:244] Solution #0 (0, time = 0 ms, branches = 5, failures = 0, depth = 5, memory used = 26.40 MB)
I1030 11:12:09.786419  4353 search.cc:244] Finished search tree (time = 0 ms, branches = 5, failures = 6, memory used = 26.40 MB)
I1030 11:12:09.786430  4353 search.cc:244] End search (time = 1 ms, branches = 5, failures = 6, memory used = 26.40 MB, speed = 5000 branches/s)
F1030 11:12:09.786442  4353 expressions.cc:1342] Check failed: min_.Value() == max_.Value() (0 vs. 10000)  variable cost(0..10000) is not bound.
*** Check failure stack trace: ***

Still, it outputs result:

```cost: 0
[('a', 0), ('b', 3), ('c', 0), ('d', 1)]

failures: 6
branches: 5
WallTime: 0
```

The code is the same as in example, nothing is changed!

ubuntu 18.04
Mem: 16 GiB
Intel Core i7 4x
Pycharm 18.*

Help Needed Python CP / CP-SAT Solver

Most helpful comment

The optimization site is still based on v6.7.2. We will update it soon.
In the meantime you could look at the SAT github doc directly -> https://github.com/google/or-tools/blob/master/ortools/sat/doc/index.md

All 4 comments

I rewrote the example to use the new CP-SAT solver.
It works fine now :-)

@lperron Thanx a lot, working as expected. Btw, got another a bit out of topic question: where I could find docs of from ortools.sat.python import cp_model which you used? Because in official docs the from ortools.constraint_solver import pywrapcp approach is explained. The one you rewrote to seems to be a new approach to me

The optimization site is still based on v6.7.2. We will update it soon.
In the meantime you could look at the SAT github doc directly -> https://github.com/google/or-tools/blob/master/ortools/sat/doc/index.md

@Mizux Thank you Guys for commitment and help

Was this page helpful?
0 / 5 - 0 ratings