[gecode-users] Scheduling A Propagator After Backtrack

Christian Schulte cschulte at kth.se
Wed Apr 20 16:35:48 CEST 2016


No, you need to keep advisor and council: they will not take much memory, it’s really the sets that eat memory. That might mean that you have to take out the integer set information from your advisors (you do not say so but that is my guess here). Subscriptions by propagators also take memory!

 

Then you need to check the flag when an advisor is run. That should work.

 

Cheers

Christian

 

--

Christian Schulte, www.gecode.org/~schulte

Professor of Computer Science, KTH,  <mailto:cschulte at kth.se> cschulte at kth.se

Expert Researcher, SICS,  <mailto:cschulte at sics.se> cschulte at sics.se

 

From: Yunus Acikoz [mailto:yunusacikoz at gmail.com] 
Sent: Wednesday, April 20, 2016 09:52
To: Christian Schulte
Cc: users at gecode.org
Subject: Re: [gecode-users] Scheduling A Propagator After Backtrack

 

Using a flag is a good idea, but without initializing the council and the advisors, there's nothing to run the propagator if I understood correctly. Am I right?

How about subscribing the propagator to views in the beginning and then canceling the subscription once the advisors are initialized in the first call of propagate()?  To be honest, it doesn't sound very wise to me but just an idea.

 

About the previous domain thing: I need to know which values are removed from my integer views to use them in a labeling algorithm. That was the only way I could think of.

 

Cheers,

Yunus Acikoz

 

On Wed, Apr 20, 2016 at 10:33 AM, Christian Schulte <cschulte at kth.se> wrote:

Hi Yunus,

 

The point is: you cannot schedule a propagator during copying (the system will crash).

 

Copying lazily is normally an excellent idea, many Gecode propagators do it. One way to do it is to use a flag whether the propagator has been run. When you clone the propagator you set it to false and in the propagate() function you can check whether you have run the propagator.

 

Would that do for you?

 

Storing the whole previous domain sounds very excessive to me, though and integer sets are definitely not an efficient data structure for that purpose. Maybe you could also start thinking about maintaining less information?

 

Hope that helps.

 

Cheers

Christian

 

--

Christian Schulte, www.gecode.org/~schulte

Professor of Computer Science, KTH, cschulte at kth.se

Expert Researcher, SICS, cschulte at sics.se

 

From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf Of Yunus Acikoz
Sent: Wednesday, April 20, 2016 09:11
To: users at gecode.org
Subject: [gecode-users] Scheduling A Propagator After Backtrack

 

Hi,

 

I would like to know if it's possible to schedule a custom propagator such that it is immediately propagated after backtracking. I mean something like executing the code below in the copy function of the propagator:

 

        auto copy_propagator = new(home)AdvisedPropagator(home, share, *this);

        Gecode::Int::IntView::schedule(home, *copy_propagator, Gecode::Int::ME_INT_DOM);

 

 

So the newly generated copy of the propagator (without its council being copied) is scheduled to be run when the search engine turns back to that node. Does it make sense at all?

 

I use advisors and they consume too much memory. Each advisor holds the previous state of the domain of its subscribed view as an IntSet, an unsigned short index and an enum to keep info about which variable array it belongs to.

I want to initialize advisors lazily, so that they are only created when the propagator is actually used. I thought maybe I could do it in "propagate" function with an initial propagation.

 

Thanks in advance,

Cheers,

Yunus Acikoz

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20160420/8da981bb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4623 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20160420/8da981bb/attachment.bin>


More information about the users mailing list