0

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 us consider a simpler case.

Say I have three set variables whose domains are [{},..., {1,2,3}], i.e. {}, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3} and that my only constraints are intersection(var_i, var_j) is empty for all i and j and i differs from j.

Obviously, if I understand well my own logic, it should give at least var_1 = {1}, var_2 = {2} and var_3 = {3}. But it could also give var_1 = {1,2,3} and var_2 = var_3 = {}. Indeed, running GeCode with these variables and constraints gives only one result: var_1 = var_2 = var_3 = all possibles subsets of {1,2,3}, suggesting that different solutions exist (suggesting that I could pick one subset in var_1 and could find subsets in the two other variables that satisfies the constrains.

My question is how I can make GeCode enumerate itself the different combinations. Because obviously, my final model will consist in way more integers in the sets and so way more subsets. Thus, I cannot afford the cost of doing the selection manually by setting variables myself, since I loose all the benefit that a constrain solver can offer.

Is there a possibilty that could help me solve this issue?

Nightzus
  • 11
  • 1

1 Answers1

0

A little confused by the question, but it looks like you're trying to understand how the general arc consistency is working. Are you looking to clarify why Gecode is giving you all possible subsets, or are you looking for Gecode itself to output these subsets for you to analyze?

Kyle Coventry
  • 555
  • 3
  • 9
  • Thank you for answering. Actually, if you could clarify why, it would help me. Though I think I might understand why gecode outputs that but cannot express it formally/in details... But I orignally thought that using a DFS searcher it would output multiple results and not just one with all those possible subsets. I really need to get one feasible solution satisfying the constraints I have posed and therefore am not really satisified with what I get as an output from GeCode. – Nightzus Jan 18 '15 at 00:59
  • Think about it like this: If you fix the value of var_1 to ANY value in its domain, var_2 and var_3 are both able to take on values to satisfy your constraint. As such, under your constraint, var_1 can be any value. The same argument is applied to var_2 and var_3 and thus you get an output of every combination. If you add an additional constraint, for example var_2 > var_1, then you will see the solution space becomes smaller. – Kyle Coventry Jan 18 '15 at 01:04
  • Ok, I understand now. But is there a way for Gecode to output only one feasible solution out of the possible combinations (say var_1 = {1}, var_2 = {2} and var_3 = {3}) automatically? As I said, if I were to do that myself on a luch larger problemn it wouldn't be scalable. – Nightzus Jan 18 '15 at 01:25
  • If you're working with AMPL, try checking this out for what you need: http://ampl.com/products/solvers/gecode-options/ – Kyle Coventry Jan 18 '15 at 01:30