[Scip] Setting time limits correctly for slave problems

Martin Bergner bergner at or.rwth-aachen.de
Fri Sep 9 15:30:07 MEST 2011


Hi all,

I have some serious problem with time limits. Assume for the sake of
simplicity that I'm solving a pricing problem with a general MIP (again
with SCIP). Assume further that we have a time limit on the original
problem. Now it would be sensible thing to also set a time limit on the
pricing problem such that it doesn't take too long. Somehow, I seem to
struggle with that. That is, unfortunately, it happens regularly that
the pricing problem is stopped because of a time limit while the master
problem is happily trying to price (without too much progress, as you
would think). Actually, the problem is even more complicated with 2
nested instances (GCG: original -> master -> pricing).

Currently, the time limit of the master is determined as follows in each
call of the relevant relaxator:

SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) );
if( !SCIPisInfinity(scip, time limit) )
{
   SCIP_CALL( SCIPsetRealParam(master, "limits/time",timelimit - SCIPgetSolvingTime(scip) + SCIPgetSolvingTime(master)) );
}

Then I call:
SCIP_CALL( SCIPsolve(master) );

if(SCIPgetStatus(master) == SCIP_STATUS_TIMELIMIT)
{
   assert(SCIPisStopped(scip)); /* parent instance should also hit the time limit */
}

Basically, the time limit is set to the time left in scip plus the time
spend in master such that master has exactly the time limit of scip
left. This does not seem to work, the assert is regularly (not always)
triggered. That happens even if I add a small constant to the time limit
(1-10s).

My question is now: Given a SCIP instance with a time limit, which time
limit should I give to the master (or pricing) such that I can be sure:
If the pricing decides to bail out because of time limit, the original
(master) should too. Alternatively: How can I signal from a relaxator or
a pricer that the solving process is now over?

To further complicate matters I solve the pricing problems concurrently
with pthreads. I assume that the CPU clock is not what I want anyway,
but even using wall clocks doesn't seem to work. Maybe there is
something to watch out for here.

I spend some time on this issue already but I don't seem to get it
right. If this was a bit too confusing, don't hesitate to ask for more
information. 

I hope you can give me some hints.

Regards and thanks,
Martin



More information about the Scip mailing list