model ModelName uses "mmxprs"; !gain access to the Xpress-Optimizer solver !sample declarations section declarations N = 1..8 K: array(N,N) of integer x: array(N,N) of mpvar f: array(N,N) of mpvar end-declarations K::[0, 27, 20, 0, 0, 0, 0, 0, 0, 0, 0, 19, 15, 0, 0, 0, 0, 0, 0, 12, 0, 0, 9, 0, 0, 0, 0, 0, 14, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 5, 10, 0, 0, 0, 0, 0, 0, 0, 17] forall(i,j in N) x(i,j) is_binary sum(i,j in N) x(i,j) <= 8 forall(j in N | j<>1 and j<>8) do sum(i in N) f(i,j) = sum(k in N) f(j,k) end-do forall(i,j in N) do f(i,j) <= K(i,j)*x(i,j) end-do flusso := f(1,2) + f(1,3) setparam("XPRS_VERBOSE", TRUE) maximize(flusso) !end-model numarchi:= sum(i,j in N) x(i,j) f(1,2) + f(1,3) = getobjval minimize(numarchi) end-model