Questions tagged [minizinc]

MiniZinc is a solver-independent Constraint-Programming modelling language.

MiniZinc as modelling language is high-level enough to express most constraint problems easily, but low-level enough that it can be mapped onto existing solvers easily and consistently. This is done by converting the MiniZinc model to a lower-level language, FlatZinc. It is a subset of the higher-level language Zinc.

Around MiniZinc, several FlatZinc solvers and an IDE for development are freely available.

The MiniZinc home is here: http://www.minizinc.org

Hakan Kjellerstrand's MiniZinc page has lots of MiniZinc models and global constraint definitions.

426 questions
2
votes
1 answer

Accessing minizinc data from Python

I'm using the Python interface to Minizinc and read both model (.mzn) and data (.dzn) from external files. Is there a way to access problem data from Python? As example I use cakes2-model from Minizinc manual, which has a decision variable b and a…
MartinJ
  • 23
  • 2
2
votes
1 answer

Is there a way to customize int_search in minizinc?

I am dealing with graph coloring problem and want to know if I can specify the search strategy. I found the search annotations, such as int_search(q, first_fail, indomain_min), but for example, I want the algorithm to choose the next nodes with the…
Nourless
  • 729
  • 1
  • 5
  • 18
2
votes
1 answer

Abort: Unable to create linear formulation for the `float_times(X_INTRODUCED_44_, X_INTRODUCED_45_, X_INTRODUCED_46_)` constraint

I'm coding a MIP problem using Minzinc with Coin-bc solver. But, It's raise a error like the title. It's due to eta_cpu & cpu_used both are variables, When I remove one of them from the Objective Function income, it become work. System point out set…
Acbogu
  • 65
  • 6
2
votes
2 answers

Using Cumulative function for Rectangular Placement

I have a rectangular placement problem. What I want is to place rectangles of size x by y into another rectangle without overlapping. What I want in the end is the starting point of each rectange. I made this part OF code for it, the logic was that…
Fabrizio
  • 33
  • 4
2
votes
2 answers

Difference between similar MiniZinc constraints

In the solution of the Zebra puzzle (http://rosettacode.org/wiki/Zebra_puzzle#MiniZinc) there's a constraint stating that one of the pets must be a zebra: var 1..5: n; constraint Gz[n]=Zebra; Has the expression below a different meaning? They…
Attila Karoly
  • 951
  • 5
  • 13
2
votes
2 answers

How to improve the performance of my graph coloring model in MiniZinc?

I have created a model for solving the graph coloring problem in MiniZinc: include "globals.mzn"; int: n_nodes; % Number of nodes int: n_edges; % Number of edges int: domain_ub; % Number of colors array[int]…
2
votes
1 answer

Are half-reified predicates considered part of the standard?

The FlatZinc documentation says that only non-standard predicates must be declared at the top of a FlatZinc model: Predicates used in the model that are not standard FlatZinc must be declared at the top of a FlatZinc model, before any other lexical…
Patrick Trentin
  • 7,126
  • 3
  • 23
  • 40
2
votes
2 answers

How to identify minizinc problem(Maximizing or Minimizing) has multiple answers

I just did some experiment on what will happen if a optimisation problem has many solutions.I know that by MiniZinc we can identify multiple answers for satisfy problem.(Like map colouring in user guide). And MiniZinc always show a dotted double…
suresh_chinthy
  • 377
  • 2
  • 12
2
votes
1 answer

Interface MiniZinc to other languages

I want to solve a problem for which a score function has been implemented in Prolog. Would it possible to call Prolog (or another language) from a MiniZinc script in the case an optimization function is defined in another language? For instance,…
catbow
  • 85
  • 9
2
votes
1 answer

Minizinc Python - using .dzn module instead of instance module

Imagine I have .mzn file called abc.mzn and it is as follows. array[1..3] of int:a; output[show(a)]; Now I have a .dzn file called cde.dzn and it is as follows. a=[1,2,3]; I will run minizinc python package as below, import minizinc as…
suresh_chinthy
  • 377
  • 2
  • 12
2
votes
1 answer

How to present the efficiency of MiniZinc in a research

Some time ago I am writing an OR related article for publication. In the article a MILP model is show for a certain Optimization problem using MiniZinc. I resolve 10 instances optimally out of 10 instances. An advisor reviews it and mentions the…
2
votes
1 answer

Checking for items in a MiniZinc array

I want to create two arrays in MiniZinc with the same items, not necessarily in the same order. Here, every item in A0 should also be in A1: array[1..3] of var int:A0; array[1..3] of var int:A1; constraint forall(A2 in A0)( (A2 in A1) /\ A2 < 5 …
Anderson Green
  • 30,230
  • 67
  • 195
  • 328
2
votes
2 answers

Running MiniZinc in Python through the native interface in Win10

I am trying to call MiniZinc through python while using the native python interface. The interface is working under Ubuntu but not in Win10. The code I am using is the following which is found on the official website of MiniZinc A Basic Example I…
Georgios
  • 861
  • 2
  • 12
  • 30
2
votes
1 answer

Minizinc. Count number of shifts in a cycle

Continuing with the other post ( Minizinc: generate a valid shift ). I am trying to have a maximum of 2 im between double ls. Doing this with a regular constraint is quite hard as the transition table would be quite big (too many paths). Is there…
trxw
  • 63
  • 6
2
votes
1 answer

Is there a way to format strings in MiniZinc?

Is there a way to format MiniZinc output to create, for example, tables in which some of the entries are strings, whose size is determined during the computation? As a test case I tried to run output ["\(length(show(1234)))"]; but got an error…
RussAbbott
  • 2,660
  • 4
  • 24
  • 37