Create subsets

  • 6 April 2020
  • 2 replies



I have a set of 30 Customers, {1,2,...30}. I want to create subsets of these customers. Specifically, I want to get subsets with cardinality 1,2 and 3. These sets combined should then form the set ‘Routes’, such that the set ‘Routes’  looks as follows: {1}, {2}, … , {30}, {1,2}, {1,3},… { 29,30}, {1,2,3} , {1,2,4} ….. So the idea is to obtain routes containing 1,2 or 3 customers.


I would really appreciate some hints about implementing this in AIMMS. 

Thank you in advance. 


2 replies

Userlevel 4
Badge +1

Hi, I’m wondering if you just want to use all the 1-3 cardinality routes as the possible candidate routes to solve your optimization problem, or you want to list them for other reasons. 

If it is the first case, you do not need to list all of them. The follow constraint will do the work:

sum(i, v_route(r,i)) <= 3, for all r

r is the index for your resulting route, and i is a customer. v_route(r,i) is 1 if customer i is in route r, and the total number of customers in a route does not exceed 3.

Hi @ectrics98 

Just checking in to see if Deanne’s suggestion helped you with your optimization problem?



Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator