there is a set "1,2,3,4,5". i wanna write constraints for subsets of this set. for example
x1=1,
x2=1,
x3=1,
x4=1,
x5=1,
x1+x2=2,
x1+x3=2,
x1+x4=2,
x1+x5=2,
x2+x3=2,
x2+x4=2,
x2+x5=2,
x3+x4=2,
x3+x5=2,
x4+x5=2,
x1+x2+x3=3,
x1+x2+x4=3,
x1+x2+x5=3,
x1+x3+x4=3,
x1+x3+x5=3,
x1+x4+x5=3,
x2+x3+x4=3,
x2+x3+x5=3,
x2+x4+x5=3,
.
.
.
Topic
NOTICE: developerWorks Community will be offline May 2930, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
4 replies
Latest Post
 20130103T09:30:18Z by SystemAdmin
ACCEPTED ANSWER
Pinned topic Writing constraints for subsets of a set.
20121230T09:48:21Z

Answered question
This question has been answered.
Unanswered question
This question has not been answered yet.
Updated on 20130103T09:30:18Z at 20130103T09:30:18Z by SystemAdmin

ACCEPTED ANSWER
Re: Writing constraints for subsets of a set.
20121230T21:25:06Z in response to SystemAdminOkay. 
ACCEPTED ANSWER
Re: Writing constraints for subsets of a set.
20121230T21:40:03Z in response to SystemAdmin:) how can i write these constraints (in closed format) by using subsets of this set?
ACCEPTED ANSWER
Re: Writing constraints for subsets of a set.
20130101T23:26:48Z in response to SystemAdminIn what language are you programming? If it's OPL, you'll have better luck asking on the OPL forum. If it's a general purpose language for which CPLEX has an API (C, C++, Java, Python), there are a few ways to do it, revolving around your favorite way to compute the powerset of a set of integers. If it's MATLAB, there may be a clever way, but you'll need a MATLAB user to tell you (which lets me out).
Paul
Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
ACCEPTED ANSWER
Re: Writing constraints for subsets of a set.
20130103T09:30:18Z in response to SystemAdminsir thanks for your help. i am usin OPL. so i'll open a new thread on OPL forum. i'm new at all these :)

