Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silence Log Output From Python mip

Tags:

python

I'm using the mixed integer programming module https://pypi.org/project/mip/ and it's working a treat. However, it's printing logging information to the console at termination of the program.

Cgl0003I 0 fixed, 15 tightened bounds, 0 strengthened rows, 0 substitutions
Cgl0004I processed model has 131 rows, 8 columns (8 integer (0 of which binary)) and 1038 elements
Coin3009W Conflict graph built in 0.001 seconds, density: 0.000%
Cgl0015I Clique Strengthening extended 0 cliques, 0 were dominated
Cbc0045I 1 integer variables out of 8 objects (8 integer) have cost of 1 - high priority
Cbc0045I branch on satisfied Y create fake objective Y random cost Y
Cbc0012I Integer solution of 5 found by DiveCoefficient after 0 iterations and 0 nodes (0.01 seconds)
Cbc0012I Integer solution of 2 found by DiveCoefficient after 8 iterations and 0 nodes (0.01 seconds)
Cbc0031I 1 added rows had average density of 8
Cbc0013I At root node, 1 cuts changed objective from 1.4444444 to 2 in 2 passes
Cbc0014I Cut generator 0 (Probing) - 0 row cuts average 0.0 elements, 1 column cuts (1 active)  in 0.000 seconds - new frequency is 1
Cbc0014I Cut generator 1 (Gomory) - 3 row cuts average 7.7 elements, 0 column cuts (0 active)  in 0.001 seconds - new frequency is 1
Cbc0014I Cut generator 2 (Knapsack) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.000 seconds - new frequency is -100
Cbc0014I Cut generator 3 (Clique) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.000 seconds - new frequency is -100
Cbc0014I Cut generator 4 (OddWheel) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.000 seconds - new frequency is -100
Cbc0014I Cut generator 5 (MixedIntegerRounding2) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.001 seconds - new frequency is -100
Cbc0014I Cut generator 6 (FlowCover) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.000 seconds - new frequency is -100
Cbc0001I Search completed - best objective 2, took 8 iterations and 0 nodes (0.01 seconds)
Cbc0035I Maximum depth 0, 0 variables fixed on reduced cost
Total time (CPU seconds):       0.02   (Wallclock seconds):       0.02

How can I silence all non-error output from mips?

like image 516
Brent Avatar asked Sep 05 '25 04:09

Brent


1 Answers

Before calling

m.optimize(...)

set

m.verbose = 0
like image 52
hlidka Avatar answered Sep 07 '25 19:09

hlidka