sets i /1*2/ j /1*4/ ; table alternative(i,j) distance between i and j 1 2 3 4 1 10 12 0 0 2 0 0 8 10 ; variable objective; binary variable y(i,j); equations oDef 'objective function' c2 'logical constraint only one alternative can be selected for each i' ; oDef.. objective =e= sum((i,j),alternative(i,j) *y(i,j)); c2(i) .. sum(j,y(i,j)) =e= 1; model m/all/; option mip = cplex; m.optfile = 1; $onecho > cplex.opt solnpool CpxSols.gdx solnpoolIntensity 4 solnpoolPop 2 solnpoolPrefix cpsol $offEcho solve m maximize objective using mip;