model ModelName options noimplicit uses "mmxprs" ! uses "mminsight" ! uncomment this line for an Xpress Insight model declarations CALLS: set of string ARCS: set of string PATHS: range CAP: array(ARCS) of integer DEM: array(CALLS) of integer CINDEX: array(PATHS) of string MaxFlow:linctr NARCS: integer end-declarations initialisations from "g3routing.dat" CAP DEM CINDEX end-initialisations finalise(ARCS) finalise(CALLS) finalise(PATHS) NARCS:=getsize(ARCS) declarations ROUTE: array(PATHS,1..NARCS) of string flow: array(PATHS) of mpvar end-declarations initialisations from "g3routing.dat" ROUTE end-initialisations writeln("Begin running model") MaxFlow := sum(p in PATHS) flow(p) forall(a in ARCS) sum(p in PATHS, b in 1..NARCS | ROUTE(p,b) = a) flow(p) <= CAP(a) forall(c in CALLS) sum(p in PATHS | CINDEX(p) = c) flow(p) <= DEM(c) maximise(MaxFlow) writeln("End running model") writeln(getobjval) forall(p in PATHS) writeln(p," ",getsol(flow(p))) end-model