Brancher for tracing

9 views
Skip to first unread message

Philippe Morignot

unread,
Jul 21, 2026, 1:35:41 PM (7 days ago) Jul 21
to gec...@googlegroups.com
Hi,

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

Mikael Zayenz Lagerkvist

unread,
Jul 21, 2026, 6:38:33 PM (6 days ago) Jul 21
to gec...@googlegroups.com
Hi,

The tracing propagators create unary branches in the search tree, so
it is reasonable that there will be more nodes. If you use Gist, they
should be visible in the search tree.

As for propagations, I am not sure what might be the reason. One
reason might be because adding unary branchers does change the depth,
and thus changes where copies are left, which probably has an impact.

Cheers,
Mikael
> --
> You received this message because you are subscribed to the Google Groups "Gecode" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to gecode+un...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/gecode/714035349.1472937.1784655335958%40mail.yahoo.com.



--
Mikael Zayenz Lagerkvist

Philippe Morignot

unread,
Jul 23, 2026, 1:05:54 PM (5 days ago) Jul 23
to gec...@googlegroups.com
Hi,

Thank you for your answer!

Is there a way other than Gist to trace the behavior of a search engine without changing the search tree?

Cheers, Philippe
Reply all
Reply to author
Forward
0 new messages