57 questions
3
votes
1
answer
84
views
Configure script does not generate makefile properly for 3rd party library used in R package with RCPP (rtools44)
We are currently working on a package utilizing the constraint programming solver Gecode (6.2). For the sake of usability we would like to include the Gecode source files with the package, so users do ...
0
votes
1
answer
41
views
How can I minimize the overlap with previous solutions when finding all solutions in minizinc
I want minizinc to find solution in a particular order to minimize the overlap with existing solutions.
Sort of bredth first search instead of depth first search, if that makes sense.
I am using a ...
1
vote
1
answer
145
views
Constraint solver that can handle floating point exponentiation
Are there any constraint solvers that can understand exponentiation of potentially unbounded floats aka. real numbers?
Given this simple program,
var float: x;
constraint x^x = 27;
solve satisfy;
I ...
0
votes
1
answer
125
views
MiniZinc: type error: invalid type for comprehension: `array[int] of var opt string'
I use MiniZinc 2.7.6 and Gecode 6.3.0 when I run the below block of code:
int: user_property_1 = 1; % user_property_1-parameter
int: user_property_2 = 2; % user_property_2-parameter
int: ...
0
votes
0
answers
77
views
Gecode element constraint seems to hang with large seperation between elements
I am just getting started with Gecode element constraints. It seems to hang when the list elements are too far apart.
Here is the full program to demonstrate the issue, with a few knobs (MACROS) to ...
1
vote
1
answer
63
views
Unable to initialize Gecode's `IntSet` from `Vector`
As per the Gecode documentation "Modelling and Programming with Gecode", an IntVar can be created with IntSet
This is also confirmed by Gecode's reference for IntVar at https://www.gecode....
0
votes
0
answers
197
views
Minizinc Gecode parse_error(stderr)
I'm trying to rum my minizinc model through python but it seem to be a problem with the solver Gecode. I've tryed using a simpler model but the result is the same. If i use another solver like chuffed ...
1
vote
1
answer
451
views
MiniZinc : how to implement custom search heuristics? (in Gecode)
For full context, my goal is to implement an "agent" that attempts to learn the best heuristic from a given pool in an online fashion (meaning that the learning and the solving procedures ...
0
votes
1
answer
46
views
Segmentation fault Gecode 6.2.0 when running examples
I am getting a segmentation fault when I attempt to run examples/<some example> after my installation of Gecode. I configured before make with
./configure -with-gmp-include=/usr/include/x86_64-...
1
vote
1
answer
299
views
Adding "show" statement to Minizinc model takes too long to solve
I am currently trying to develop a (fairly basic) model in Minizinc.
I have reached a point up until now, where I can run the model and a satisfactory solution is found (basically calling "solve ...
0
votes
1
answer
434
views
MiniZinc int out of range
I am trying to create a function in MiniZinc that can determine the distance between a line and a point. I want the function to only use integers. My idea is as follows:
In the case the point is not ...
1
vote
1
answer
368
views
Error: Gecode: Float::linear: Number out of limits
I am building a simple model on Minizinc 2.5.3 (latest version) and Gecode 6.3.0 to try and organize a weapons production operation. When running the code, the following error appears:
Error: Gecode: ...
0
votes
1
answer
152
views
why does this simple Gecode example not compile?
I am trying to learn gecode and am trying to get the example found here to work.
// To use integer variables and constraints
#include <gecode/int.hh>
// To make modeling more comfortable
#...
0
votes
1
answer
349
views
Impact of input order on performance of constraint solver
Does the input ( boolean and arithmetic equations ) order matters to the constraint solvers like Gecode and SMT solvers like microsoft Z3 ?? If yes, which one of these two will perform better provided ...
0
votes
1
answer
266
views
z3 alternative for Gecode branch() function?
In constraint solver like Gecode , We can control the exploration of search space with help of branching function. for e.g. branch(home , x , INT_VAL_MIN ) This will start exploring the search space ...
0
votes
1
answer
1k
views
Constraint solver vs SMT solver
can someone give me examples that can be solved using SMT solver ( like microsoft z3 ) but cant be solved by constraint solvers ( like Gecode ) ?? What is the basic difference between constraint ...
2
votes
1
answer
266
views
How to print values of variables in gecode
I am trying to solve linear equation 15 * x + y + 0.4*z == 100 using gecode. I want to print the values of x,y,z. But, when i run following code,
class LinearEq1 : public Space {
protected:
...
1
vote
1
answer
718
views
Gecode vs. Z3 for Constrained Randomization
I'm looking for a C++-based alternative to the SystemVerilog language.
While I doubt anything out there can match the simplicity and flexibility of the SystemVerilog constraint language, I have ...
3
votes
2
answers
562
views
How to maximize a var int that is larger than 32 bits?
I am using minizinc with built-in Gecode 6.1.1 and I want to maximize an objective function with values that are far greater than the max int 32.
The maximum value of an integer with 32 bits is ...
0
votes
2
answers
464
views
how to include gecode as an external library in my c++ project using cmake?
I am new to CMake, and need some directions on a simple issue: I build the gecode from source in my Ubuntu 18.04 machine by following this link. The library is installed in /opt/gecode-release-6.2.0 ...
0
votes
1
answer
218
views
How to run a .cpp file with Gecode Framework on Linux?
I use Ubuntu 18.04 and try to compile the example 'money.cpp' file that Gecode brings. I downloaded (gecode-release-5.1.0.tar.gz) and extract it. Then to install Gecode I do the following steps:
(1) ....
0
votes
2
answers
278
views
Gecode: constraining integer variables using a float value
I use Gecode through its C++ API in a kind of learning context with positive and negative examples.
In this context I have two BoolVarArray: positive_bags_ and negative_bags_.
And what I want to do ...
0
votes
1
answer
82
views
GECODE Pairwise Distinct Columns In A Matrix
I'm working on a GECODE solver to implement a Matrix Generation problem. I have figured out all the constraints I require except for one:
Given a Matrix[M, N], all column vectors must be pairwise ...
1
vote
1
answer
109
views
Do Gecode and G12 (MIP) use infinite precision arithmetic?
I just want to know if both these two MiniZinc solver use infinite precision arithmetic by default.
2
votes
1
answer
141
views
Gecode, error while compiling program with gecode.int.hh
I installed Gecode 6.0 for VS 2017. Added directories to /lib and /include. Then included gecode/int.hh to the Hello World program. During compilation got 3 strange errors:
Error C2084 function "...
1
vote
1
answer
410
views
Display time differs from actual solving time taken in Minizinc model
I wrote a large minizinc model including var variables with int_search statement for proper ordering. It contains output statement in which I use fix(var variables) statements to output the variable ...
2
votes
1
answer
238
views
Alternate branching strategies in Gecode
I post here to ask if there is a way to alternate different strategies of branching. Let me explain, I have an efficient branching strategy which we'll call the strategy A. The biggest problem is that ...
2
votes
1
answer
133
views
How do I use a Merit function in Gecode?
I am trying to use a merit function for my branching in Gecode. In the MPG, the Gecode Manual, an example merit function is stated, and how to pass it to the branching. But I cannot figure out where ...
2
votes
1
answer
247
views
In Gecode, accessing home/space variables values from merit function
In Gecode, I am using a merit function to select variables when branching.
In order to compute variable v's merit, I need to access some other variables values, but it looks like at the time the ...
6
votes
1
answer
2k
views
Cardinality constraints in MiniZinc
The MiniZinc constraint solver allows to express cardinality constraints very easily using the built-in sum() function:
% This predicate is true, iff 2 of the array
% elements are true
predicate ...
4
votes
1
answer
838
views
Minizinc, how to create a map or a dictionary datastructure
I have a simple question regarding the Minizinc's syntax. My input .dzn file contain a set of 2 dimentional arrays (approximately up to 30 arrays), declared as follows:
rates_index_0 = array2d(1..3, ...
1
vote
0
answers
62
views
Can we assign a new propagator different from domain and bounds in GECODE solver for solving linear constraints?
Linear equations/inequations can be easily solved by simplex algorithm which is very fast. But for GECODE solver we only have two propagators : domain and bounds which solve the constraints that have ...
2
votes
1
answer
262
views
Minizinc, Gecode, how to get an identical solutions across distributed servers, with multi-solution model?
I am using minizinc and gecode to solve a minimization problem in a distributed fashion. I have multiple distributed servers that solve the same model with identical input and I want all the servers ...
1
vote
1
answer
38
views
Can you get use of arbitrary-precision arithmetic?
I am modeling algorithm to hardware mapping with Gecode and standard Gecode::Int::Limits is too small at least because I want to target systems with more than 2^32 memory.
Is there a way to get use ...
2
votes
2
answers
527
views
Minizinc: Trivial equality unsatisfiable
I have the following minizinc model:
include "globals.mzn";
var 0..9: A_1_1;
var 0..9: A_2_1;
var 0..9: A_3_1;
constraint (A_3_1+A_2_1+A_1_1) = A_1_1;
solve satisfy;
The model should have the trivial ...
3
votes
2
answers
672
views
MiniZinc can not find a solution when output statement introduced
I have a simple model written in minizinc and I use gecode to solve it by compiling it into flat-zinc first. As an input, the model takes some constants, arrays, and matrices (in the form of 2-...
0
votes
1
answer
445
views
Call gecode from Java using MiniZinc model
I would like to solve a model with dynamic arguments at run-time in Java. I have my problem written in MiniZinc. From a terminal I can solve the model by calling the following commands:
mzn2fzn ...
0
votes
0
answers
38
views
Formulating mapping constraint(gecode)
I need to express a constraint for 2 integer Arrays of the same size
x_i = x_j => y_i = y_j
in other words, there is an integer function such
x = f(y)
Is there any solutions for it?
1
vote
0
answers
123
views
Gecode constraint "each value in array appears at least k times"
it's Gecode c++
I have an IntVarArgs value of length n and I want to push a constraint that each value in array appears at least k times (or 0)
f.e array [1, 2, 3, 1, 2, 3, 4, 4, 4] satisfies this ...
1
vote
0
answers
43
views
Gecode pair counting constraint
I work with Gecode on C++
I have two IntVarArgs variables both of length of n, with domain from 0 to k
I need a constraint expression that counts unique pairs between these 2 arrays
f.e I want ...
0
votes
1
answer
88
views
Model suggestion for graph for Constraing Programing solver (gecode)
Problem : Given a labeled(1..n) undirected graph, create a model in Gecode for finding a supergraph with a given sequence degree:
Difficulties: the main difficulty is to find fancy model to ...
-1
votes
1
answer
1k
views
Run first program with Gecode
Please i need your help.
I have installed the toolkit for developing constraint-based systems and applications Gecode 4.4.0 on Windows 8, also the compilator C++ Dev C++ 5.9.2 but i still don't know ...
2
votes
0
answers
109
views
R interface to Gecode (open source constraint programming toolkit)
I'd like to use the open-source Gecode (gecode.org) framework for constraint programming within R. So far I did not found any direct route. I found lots of bindings and interfaces to Ruby, Python, ...
1
vote
1
answer
282
views
Search strategy with optional variables
I'm implementing a simple model in Minizinc to schedule tasks with different priority and duration in a series of time slots, but not all the tasks can be scheduled so some will be left out and I'm ...
1
vote
0
answers
414
views
Running Minizinc model produces unknown error
I am a beginner with minizinc and optimization. I am trying to flesh out a curve of points where only average decile statistics are available.
Here is my model:
array[1..10] of float: deciles;
...
1
vote
1
answer
368
views
Custom GeCode propagator not getting scheduled
I'm implementing a custom sum propagator in GeCode. The problem I'm trying to model involves a number of sum constraints each of which can be propagated further according to a problem-specific ...
3
votes
2
answers
2k
views
debugging minizinc (anyway, did I found a bug?)
I'm familiarizing with the basic of MiniZinc. So, armed with the MiniZinc IDE, I write snippets like
solve satisfy;
string: s1 = "hello";
string: s2 = "world";
function list of int: cdr(list of int:...
0
votes
1
answer
257
views
Constraint Programming over integer set variables
I am using GeCode to build a software for solving a specific task. I modeled my problem using integer set variables and some constraints over these variables. But for the matter of this question, let ...
0
votes
3
answers
226
views
Why can't one clone a `Space` in Gecode before solving the original one?
I'm looking for a way to copy Space instances in Gecode and then analyze the difference between the spaces later.
However it goes already wrong after the first copy. When one copies the code in the ...
0
votes
1
answer
145
views
Get a list of variables in a Space in Gecode
Gecode uses Spaces to represent the constraint satisfaction problem in progress: each time a decision point is reached, the Space is copied.
I want to perform analysis on these spaces in progress. Is ...