I am writing to you for the following question: I have defined several branchers that execute some source code on a model, following section 8.14 of MPG “Executing code between branchers”. Two of these branchers (lines 2 and 6 below) are for tracing the behavior of the search engine only: printing text and variables on std::cout. And what surprises me is that commenting out these two tracing branchers leads to a slightly different search tree than not commenting them out …
The statistics at the end of a run show that there are more propagations (1682 vs. 1319) and less nodes (26 vs. 37) without tracing branchers than with them.
Would someone have an explanation for this? Here is an excerpt of the source code: (with tracing branchers of lines 2 and 6 commented out)
1 for (int i = 0 ; i < is_performed.size() ; i++) {
2 //branch(*this, lambda_print_begin); // print text and variables on std::cout
3 branch(*this, is_performed[i], Gecode::BOOL_VAL_MAX());
4 branch(*this, lambda_assign_vars1);
5 assign(*this, object_id[i], Gecode::INT_ASSIGN(lambda_select_object));
6 //branch(*this, lambda_print_end); // print text and variables on std::cout
7 }
Philippe