You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 text was updated successfully, but these errors were encountered:
I've tried to solve a problem from a YouTube video using MiniZinc.
The example is rather small. But I found that the various solver back-ends do have remarkably different run-times and optimization results.
The text was updated successfully, but these errors were encountered: