[Scip] Heuristic Frequency

Vivek Periaraj vivek.periaraj at gmail.com
Wed Apr 3 11:45:55 MEST 2013


Hi Timo,

Is there something like SCIPsetHeurPriority() for changing the frequency of the heuristic after the initialization. I want the initial value to be 12, when depth <= 11, and to 1, when depth > 11. If I set to one value of 12, then if there are no nodes at the depth 12, then the next call would only be at 24.

Regards,
Vivek.

----- Original Message ----- 

From: "Vivek Periaraj" <vivek.periaraj at gmail.com> 
To: "Timo Berthold" <berthold at zib.de> 
Cc: scip at zib.de 
Sent: Wednesday, April 3, 2013 3:00:11 PM 
Subject: Re: [Scip] Heuristic Frequency 


> Yes. The best chances you have when you set the frequency to 1. ;-) 

:) Thanks very much! 

Yes, SCIP seems to be done with pricing and doesn't call the heuristic for a long time. But I think you are right. It's possible that there are no nodes at depth 12. All this time, I was going by the output of SCIPgetNTotalNodes(). I should try again with SCIPgetDepth(). I will try with this, and will report back if there are any issues. 

The nature of my problem is such that if I run my heuristic for one hour, I get some customer assignments fast. As time progresses, the assignments are not as fast. By running it for one hour, I could get lucky and quickly get some good solutions fast. 

There are no aborts in the heuristic call, as of now. 

Regards, 
Vivek. 

----- Original Message ----- 

From: "Timo Berthold" <berthold at zib.de> 
To: "Vivek Periaraj" <vivek.periaraj at gmail.com> 
Cc: scip at zib.de 
Sent: Wednesday, April 3, 2013 1:49:09 PM 
Subject: Re: [Scip] Heuristic Frequency 

Hi Vivek, 

> Do you think if I set the heuristic frequency to 10, I would have 
higher chance of the heuristics getting invoked twice? 
Yes. The best chances you have when you set the frequency to 1. ;-) 

> I counted the depth of the nodes using SCIPgetNTotalNodes(). I think I 
should use SCIPgetDepth()? 

Yes. 


So, what is the actual problem when the heuristic gets not invoked 
twice? Does SCIP run a long time, solving many nodes without calling 
your heuristic ever again? 
As I said before, as long as all nodes have depth <= 11, there will be 
no second call (and this can, in principle, be the case for up to 2000 
solving nodes). 

Differently asked: Why are you sure that there are nodes at depth 12 for 
which the heuristic does not get called? 

Another idea: Are there any "return SCIP_OKAY"s (aborting the heuristic 
for whatever reason) before your printout? 

Best 
Timo 

Am 03.04.2013 09:28, schrieb Vivek Periaraj: 
> Hi Timo, 
> 
> I also have printouts from the heuristic that shows at what node (based on SCIPgetNTotalNodes()) it gets invoked. 
> 
> So far, if the heuristics is invoked all the times, it gets invoked at the right frequency and at the right depth. 
> 
> Sometimes though, there is no invocation. 
> 
> Regards, 
> Vivek. 
> 
> ----- Original Message ----- 
> 
> From: "Vivek Periaraj" <vivek.periaraj at gmail.com> 
> To: "Timo Berthold" <berthold at zib.de> 
> Cc: scip at zib.de 
> Sent: Wednesday, April 3, 2013 12:43:50 PM 
> Subject: Re: [Scip] Heuristic Frequency 
> 
> Hi Timo, 
> 
> Thanks. 
> 
> I think I am using DFS with long dive (I have not changed the defaults) and I counted the depth of the nodes using SCIPgetNTotalNodes(). I think I should use SCIPgetDepth()? 
> 
> (For some reason, the log files from SCIP channels seems to be printing only spaces, after the presolve log, maybe because I have disabled some plugins). 
> 
> The node's objective as returned by SCIPgetLPObjval() is still not worse compared to the best incumbent. So this node may not have been pruned. Is it pruned for some other reason? Do you think if I set the heuristic frequency to 10, I would have higher chance of the heuristics getting invoked twice? Once at the root node and another at depth 11? 
> 
> Regards, 
> Vivek. 
> 
> 
> ----- Original Message ----- 
> 
> From: "Timo Berthold" <berthold at zib.de> 
> To: "Vivek Periaraj" <vivek.periaraj at gmail.com> 
> Cc: scip at zib.de 
> Sent: Wednesday, April 3, 2013 12:13:40 PM 
> Subject: Re: [Scip] Heuristic Frequency 
> 
> Hi Vivek, 
> 
> the frequency of calling heuristics is w.r.t. the depth of nodes, not the 
> number of nodes. Hence, the heuristic gets called at nodes in depth 0, 12, 
> 24, ... 
> 
> If you are doing a DFS that starts with a long dive, you will see 
> heuristic calls at the root, node 13, node 25,... . If, however, the tree 
> can always be pruned at depth at latest 11, the root node call will be the 
> only one. 
> 
> Also, how did you check that it was invoked at a certain depth? Did you 
> add some printf's or are you referring to the display character of the 
> heuristic being print as a first character of a SCIP output line? The 
> latter one only happens when an inmproving solution is found. This can of 
> course be quite arbitrary (in particular when your heuristic found the 
> optimum at the root, it will never happen again). 
> 
> Best regards 
> Timo 
> 
>> Hello, 
>> 
>> I have set the following attributes of a heuristic: 
>> 
>> #define HEUR_PRIORITY 10000 
>> #define HEUR_FREQ 12 
>> #define HEUR_FREQOFS 0 
>> #define HEUR_MAXDEPTH 100000 
>> #define HEUR_TIMING SCIP_HEURTIMING_AFTERNODE 
>> #define HEUR_USESSUBSCIP FALSE 
>> 
>> Heuristic is correctly invoked after the root node processing. 
>> 
>> And in some models, it's invoked at node 13, node 25, etc., correctly but 
>> in some cases, it's not invoked. What criteria decides whether the 
>> heuristic should be invoked or not? 
>> 
>> Regards, 
>> Vivek. 
>> _______________________________________________ 
>> Scip mailing list 
>> Scip at zib.de 
>> http://listserv.zib.de/mailman/listinfo/scip 
>> 


More information about the Scip mailing list