Dip icon indicating copy to clipboard operation
Dip copied to clipboard

No heuristics used if no cuts generated

Open svigerske opened this issue 6 years ago • 2 comments

Issue created by migration from Trac.

Original creator: @IainNZ

Original creation time: 2010-11-17 04:20:23

In DecompAlgo.cpp, there is the code:

if(nChanges && m_status != STAT_INFEASIBLE){
...
m_app->APPheuristics(m_xhat, getOrigObjective(), m_xhatIPFeas);
...
}

The != operator has precedence over the logical AND (http://www.cppreference.com/wiki/operator_precedence) so this condition will only be true if (m_status != 1) (i.e. is feasible) and if nchanges is non-zero.

nChanges is defined up above as:

int nChanges = m_nodeStats.cutsThisCall + m_nodeStats.varsThisCall;

So if no new columns are generated and no cuts are generated, nChanges will be 0, and the condition will evaluate as false -> no heuristics are called.

If this understanding of the code is correct, then there is an issue. Heuristics should run regardless of whether there are cuts(?)

svigerske avatar Feb 26 '19 23:02 svigerske

Comment by @IainNZ created at 2010-11-17 04:24:32

Haven't been able to generate a simple example to reproduce this issue. The code that causes this problem uses Dippy 1.0.1 on Win32, using DIP 0.8.7. The code above from DecompAlgo is the same in DIP 0.81.0 I can send the code and the data the code needs if it would help, preferably privately due to the nature of the data.

svigerske avatar Feb 26 '19 23:02 svigerske

Comment by @mgalati13 created at 2010-11-27 20:36:00

I think you can safely change that to : if(m_status != STAT_INFEASIBLE)

to force user heuristics to be called even when no cuts/cols are added. I think that was just for efficiency - as when nChanges=0, that would normally mean you are done with processing that node.

Try removing that condition.

svigerske avatar Feb 26 '19 23:02 svigerske