[BCP] Difficults with cuts in branching

Carlos Eduardo de Andrade ce.andrade at gmail.com
Tue Jan 27 15:29:03 EST 2009


Hello people,

I'm having some problem with cuts generated in
select_branching_candidates() phase. Suddenly, code breaks in
segmentation fault. I tried to trace some possible cause with gdb and
valgrind:

witth some optmizations in Paramfile
-------------------------------------------------------
--> SPP_lp::set_user_data_for_children()
-------------------------------------------------------
TM: var in node description is neither local nor remote.
==12534== Process terminating with default action of signal 6 (SIGABRT)
==12534==    at 0x4000882: (within /lib/ld-2.6.1.so)
==12534==    by 0x40C536D: BCP_tm_node_to_send::send()
(BCP_tm_msg_node_send.cpp:262)
==12534==    by 0x40E1352: BCP_tm_start_one_node(BCP_tm_prob&)
(BCP_tm_functions.cpp:229)
...
*** glibc detected *** ./spp: free(): invalid next size (fast): 0x081cb8a0 ***


witth some degub infos in Paramfile
-------------------------------------------------------
--> SPP_lp::set_user_data_for_children()
-------------------------------------------------------
LP: Default prepare_for_optimization() executed.
LP:   Returned children to TM. Waiting for new node.
==12624== Invalid write of size 4
==12624==    at 0x40F7337:
BCP_obj_set_change::update(BCP_obj_set_change const&)
(BCP_obj_change.cpp:47)
==12624==    by 0x40C510B: BCP_tm_node_to_send::send()
(BCP_tm_msg_node_send.cpp:243)
...
*** glibc detected *** ./spp: double free or corruption (!prev): 0x081f4068 ***


There, I created one cut to be applied in one of chlid node (affect
it). My  select_branching_candidates() code is

//---------- BEGIN CODE ----------//
    // Then we create the cuts to the children nodes, based in branching items
    BCP_vec< BCP_cut* > new_cuts(1, new SPP_cut(item_l, item_m));

    // We create the indices to cuts
    BCP_vec< int > cut_indices(1, -1);  // <<<<<<<<< HERE, I DON'T NOW
IF THIS IS CORRECTLY

    // The bounds vector contains the lower and upper bounds of all children
    // This explains your size (new_cuts.size() * 2 "bounds" * 2 "children")
    BCP_vec< double > cut_bounds(new_cuts.size() * 4);

    // Left child
    cut_bounds[0] = - SPP_cut::infinity;
    cut_bounds[1] = SPP_cut::infinity;

    // Right child
    cut_bounds[2] = cut_bounds[3] = 0.0;

    // Create a new branch object.
    cans.push_back(
        new BCP_lp_branching_object(2,               // number of children
                                    0,               // new vars
                                    &new_cuts,       // New cuts
                                    &var_indices,    // indices for vars
                                    &cut_indices,    // indices for cuts
                                    &var_bounds,     // bounds for vars
                                    &cut_bounds,     // bounds for cuts
                                    0, 0, 0, 0));
//---------- END CODE ----------//

I think that my cuts_to_rows() and vars_to_cols() are corretly.  I
always use the bcpind() method to get the index from vars and cuts. Is
this right way?

My real doubt is know-how set the cuts in braching phase corretly. I
think this is the problem.

Thank you and regards,

Carlos

-- 
Carlos Eduardo de Andrade
Algorithms and Programming, Operation Systems
Federal Institute for Education, Science and Technology Southern of
Minas Gerais, Brazil
Home: www.eafi.gov.br/~andrade
Phone/Fax: +55 35 3464 1200



More information about the BCP mailing list