minizinc / minizinc-benchmarks Goto Github PK
View Code? Open in Web Editor NEWA suite of MiniZinc benchmarks.
License: MIT License
A suite of MiniZinc benchmarks.
License: MIT License
Hi,
There are a lot of warnings when flattening the model mqueens2.mzn with any *dzn file. I'm using the last Minizinc distribution (2.0.13) without any solver specific global constraint definition.
I tried an older version (2.0.2) and the fzn file was generated without warnings.
This is the first warning:
Warning: undefined result becomes false in Boolean context
(array access out of bounds)
mqueens2.mzn:55:
in call 'forall'
in array comprehension expression
with i = 1
with j = 1
mqueens2.mzn:56:
in binary '=' operator expression
in unary 'not' operator expression
mqueens2.mzn:57:
in binary '/' operator expression
mqueens2.mzn:59:
in unary 'not' operator expression
in call 'exists'
in array comprehension expression
with k = 1
mqueens2.mzn:60:
in binary '/' operator expression
in unary 'not' operator expression
in array access
Thanks.
There are legal systems (for example in the US and in the EU) where copyright sticks to authors and just declaring that something is in the public domain is not enough to facilitate safe re-use (without accidental copyright infringement), see https://en.wikipedia.org/wiki/Public_domain#Dedicating_works_to_the_public_domain. In my understanding, the only reliable way for donors to work around their copyright is to provide a suitable license. For example, minizinc-examples are issued under the MIT license and hence it is safe to re-use, modify, and redistribute them.
I've tried to solve a problem from a YouTube video using MiniZinc.
%
% This model strives to solve the problem
% discussed in a YouTube video of Michael Penn
%
% How large can a subset be???
% https://youtu.be/ZOx_DMeHjyE
%
% The solution shown is 905
%
int: n = 1989;
set of int: N = 1..n;
array[N] of var bool: select;
% selected elements must not be 4 apart
constraint
forall(i in 1..n-4) (not select[i] \/ not select[i+4]);
% selected elements must not be 7 apart
constraint
forall(i in 1..n-7) (not select[i] \/ not select[i+7]);
var N: elements = sum(select);
solve maximize elements;
output ["\(elements) elements"];
The example is rather small. But I found that the various solver back-ends do have remarkably different run-times and optimization results.
The model tents.mzn
makes the tacit assumption that the number of given trees is equal to the required number of tents.
Otherwise, the instance is ill-defined.
This holds for tents_1.dzn
and tents_2.dzn
but not for tents_3.dzn
, which has 50 given trees but requires 51 tents.
I suggest to fix the instance as follows:
n = 16;
a = [| 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0
| 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
| 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0
| 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0
| 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0
| 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
| 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0
| 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
| 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1
| 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
| 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1
%| 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
| 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
| 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0
| 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0
| 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|];
row_sums = [4, 3, 4, 2, 5, 2, 1, 7, 0, 3, 5, 2, 4, 3, 2, 4];
col_sums = [4, 1, 6, 1, 5, 2, 1, 7, 0, 5, 2, 3, 3, 4, 1, 6];
Retrieved this email from a user:
"Hi
I have started running all problems in the minizinc-benchmarks dataset.
I have found a few problems that do not compile with mzn2fzn or minizinc:
[...]"
Used MiniZinc version was not stated in the email.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.