Hi, I am doing the cover inequality now and anyone knows how to generate all subsets of a set in Xpress plsss?

Assuming that you are working with Mosel, you could calculate the set of subsets with some code like the following:

model "All subsets"

uses "mmsystem"

declarations

MySet: set of integer ! The original set

AllSets: set of set of integer ! Set of subsets

end-declarations

MySet:={3,1,7,5,9} ! Some sample data

MyList:=sum(i in MySet) [i]

qsort(SYS_UP, MyList) ! List of values in ascending order

forall(i in MyList) AllSets+={{i}}

forall(k in 1..MySet.size-2)

forall(i in MyList) AllSets+=union(s in AllSets | s.size=k and i>max(j in s) j) {(s+{i})}

writeln("All subsets: ", AllSets)

! If the original set is to be included:

AllSets+={MySet}

writeln(AllSets)

end-model

Assuming that you are working with Mosel, you could calculate the set of subsets with some code like the following:

model "All subsets"

uses "mmsystem"

declarations

MySet: set of integer ! The original set

AllSets: set of set of integer ! Set of subsets

end-declarations

MySet:={3,1,7,5,9} ! Some sample data

MyList:=sum(i in MySet) [i]

qsort(SYS_UP, MyList) ! List of values in ascending order

forall(i in MyList) AllSets+={{i}}

forall(k in 1..MySet.size-2)

forall(i in MyList) AllSets+=union(s in AllSets | s.size=k and i>max(j in s) j) {(s+{i})}

writeln("All subsets: ", AllSets)

! If the original set is to be included:

AllSets+={MySet}

writeln(AllSets)

end-model