constraint-programming

Optimise multiple objectives in MiniZinc

耗尽温柔 提交于 2021-02-10 12:44:33
问题 I am newbie in CP but I want to solve problem which I got in college. I have a Minizinc model which minimize number of used Machines doing some Tasks. Machines have some resource and Tasks have resource requirements. Except minimize that number, I am trying to minimize cost of allocating Tasks to Machine (I have an array with cost). Is there any chance to first minimize that number and then optimizate the cost in Minizinc? For example, I have 3 Task and 2 Machines. Every Machine has enough

Optimise multiple objectives in MiniZinc

拜拜、爱过 提交于 2021-02-10 12:43:19
问题 I am newbie in CP but I want to solve problem which I got in college. I have a Minizinc model which minimize number of used Machines doing some Tasks. Machines have some resource and Tasks have resource requirements. Except minimize that number, I am trying to minimize cost of allocating Tasks to Machine (I have an array with cost). Is there any chance to first minimize that number and then optimizate the cost in Minizinc? For example, I have 3 Task and 2 Machines. Every Machine has enough

Make K different (cardinality) google OR-TOOLS

旧时模样 提交于 2021-01-28 11:06:15
问题 I'm wondering if there is a generalisation of solver.AllDifferent(x) in google or-tools that allows for the specification of how many different elements I allow. So if len(x) = 4, then AllDifferent(x) means that len(set(x)) = 4. But what if I just want to enforce "at least 2 different", so: len(set(x)) >=2 ? Is there a constraint that generalises AllDifferent to be able to set the cardinality of the solution variable ? 来源: https://stackoverflow.com/questions/48021694/make-k-different

z3 alternative for Gecode branch() function?

南楼画角 提交于 2020-06-01 07:41:27
问题 In constraint solver like Gecode , We can control the exploration of search space with help of branching function. for e.g. branch(home , x , INT_VAL_MIN ) This will start exploring the search space from the minimum possible value of variable x in its domain and try to find solution.(There are many such alternatives .) For z3, do we have this kind of flexibility in-built ?? Any alternative possible?? 回答1: SMT solvers usually do not allow for these sorts of "hints" to be given, they act more

Simple constraint programming solver

柔情痞子 提交于 2020-05-29 02:39:12
问题 I'm trying to get familiar with constraint programming. All documentation/videos I've seen so far just contain description of top-level concepts and code examples based on CP-libraries utilization (like Choko, Gecode, JaCoP etc). I'd like to implement at least something simple in Java without any libraries. Are there any resources where I can find working code in Java/C#/C++/Python which implements main CP ideas? (at least "send more money" problem solution). (or, maybe, if somebody can

Example channelling constraints ECLiPSe

情到浓时终转凉″ 提交于 2020-01-11 01:41:17
问题 Can someone provide a simple example of channelling constraints? Channelling constraints are used to combine viewpoints of a constraint problem. Handbook of Constraint Programming gives a good explanation of how it works and why it can be useful: The search variables can be the variables of one of the viewpoints, say X1 (this is discussed further below). As search proceeds, propagating the constraints C1 removes values from the domains of the variables in X1. The channelling constraints may

Solution to Smullyan's numerical machines

江枫思渺然 提交于 2020-01-03 10:12:09
问题 Here I propose to find a solution to Smullyan's numerical machines as defined here. Problem statement They're machines that take a list of digits as input, and transform it to another list of digits following some rules based on the pattern of the input. Here are the rules of the machine given in the link above, expressed a bit more formally. Let say M is the machine, and M(X) is the transformation of X. We define a few rules like this: M(2X) = X M(3X) = M(X)2M(X) M(4X) = reverse(M(X)) //