IBM ILOG Solver User's Manual > Developing Solver Applications > Designing Models > Remove symmetries > Use constrained set variables

Among the elements of a set, there is no necessary order, and a set differs from a list in this respect. Solver offers constrained set variables and predefined constraints such as cardinality to represent certain problems as sets.

Principle

Representing a problem as a set is useful for avoiding symmetries. Moreover, constrained set variables may help us reduce the apparent complexity of a model.

Example

Let's consider, for example, a crew-allocation problem in an airline company. Let's assume that a given flight requires six crew members.

We can represent this assumption by associating six constrained variables with the flight. Each of these variables represents a member of the crew. However, this representation is symmetrical: since there is no particular difference represented among the six crew members in this model, any permutation of the values of the six variables does not change the crew, but such a permutation would give rise to more (apparently different) solutions that really do not interest us.

A better model--one that suppresses those phony "different" solutions--uses a single constrained set variable, with a cardinality equal to 6. This model avoids the symmetries of the previous one since it accurately represents a crew as a set of members.