1
0
This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
bytecode-benchmarks/tests/examples/latin_squares_fd.mzn
Jip J. Dekker b5f0d64642 Squashed 'prototype/' content from commit 91f7db00
git-subtree-dir: prototype
git-subtree-split: 91f7db00d45e7f991b5587ee07f09977ae311ee7
2021-07-29 14:28:24 +10:00

27 lines
697 B
MiniZinc

% RUNS ON mzn20_fd
% RUNS ON mzn-fzn_fd
% RUNS ON mzn20_fd_linear
% RUNS ON mzn20_mip
% latin_squares_fd.mzn
% vim: ft=zinc ts=4 sw=4 et tw=0
% Author: Peter Stuckey
% Edited: Ralph Becket
%
% Latin squares FD only.
int: size = 9;
set of int: range = 1..size;
array[range, range, range] of var 0..1: x;
constraint forall (i, j in range) ((sum (k in range) (x[i,j,k]) = 1));
constraint forall (i, k in range) ((sum (j in range) (x[i,j,k]) = 1));
constraint forall (j, k in range) ((sum (i in range) (x[i,j,k]) = 1));
solve satisfy;
output [ if j = 1 /\ k = 1 then "\n" else "" endif ++
if fix(x[i,j,k]) = 1 then show(k) else "" endif
| i, j, k in range ] ++ ["\n"];