set i starting / 1*2 / j ending / 1*4 / k set to derive iterations / 1*20 /; table alternative(i,j) distance between i and j 1 2 3 4 1 10 12 0 0 2 0 0 8 10 ; alias (i,ii),(j,jj),(k,kk); variable objective some objective variable; binary variable y(i,j) binary variable; parameter report1(k,i,j) solution report when i = 1 report2(k,ii,jj) solution report when i = 2 sol(k) feasible solution record ; report1(k,i,j) = 0; report2(k,ii,jj) = 0; equation c1 objective function c2 logical constraint only one alternative can be selected for each i, cut(kk,i,j,ii,jj) cutting constraints; c1.. objective =e= sum((i,j),alternative(i,j) *y(i,j)); c2(i).. sum(j, y(i,j))=e=1; cut(kk,i,j,ii,jj)$(report1(kk,i,j) and report2(kk,ii,jj)).. y(i,j) + y(ii,jj) =l= 1; model mymodel /all/; solve mymodel maximize objective using mip; loop (k, report1(k,i,j) $(ord(i) eq 1)=y.l(i,j); report2(k,ii,jj)$(ord(ii) eq 2)=y.l(ii,jj); sol(k) = objective.l; display report1, report2,sol; solve mymodel maximize objective using mip; abort$(mymodel.modelstat <> 1) " model not normally completed", mymodel.modelstat; );