简体   繁体   English

MiniZinc中搜索注释的影响是什么?

[英]What does the impact search annotation do in MiniZinc?

In MiniZinc it is possible to use the search annotation impact, it is explained as follows on the official website: 在MiniZinc中可以使用搜索注释的影响,在官方网站上解释如下:

annotation impact 注释影响

Choose the variable with the highest impact so far during the search 在搜索过程中选择目前影响最大的变量

What does this mean in practice? 这在实践中意味着什么? What is the highest impact? 影响最大的是什么? How is this calculated? 这是怎么计算的?

To understand the impact based variable selection, you have to understand first_fail . 要了解基于impact的变量选择,您必须了解first_fail In constraint programming we generally want to solve the hardest sub-problem first, failing quickly if no solution can be found. 在约束编程中,我们通常希望首先解决最难的子问题,如果找不到解决方案则快速失败。 The problem with first_fail is that it doesn't take into account the number of constraints that a variable is involved in, more would indicate that the a decision for the variable "harder", or the effect that choices on the variable had in other parts of the search-tree. first_fail的问题在于它没有考虑变量所涉及的约束的数量,更多的是表明变量的决策“更难”,或者变量的选择对其他部分的影响搜索树的。

As a sidenote, dom_w_deg is can be seen as compromise between first_fail and impact , where the constraints are taken into account, but the past decision are not. 作为旁注, dom_w_deg可以看作是first_failimpact之间的first_fail ,其中考虑了约束,但过去的决定却没有。

impact variable selection is supposed to be an improvement on first_fail where not just domain sizes are considered, but also the constraints it's involved in and how much "impact" historical choices had. impact变量选择应该是对first_fail的改进,不仅考虑了域大小,还考虑了它所涉及的约束以及历史选择的“影响”程度。 The variable with the highest impact is the one that is expected to be the hardest to assign the right value, taking all of this information into account. 具有最高影响的变量是预期最难分配正确值的变量,并考虑所有这些信息。

As you've seen, MiniZinc does not provide an exact specification of how the variable choice has to made. 正如您所见,MiniZinc没有提供变量选择必须如何制定的确切规范。 It is up to solver implementer to select a heuristic that fit the solver. 求解器实现者可以选择适合求解器的启发式算法。 Note that it would be hard to provide an exact heuristic guideline as it would heavily depend on how the solver tracks its variables and constraints. 请注意,很难提供精确的启发式指南,因为它很大程度上取决于求解器如何跟踪其变量和约束。

For ideas on possible implementations of impact based heuristics, I would suggest reading the paper "On the Efficiency of Impact Based Heuristics" by Marco Correia and Pedro Barahona. 关于可能实施基于冲击的启发式方法的想法,我建议阅读Marco Correia和Pedro Barahona撰写的论文“关于基于影响的启发式效率”。 You can also check your specific MiniZinc/FlatZinc solver for their implementation of the heuristic. 您还可以检查特定的MiniZinc / FlatZinc求解器,以实现启发式算法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM