$ontext Filename: lmp3.gms Author: Nick Sahinidis, August 2002 Purpose: Generate and solve random linear multiplicative models of "Type 3." Problem instances are generated as proposed by: H. P. Benson and G. M. Boger, "Multiplicative programming problems: Analysis and efficient point search heuristic", Journal of Optimization Theory and Applications, 94(487-510), 1997. $offtext options optcr=0, optca=1.e-6, limrow=0, limcol=0, solprint=off, reslim = 10000; sets m constraints /1*220/ n variables /1*200/ p products /1*4/ c cases /1*9/ i instances /1*5/ ; *for each case to be solved, we have a different (m,n,p) triplet table cases(c,*) 1 2 3 1 20 30 2 2 120 100 2 3 220 200 2 4 20 30 3 5 120 120 3 6 200 180 3 7 20 30 4 8 100 100 4 9 200 200 4 ; parameters cc(p,n) cost coefficients A(m,n) constraint coefficients b(m) left-hand-side rep(c,*) summary report ; parameters mactual, nactual, pactual, ResMin, Resmax, NodMin, Nodmax; variables y(p), x(n), obj ; x.lo(n) = 1; equations objective, constraints(m), products(p); objective .. obj =E= prod(p $ (ord(p) le pactual), y(p)); products(p) $ (ord(p) le pactual) .. y(p) =E= sum(n $ (ord(n) le nactual), cc(p,n)*x(n)); constraints(m) $ (ord(m) le mactual) .. b(m) =L= sum(n $ (ord(n) le nactual), A(m,n)*x(n)) ; model lmp3 /all/; lmp3.workspace = 32; rep(c,'AvgResUsd') = 0; rep(c,'AvgNodUsd')= 0; loop (c, mactual = cases(c,'1'); nactual = cases(c,'2'); pactual = cases(c,'3'); ResMin = inf; Resmax = 0; NodMin = inf; Nodmax = 0; loop(i, cc(p,n) = round(uniform(1,10)) $(ord(p) le pactual and ord(n) le nactual); A(m,n) = round(uniform(1,10)) $(ord(m) le mactual and ord(n) le nactual); b(m) = sum(n $ (ord(n) le nactual), A(m,n)**2) $ (ord(m) le mactual); x.up(n) = smax(m, b(m)); * make sure all problems have the same zero starting point x.l(n)=0; y.l(p)=0; solve lmp3 minimizing obj using nlp; rep(c,'AvgResUsd') = rep(c,'AvgResUsd') + lmp3.resusd; rep(c,'AvgNodUsd') = rep(c,'AvgNodUsd') + lmp3.nodusd; ResMin = min(ResMin, lmp3.resusd); NodMin = min(NodMin, lmp3.nodusd); ResMax = max(ResMax, lmp3.resusd); NodMax = max(NodMax, lmp3.nodusd); ); rep(c,'MinResUsd') = ResMin; rep(c,'MaxResUsd') = ResMax; rep(c,'MinNodUsd')= NodMin; rep(c,'MaxNodUsd')= NodMax; ); rep(c,'AvgResUsd') = rep(c,'AvgResUsd')/card(i); rep(c,'AvgNodUsd')= rep(c,'AvgnodUsd')/card(i); display rep;