model ModelName uses "mmxprs"; !gain access to the Xpress-Optimizer solver !sample declarations section declarations LOC = 1..7 A: array(LOC,LOC) of integer C: array(LOC,LOC) of integer x: array(LOC,LOC) of mpvar end-declarations C::[0,0,3,0,5,0,2, 0,0,12,6,3,4,1, 3,12,0,0,3,0,8, 0,6,0,0,4,0,0, 5,3,3,4,0,4,7, 0,4,0,0,4,0,0, 2,1,8,0,7,0,0] forall(i,j in LOC | j<>i) A(i,j):=1 forall(i,j in LOC) x(i,j) is_binary forall(i,j in LOC | C(i,j) = 0) x(i,j)= 0 forall(i in LOC) sum(j in LOC) (A(i,j)*x(i,j)+A(j,i)*x(j,i)) <= 1 ricavo:= sum(i,j in LOC |j>i) C(i,j)*x(i,j) maximize(ricavo) ricavo:=sum(i,j in LOC |j>i) A(i,j)*x(i,j) maximize(ricavo) writeln("Begin running model") !... writeln("End running model") end-model