[Coin-discuss] Bcp question

Laszlo Ladanyi ladanyi at us.ibm.com
Sat May 7 15:35:35 EDT 2005


Thanks for pointing this out, this is a bug.

The idea here is that when an algo var (cuts work similarly) is created it
gets index 0. When it plays any significant role, it gets assigned the
*negative* of the next available index. When it is first sent to the TM, it is
packed and sent and its index is flipped to positive. This way every algo var
is sent to the TM only once, every time later on only its index is sent.

This game is not needed for core/indexed vars since their index is fixed to
start with and I need to send only the index even the first time. So the
correct fix is to change the test to: 
if (gsol->_vars[i]->bcpind() == 0 && gsol->_vars[i]->obj_type() == BCP_AlgoObj)

I have committed the change.

--Laci

On Tue, 3 May 2005, Francois Margot wrote:

> 
> I just looked at the code in Bcp_lp_main_loop.cpp, around lines 216:
> 
>    if (gsol) {
>           const int size = gsol->_vars.size();
>           for (int i = 0; i < size; ++i) {
>              if (gsol->_vars[i]->bcpind() == 0)
>                 gsol->_vars[i]->set_bcpind(-BCP_lp_next_var_index(p));
>           }
>        }
>    }
> 
> 
> I have a hard time to understand the block starting with
> 
>   if (gsol->_vars[i]->bcpind() == 0)
> 
> I am not doing column generation. The core variables are numbered 
> (by Bcp) from 0 to nb_core_vars-1. If the variable with bcpind 0 appears in 
> the heuristic solution, this block will change the index of the 
> variable to a negative number (permanently). I would be interested in
> hearing why this is done, since this creates unexpected difficulties.
> 
> If I remove the offending block, Bcp is happy (and so am I).
> 
> Francois
> 
> 
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss
> 




More information about the Coin-discuss mailing list