[gecode-users] AFC of a Propagator

Christian Schulte cschulte at kth.se
Mon Jan 26 14:41:09 CET 2015


Hi Zoe,

 

Here is a patch that adds a disable_afc() function to a propagator: you need to call it when the propagator is created and then all increments and are ignored. It is not tested though but should work (famous last words…).

 

Good luck

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: zichenzu at gmail.com [mailto:zichenzu at gmail.com] On Behalf Of Zhu Zichen's cse
Sent: Friday, January 23, 2015 4:13 PM
To: cschulte at kth.se
Cc: users at gecode.org
Subject: Re: [gecode-users] AFC of a Propagator

 

Dear Christian,

 

The case you are worried is that when p and q have the same pruning effect and the existence of p would make q lost some chance to increase its AFC, right?

This case would not happen a lot because my constraint has little chance to have the same pruning effect with the other constraints. 

 

Actually, I would post p1 and p2 to a CSP respectively which have the same pruning power. But they subscribe different subsets of variables. I would like to compare there pruning efficiency under the similar heuristics. 

 

 

Zoe

 

On Fri, Jan 23, 2015 at 10:59 PM, Christian Schulte <cschulte at kth.se> wrote:

Dear Zoe,

 

No, the problem is that the AFC of _ q _ is not counted properly when you use it together with p! Is that not a problem?

 

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: zichenzu at gmail.com [mailto:zichenzu at gmail.com] On Behalf Of Zhu Zichen's cse
Sent: Friday, January 23, 2015 3:57 PM


To: cschulte at kth.se
Cc: users at gecode.org
Subject: Re: [gecode-users] AFC of a Propagator

 

Dear Christian,

 

You are worried that even though we do not count the AFC of p, the heuristic is not exactly the same with the one without posting p, right? It's acceptable. 

One reason is that my constraint does have the same pruning effect with other constraints in most of the cases. Another reason is that we 

do not require heuristics are exactly the same. 

 

So, just do not count AFC of p into its subscribed variables' AFC is enough. 

 

 

Regards,

Zoe

 

 

On Fri, Jan 23, 2015 at 10:28 PM, Christian Schulte <cschulte at kth.se> wrote:

Hi Zoe,

 

I have an idea for a fix (a hack let’s say) but I think it will not fix the problem you are trying to solve. Let me try to explain: when your own propagator p triggers failure then there are two effects. One is that the AFC is counted for p (this is the fix you ask for). But the other effect is that if p had not been there some other propagator q might have triggered failure and the AFC of q would have increased. But now q’s AFC will not be incremented.

 

So, are you really sure that what you ask for will fix the issue? Because I’d hate to suggest a fix that will not solve the real problem anyway.

 

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: zichenzu at gmail.com [mailto:zichenzu at gmail.com] On Behalf Of Zhu Zichen's cse
Sent: Friday, January 23, 2015 11:57 AM
To: cschulte at kth.se
Cc: users at gecode.org
Subject: Re: [gecode-users] AFC of a Propagator

 

Dear Christian,

 

Yes, it would be very very nice if you can help to achieve that. 

 

Zoe

 

On Fri, Jan 23, 2015 at 5:45 PM, Christian Schulte <cschulte at kth.se> wrote:

Hi Zoe,

 

No, by default that is not possible. In order to do it, one would have to really modify the kernel of Gecode.

 

I think you need it badly, right? If yes, I could think about it.

 

Best

Christian

 

--

Christian Schulte, Professor of Computer Science, KTH, www.gecode.org/~schulte/

 

From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf Of Zhu Zichen's cse
Sent: Friday, January 23, 2015 6:47 AM
To: users at gecode.org
Subject: [gecode-users] AFC of a Propagator

 

Dear all,

 

Is it possible to not count a propagator's AFC into its subscribed variables' AFC? 

Because now I use INT_VAR_AFC_SIZE_MAX() variable heuristic while I do not 

want there is a big difference on the heuristic with or without adding my own constraint. 

 

Many thanks. 

 

 

Zoe

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20150126/c693139a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: afc_disable.patch
Type: application/octet-stream
Size: 2616 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20150126/c693139a/attachment-0001.obj>


More information about the users mailing list