Re: [eclipse-clp-users] bb_min problem

From: Matthew Skala <>
Date: Tue, 24 Aug 2010 12:26:01 -0400 (EDT)
On Tue, 24 Aug 2010, Bogdan Tanasa wrote:
> For some reasons the bb_min predicate does not explore the solution space.

I don't know if this is your problem, but the use of foreach inside your
pb_search predicate looks very odd to me.  I'm not sure it will have the
effect you intend of labelling all variables one at a time.  You seem to
want the effect of the foreach loop to be the logical conjunction of all
its iterations, and I'm not sure that's really what foreach loops do.  I
rather think they are more like backtracking loops, with some special
variables (and only those) saved across each backtrack.  In any case, even
if the foreach loop did what you wanted, it would be forcing the variables
to be labelled in the order visited by the loop instead of using some
smarter heuristic, and that could make a show-stopping difference to the
performance of the search.  Although you're calling search/6, you're only
calling it on one variable at a time, so it can't meaningfully do variable
selection.  (Your use of "first fail" is of no use because you're
overriding it with the one-at-a-time loop.)

I think you'd be better off building a list of variables and passing that
into search/6 to have it label them in its own choice of sequence.  The
list should include ALL the variables that need to be labelled, including
the objective.

I'm also not sure you can just use a user-defined predicate like
reliability_csp inside a constraint expression without further
formalities, even if that would be allowed in ordinary arithmetic; if not,
you may have to redesign that part to compute the objective function
through constraints.
Matthew Skala, postdoctoral researcher, Universities of Toronto and Waterloo
Received on Tue Aug 24 2010 - 16:38:05 CEST

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET