Overwrite Space::status()

17 views
Skip to first unread message

Oleg Zaikin

unread,
May 11, 2022, 12:35:32 PM5/11/22
to Gecode
Dear Gecode team.

Is it possible to overwrite the Space::status() function, like
it is done for the status() function of a brancher, implemented
by a user?

Best regards, Oleg

Mikael Zayenz Lagerkvist

unread,
May 23, 2022, 9:48:47 AM5/23/22
to Gecode
Hi,

The Space::status method is not virtual, and is not meant to be overridden.

What are you trying to do?

Cheers,
Mikael

PS. I found several Gecode messages in my Spam folder, hence the late answer.

Oleg Zaikin

unread,
Jun 7, 2022, 8:04:08 AM6/7/22
to Gecode
Dear Mikael.

We are doing reasoning at each node of the search tree, computing some additional constraints to be posted before branching, using the DFS search engine. Apparently this engine does not have a hook for posting constraints right before branching. We decided to use the choice-function of a customised brancher for this purpose. We compute the constraints in there, but it seems not possible to post them in the choice-function -- more precisely, it seems that constraints posted in that function get lost "deterministically but apparently randomly". Finally our solution is to store the constraints in the branching object, and to post them in the commit-function, for each branch. Currently the runtime for posting these constraints for each commit again seems tolerable, but in the future we expect to compute many more constraints. So it would be great to have a way to post the constraints only once, for the node itself. It seems needed to write a new search engine for that. Is there a relatively easy way to get exactly the DFS search engine plus the hook for posting constraints?

Best regards, Oleg.
понедельник, 23 мая 2022 г. в 14:48:47 UTC+1, Mikael Zayenz Lagerkvist:

Mikael Zayenz Lagerkvist

unread,
Jun 7, 2022, 8:18:52 AM6/7/22
to gec...@googlegroups.com
Hi,

Changing the Space in the choice-function is not viable for a
multitude of reasons. Please read through the relevant chapters in MPG
first, in particular, what to do in each of the brancher methods
(32.1). The choice function creates a description of what the brancher
should do, and the commit method takes such a description and applies
it.

If it actually is important to only post the constraints once
(remember, always verify your assumptions on what costs time), I would
create alternate unary branches that create these additional
propagators with multi-way branches that perform the search.

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 on the web visit https://groups.google.com/d/msgid/gecode/c5d60622-8829-4314-904d-34922f50eaabn%40googlegroups.com.



--
Mikael Zayenz Lagerkvist
Reply all
Reply to author
Forward
0 new messages