[gecode-users] How to use CSP to sovle the problem of the assignment of values to variables
fei liu
liufei.yige at yahoo.com.cn
Mon Aug 15 10:34:15 CEST 2011
Dear developer,
I am now trying to use CSP to sovle the problem of the assignment of values to variables. But I got a couple of questions.
Problem description:
Each time I input a number of variables each of which has a value domain to the CSP solver, and a couple of constrains
(e.g. in the string form, put in a vector). That is to say, each time the number of variables and constraints are changing.
For example,
variables: x,y; //which you will get from a vector (in c++)
value domains: x: 1-5; y: 1-3; //which you will also get from a vector
constraints: x==y //it can be any boolean expression, and can be got from a string vector.
For this, I should get the following results:
x, y
1, 1
2, 2
3, 3
That is, we will get each assignment.
Questions:
-- how to define a dynamic IntVarArray given a variable name vector e.g. a vector that stores x and y
-- How to read constraints (in the string form) from a vector, e.g. a vector that stores "x==y" or other constraints.
That is, each time we use different constraints.
Could you please give me some suggestions or answers about these questions?
Thank you very much.
Fei Liu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20110815/e49699a4/attachment.htm>
More information about the users
mailing list