Re: Counting backtracks

From: Joachim Schimpf <j.schimpf_at_icparc.ic.ac.uk>
Date: Wed 30 Apr 2003 07:45:23 PM GMT
Message-ID: <3EB027D3.545AFBA5@icparc.ic.ac.uk>
Karen Petrie wrote:
> ...
> One question I have though, is that I can not find an equivalent of the
> minimize predicate in the IC library, is it possible to do this with IC?

The library(branch_and_bound) contains a generic minimize predicate,
which works for all solvers, including ic and fd.
You should use it even for fd because it imposes the bounds
slightly more eagerly and can therefore prune earlier in some
circumstances.
There is also a variant called bb_min/3 which allows you to select
different strategies and parameters for the b&b process.


For library(branch_and_bound), your code needs to be modified
slightly, because the event 280 is not used. Simplify your
write_info code as follows

write_info(Minimum):-
        printf("Found a solution with cost %d \n", [Minimum]),
        get_backtracks(B),
        printf("Backtracks to this point = %d \n \n", [B]).

and to do the minimization call

    bb_min(mylabeling(SearchVars), OptimalNumber,
           bb_options with [report_success:write_info/1])


-- 
 Joachim Schimpf              /             phone: +44 20 7594 8187
 IC-Parc                     /      mailto:J.Schimpf@imperial.ac.uk
 Imperial College London    /    http://www.icparc.ic.ac.uk/eclipse
Received on Wed Apr 30 20:45:31 2003

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:23 PM GMT GMT