Pergunta

A constraint model may have restrictions or provide hints to the constraint solver to solve the problem more efficiently by defining the order in which variables are solved for. Is there a mechanism to specify the order in which variables need to solved in MiniZinc or FlatZinc ?

Foi útil?

Solução

int_search/4 is used for search annotation, i.e. for stating the involved variables and the variable/value strategies.

Example:

solve :: int_search(q, first_fail, indomain_min, complete) satisfy;

See more about this in the MiniZinc tutorial (section 5.2): http://www.minizinc.org/downloads/doc-latest/minizinc-tute.pdf The FlatZinc specification has a detailed list of the different strategies: http://www.minizinc.org/downloads/doc-1.6/flatzinc-spec.pdf (section 5.6.1).

Outras dicas

More flexible control over the search process is provided by Search Combinators, which are described in the publication below.

Schrijvers, Tom, et al. "Search combinators." Principles and Practice of Constraint Programming–CP 2011. Springer Berlin Heidelberg, 2011. 774-788. Online at http://arxiv.org/pdf/1203.1095.pdf

Some implementation exists for Gecode, see the bottom of Gecode's FlatZinc page

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top