lingo.lol is one of the many independent Mastodon servers you can use to participate in the fediverse.
A place for linguists, philologists, and other lovers of languages.

Server stats:

69
active users

#MiniZinc

0 posts0 participants0 posts today
Replied in thread

@joshg Took a few minutes to type in, but it’s not egregious, the logic is straightforward and can be solved by hand easily. But it’s more instructive this way:

include "alldifferent.mzn";

% Two lists of ints between 1 and 5, both inclusive
% One we'll use for the indices of the matrix cell coordinates, and the other for cell values.
set of int: COORD = 1..5;
set of int: VALUE = 1..5;

% Define a matrix, which is a 2-dimensional array with indices for its cells
% defined by COORD, so between 1 and 5, where each matrix cell
% takes any value of those defined in the list VALUE:
array[COORD,COORD] of var VALUE: v;

% All different in rows: the 'j' coordinate advances in the column
constraint forall(i,j in v)(
alldifferent([v[i,j] | j in VALUE]));

% All different in columns: the 'i' coordinate advances in the row
constraint forall(i,j in v)(
alldifferent([v[i,j] | i in VALUE]));

% All the groups of cells that add up to 10,
% using either sums (+ sign) or multiplications (* sign)
constraint v[1,1] + v[1,2] + v[1,3] + v[1,4] = 10;
constraint v[1,5] + v[2,5] + v[3,5] = 10;
constraint v[2,1] + v[2,2] + v[3,1] = 10;
constraint v[2,3] * v[2,4] * v[3,4] = 10;
constraint v[3,2] + v[3,3] + v[4,2] = 10;
constraint v[4,1] + v[5,1] + v[5,2] = 10;
constraint v[4,3] + v[5,3] + v[5,4] + v[5,5] = 10;
constraint v[4,4] * v[4,5] = 10;

solve satisfy;

Congrats to the finalists for the Eureka Prize for Excellence in Research Software, developing and maintaining #MiniZinc, MRtrix3 and #limma

This prize recognises and celebrates those who develop and maintain software in Australia that underpins research and scientific discovery.
ardc.edu.au/article/finalists-

ARDC · Finalists Announced for the 2024 ARDC Eureka Prize for Excellence in Research Software | ARDCWe congratulate the finalists for the 2024 ARDC Eureka Prize for Excellence in Research Software.

Hi Mastodon!

I'm a computer scientist working on the #MiniZinc modelling language. The perfect way to model your #optimization / #orms problems. (At least if you you were to ask me).

As an #OPTIMA research fellow at #Monash University, I generally love research into programming languages & combinatorial optimisation methods.

When I don't have anything to say about work, you may find me posting about my hobbies, such as music, birds, cycling, and cricket, instead.
#introduction #introductions

Hi Mastodon!

I'm a computer scientist working on the #MiniZinc modelling language. The perfect way to model your #optimization / #orms problems. (At least if you you were to ask me).

As an #OPTIMA research fellow at #Monash University, I generally love research into programming languages & combinatorial optimisation methods.

When I don't have anything to say about work, you may find me posting about my hobbies, such as music, birds, cycling, and cricket, instead.