Quartz | Level 8

## Looking for ways to improve Optmodel execution times

I'm looking for advice on how to improve the performance of my Proc Optmodel code. The present code takes about 37 minutes to solve. I've attached the relevant portions of the log file below.

The purpose of the code is to optimize the orientation of 8 cameras so as to maximize 3-camera coverage over the largest possible area. Each camera has 8 possible orientations. The spatial coverage of each orientation of each camera is represented by a binary coverage matrix on a 3-D Cartesian grid.

Currently, there are 12.5 million observations in coverage matrix and perhaps that's contributing to the slow execution times. I could reduce this number significantly by reducing the spatial resolution of the Cartesian Grid but I am reluctant to take this step at this time.

The orientation of one of the cameras is fixed and not subject to optimization but, not knowing how else to deal with this camera, I just assigned the identical binary coverage matrix to each orientation so, for this camera, all orientations have the same identical coverage. Perhaps there's a more efficient way to handle this circumstance.

As always, any suggestions or advice is greatly appreciated.

Regards,

Gene

``````72         Proc Optmodel;
73         options fullstimer;
74         /* Read CoverageMatrix data into index sets*/
75         set <str> stations;
76         read data work.station_id into stations=[station];
NOTE: There were 8 observations read from the data set WORK.STATION_ID.
77
78         set Station_Pairs={<'US000S','US001R'>,<'US000V','US001Q'>};
79
80         set <str> ORIENTATION_STRING=/'45/35' '90/35' '135/35' '180/35' '225/35' '270/35' '315/35' '360/35' /;
81         set ORIENTATIONS = setof {s in orientation_string}
82         <input(scan(s,1,'/'),best.),input(scan(s,2,'/'),best.)>;
83         put orientations=;
ORIENTATIONS={<45,35>,<90,35>,<135,35>,<180,35>,<225,35>,<270,35>,<315,35>,<360,35>}
84
85
86
87         set <str> Targets;
88         read data work.targets into TARGETS=[target];
NOTE: There were 195228 observations read from the data set WORK.TARGETS.
89         num Matrix {stations, ORIENTATION_string, TARGETS};
90         read data work.RoO_Matrix into [station orientation_string target]
91         Matrix=k;
NOTE: There were 12494592 observations read from the data set WORK.ROO_MATRIX.
92
93         /* Set Constants*/
94         /* optimal number of cameras covering each target*/
95         %Let k=3;
96         num k=&k;
SYMBOLGEN:  Macro variable K resolves to 3
97
98         /*Declare Variables*/
99         var CHI {stations, ORIENTATIONS} binary;
100        var IsTriplyCovered {TARGETS} binary;
101        impvar XIT{target in TARGETS}=sum{station in stations, <a,e> in
102        orientations} matrix[station, a||'/'||e, target] *Chi[station,a,e];
103
104        /* Declare Model*/
105        max NumTriplyCovered=sum{t in TARGETS} IsTriplyCovered[t];
106
107        /*Subject to Following Constraints*/
108        con CHI_constraint {station in stations}:
109        sum{<a,e> in ORIENTATIONS}CHI[station,a,e] <=1;
110
111        con TriplyCoveredCon {t in TARGETS}: XIT[t] >=k * IsTriplyCovered[t];
112
113        set AZIMUTHS = setof {<a,e> in ORIENTATIONS} a;
114           put AZIMUTHS=;
AZIMUTHS={45,90,135,180,225,270,315,360}
115           set AZIMUTH_PAIRS = {a1 in AZIMUTHS, a2 in AZIMUTHS: mod(a1-a2+360,360) <= 45};
116           put AZIMUTH_PAIRS=;
AZIMUTH_PAIRS={<45,45>,<45,360>,<90,45>,<90,90>,<135,90>,<135,135>,<180,135>,<180,180>,<225,180>,<225,225>,<270,225>,<270,270>,<315,
270>,<315,315>,<360,315>,<360,360>}
117
118          con NotAdjacentAzimuths {<s1,s2> in STATION_PAIRS, <a1,a2> in AZIMUTH_PAIRS}:
119              sum {<a,e> in ORIENTATIONS: a in {a1,a2}} (CHI[s1,a,e] + CHI[s2,a,e]) <= 1;
120        /*    expand; */
121
122        /* Call Solver and Save Results:*/
123        solve with milp/ heuristics=2 presolver=3 relobjgap=0.0;
NOTE: Problem generation will use 2 threads.
NOTE: The problem has 195292 variables (0 free, 0 fixed).
NOTE: The problem uses 195228 implicit variables.
NOTE: The problem has 195292 binary and 0 integer variables.
NOTE: The problem has 195268 linear constraints (40 LE, 0 EQ, 195228 GE, 0 range).
NOTE: The problem has 1142932 linear constraint coefficients.
NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).
NOTE: The MILP presolver value AGGRESSIVE is applied.
NOTE: The MILP presolver removed 192680 variables and 192689 constraints.
NOTE: The MILP presolver removed 1107728 constraint coefficients.
NOTE: The MILP presolver modified 801 constraint coefficients.
NOTE: The presolved problem has 2612 variables, 2579 constraints, and 35204 constraint coefficients.
NOTE: The MILP solver is called.
NOTE: The parallel Branch and Cut algorithm is used.
NOTE: The Branch and Cut algorithm is using up to 2 threads.
Node   Active   Sols    BestInteger      BestBound      Gap    Time
0        1      3  23990.0000000  61138.0000000   60.76%       9
0        1      3  23990.0000000  39312.0000000   38.98%       9
0        1      3  23990.0000000  38127.7801515   37.08%      11
0        1      3  23990.0000000  37130.9544114   35.39%      11
0        1      3  23990.0000000  36692.3216045   34.62%      12
0        1      3  23990.0000000  36504.1395405   34.28%      12
0        1      3  23990.0000000  36420.4284890   34.13%      12
0        1      3  23990.0000000  36356.7490045   34.02%      13
0        1      3  23990.0000000  36274.3886694   33.87%      13
0        1      3  23990.0000000  36204.5574512   33.74%      13
0        1      3  23990.0000000  36137.2290216   33.61%      14
0        1      3  23990.0000000  36123.2972914   33.59%      14
0        1      3  23990.0000000  36119.0474640   33.58%      14
0        1      3  23990.0000000  36106.1955179   33.56%      15
0        1      3  23990.0000000  36097.8491496   33.54%      15
0        1      3  23990.0000000  36092.0621002   33.53%      15
0        1      3  23990.0000000  36084.1711840   33.52%      16
0        1      3  23990.0000000  36080.1799044   33.51%      16
NOTE: The MILP solver added 785 cuts with 4461 cut coefficients at the root.
1        2      3  23990.0000000  36080.1799044   33.51%      16
92       84      3  23990.0000000  35678.8140111   32.76%      20
202      189      3  23990.0000000  35438.1099578   32.30%      25
307      287      4  24330.0000000  35317.9985736   31.11%      27
347      325      5  24436.0000000  35299.0728640   30.77%      28
376      353      5  24436.0000000  35270.9243489   30.72%      30
498      465      5  24436.0000000  35179.5881591   30.54%      35
622      582      5  24436.0000000  35156.6853080   30.49%      40
747        1      5  24436.0000000  35019.6880171   30.22%      47
819       69      6  24522.0000000  35019.6880171   29.98%      50
820       70      6  24522.0000000  35019.6880171   29.98%      50
925      170      9  27481.0000000  35019.6880171   21.53%      53
935      175      9  27481.0000000  35019.6880171   21.53%      55
1035      272      9  27481.0000000  35019.6880171   21.53%      60
NOTE: The Decomposition algorithm is used.
NOTE: The Decomposition algorithm time is 0.62 seconds.
1164      396      9  27481.0000000  34670.4366167   20.74%      65
1225      450      9  27481.0000000  34530.2041077   20.41%      70
1239      462     10  27492.0000000  34530.2041077   20.38%      71
1273      491     11  27500.0000000  34523.2661646   20.34%      73
1313      528     11  27500.0000000  34462.2905258   20.20%      75
1413      617     11  27500.0000000  34426.7564570   20.12%      80
1477      672     11  27500.0000000  34278.6085959   19.78%      85
1567      750     11  27500.0000000  34212.6188681   19.62%      90
1617      792     11  27500.0000000  34175.6139980   19.53%      95
1689      858     11  27500.0000000  34154.3283232   19.48%     100
1721      887     12  27503.0000000  34126.7849157   19.41%     100
1724      888     13  27505.0000000  34087.9161005   19.31%     100
1805      951     13  27505.0000000  33933.0291500   18.94%     105
1865      998     13  27505.0000000  33881.4232385   18.82%     110
1925     1041     13  27505.0000000  33781.8296720   18.58%     115
1927     1041     14  27512.0000000  33778.3581663   18.55%     115
1971     1074     14  27512.0000000  33718.8824519   18.41%     120
2010     1102     14  27512.0000000  33653.9319331   18.25%     125
2021     1107     16  27545.0000000  33640.0080999   18.12%     126
2045     1123     16  27545.0000000  33606.3341194   18.04%     130
2065     1139     16  27545.0000000  33598.7736264   18.02%     135
2115     1179     16  27545.0000000  33566.4744542   17.94%     140
2147     1201     16  27545.0000000  33539.2577104   17.87%     145
2185     1234     16  27545.0000000  33527.8809774   17.84%     150
2213     1256     16  27545.0000000  33526.0634607   17.84%     155
2249     1282     16  27545.0000000  33457.3006099   17.67%     160
2285     1313     16  27545.0000000  33439.9249790   17.63%     165
2313     1332     16  27545.0000000  33401.0503735   17.53%     170
2319     1336     17  27600.0000000  33401.0503735   17.37%     171
2339     1351     17  27600.0000000  33380.2229475   17.32%     175
2367     1374     17  27600.0000000  33363.9691902   17.28%     180
2407     1405     17  27600.0000000  33324.8202323   17.18%     185
2429     1418     19  28145.0000000  33318.7316262   15.53%     185
2485     1449     19  28145.0000000  33243.4193147   15.34%     190
2516     1474     19  28145.0000000  33196.4363181   15.22%     195
2542     1490     19  28145.0000000  33173.9295788   15.16%     200
2572     1512     19  28145.0000000  33133.1622965   15.05%     205
2592     1520     19  28145.0000000  33087.2599557   14.94%     210
2618     1530     19  28145.0000000  33071.5510832   14.90%     215
2644     1545     19  28145.0000000  33060.5562038   14.87%     220
2670     1555     19  28145.0000000  33039.1870347   14.81%     225
2696     1575     19  28145.0000000  33032.2339526   14.80%     230
2722     1590     19  28145.0000000  33009.4990069   14.74%     235
2754     1610     19  28145.0000000  32999.2147639   14.71%     240
2772     1619     19  28145.0000000  32976.4766045   14.65%     245
2800     1639     19  28145.0000000  32959.4912991   14.61%     250
2818     1651     19  28145.0000000  32953.4373825   14.59%     255
2853     1674     19  28145.0000000  32947.3818875   14.58%     260
2875     1688     19  28145.0000000  32923.8618842   14.51%     265
2899     1696     19  28145.0000000  32899.3141391   14.45%     270
2919     1706     19  28145.0000000  32884.9747879   14.41%     275
2955     1731     19  28145.0000000  32862.5233079   14.36%     280
2984     1748     19  28145.0000000  32850.7181194   14.32%     285
3002     1761     19  28145.0000000  32836.8147487   14.29%     290
3020     1773     19  28145.0000000  32830.1314539   14.27%     295
3038     1778     19  28145.0000000  32815.9085915   14.23%     300
3060     1787     19  28145.0000000  32803.9852529   14.20%     305
3082     1799     19  28145.0000000  32785.5530456   14.15%     310
3108     1805     19  28145.0000000  32775.0551394   14.13%     315
3128     1816     19  28145.0000000  32765.6154429   14.10%     321
3140     1824     19  28145.0000000  32761.5960041   14.09%     325
3158     1830     19  28145.0000000  32738.4632111   14.03%     330
3180     1839     19  28145.0000000  32732.8342482   14.02%     335
3204     1851     19  28145.0000000  32705.7970474   13.94%     340
3232     1871     19  28145.0000000  32701.0509802   13.93%     345
3254     1882     19  28145.0000000  32690.0503606   13.90%     351
3267     1890     19  28145.0000000  32681.5042359   13.88%     355
3278     1895     19  28145.0000000  32667.8083419   13.84%     360
3303     1909     19  28145.0000000  32649.3681718   13.80%     365
3328     1923     19  28145.0000000  32614.9356086   13.71%     370
3352     1942     19  28145.0000000  32603.6748745   13.68%     375
3366     1953     19  28145.0000000  32601.6454232   13.67%     380
3386     1965     19  28145.0000000  32588.7128671   13.64%     385
3404     1974     19  28145.0000000  32575.6484314   13.60%     390
3426     1989     19  28145.0000000  32559.0282642   13.56%     395
3456     2005     19  28145.0000000  32536.7570941   13.50%     400
3472     2010     19  28145.0000000  32518.5190450   13.45%     405
3482     2013     19  28145.0000000  32512.0159007   13.43%     410
3500     2015     19  28145.0000000  32496.3336152   13.39%     415
3514     2017     19  28145.0000000  32480.4839933   13.35%     420
3532     2027     19  28145.0000000  32472.6505570   13.33%     425
3556     2044     19  28145.0000000  32465.7637762   13.31%     430
3572     2050     19  28145.0000000  32452.1383332   13.27%     435
3590     2056     19  28145.0000000  32438.8583534   13.24%     440
3612     2064     19  28145.0000000  32423.7320268   13.20%     445
3634     2077     19  28145.0000000  32412.7257155   13.17%     450
3648     2079     19  28145.0000000  32397.2139959   13.13%     455
3666     2090     19  28145.0000000  32394.1087595   13.12%     460
3692     2106     19  28145.0000000  32379.5514841   13.08%     465
3714     2123     19  28145.0000000  32368.3843400   13.05%     470
3732     2134     19  28145.0000000  32360.8961825   13.03%     475
3748     2137     19  28145.0000000  32340.7239412   12.97%     480
3764     2140     19  28145.0000000  32322.3870217   12.92%     485
3780     2147     19  28145.0000000  32306.3843408   12.88%     490
3800     2158     19  28145.0000000  32297.2113310   12.86%     495
3814     2162     19  28145.0000000  32281.3650356   12.81%     500
3838     2176     19  28145.0000000  32268.0789013   12.78%     505
3858     2181     19  28145.0000000  32259.8463500   12.76%     510
3880     2189     19  28145.0000000  32246.1066227   12.72%     515
3933     2219     19  28145.0000000  32227.8712174   12.67%     520
3957     2232     19  28145.0000000  32203.3375031   12.60%     525
3979     2238     19  28145.0000000  32181.7559460   12.54%     530
3998     2247     19  28145.0000000  32179.5539104   12.54%     535
4023     2258     19  28145.0000000  32149.9523511   12.46%     540
4042     2268     19  28145.0000000  32130.5662909   12.40%     545
4060     2269     19  28145.0000000  32124.7942211   12.39%     550
4072     2274     19  28145.0000000  32120.7030966   12.38%     555
4105     2293     19  28145.0000000  32112.2829868   12.35%     560
4125     2308     19  28145.0000000  32110.6155792   12.35%     565
4147     2311     19  28145.0000000  32088.1118559   12.29%     570
4177     2331     19  28145.0000000  32076.9986355   12.26%     575
4191     2334     19  28145.0000000  32063.4811472   12.22%     580
4211     2345     19  28145.0000000  32058.8866707   12.21%     585
4231     2348     19  28145.0000000  32051.9882892   12.19%     590
4251     2358     19  28145.0000000  32039.9803663   12.16%     595
4269     2369     19  28145.0000000  32034.9120998   12.14%     600
4295     2378     19  28145.0000000  32025.5849887   12.12%     605
4313     2383     19  28145.0000000  32007.8426337   12.07%     610
4329     2386     19  28145.0000000  32002.2382890   12.05%     615
4357     2404     19  28145.0000000  31998.7399175   12.04%     620
4381     2419     19  28145.0000000  31993.9017360   12.03%     625
4401     2428     19  28145.0000000  31982.0422003   12.00%     630
4417     2436     19  28145.0000000  31973.1543287   11.97%     635
4433     2435     19  28145.0000000  31947.9594590   11.90%     640
4459     2447     19  28145.0000000  31941.5292928   11.89%     645
4471     2446     19  28145.0000000  31924.0400141   11.84%     650
4487     2450     19  28145.0000000  31909.7785442   11.80%     655
4501     2452     19  28145.0000000  31901.4570743   11.78%     660
4519     2459     19  28145.0000000  31896.3190557   11.76%     665
4537     2473     19  28145.0000000  31889.2412703   11.74%     670
4557     2478     19  28145.0000000  31875.3841858   11.70%     675
4587     2491     19  28145.0000000  31867.5328649   11.68%     680
4609     2503     19  28145.0000000  31858.5873042   11.66%     686
4625     2507     19  28145.0000000  31846.5353177   11.62%     690
4641     2517     19  28145.0000000  31840.2175761   11.61%     695
4655     2523     19  28145.0000000  31833.0667937   11.59%     700
4671     2527     19  28145.0000000  31813.5334048   11.53%     705
4687     2529     19  28145.0000000  31800.9663253   11.50%     710
4707     2528     19  28145.0000000  31785.4222655   11.45%     715
4729     2534     19  28145.0000000  31777.2361368   11.43%     721
4741     2541     19  28145.0000000  31774.0803443   11.42%     725
4755     2544     19  28145.0000000  31764.7166133   11.40%     730
4818     2573     19  28145.0000000  31756.7200489   11.37%     735
4831     2579     19  28145.0000000  31744.7172772   11.34%     740
4845     2585     19  28145.0000000  31740.4014254   11.33%     745
4869     2594     19  28145.0000000  31710.5611454   11.24%     750
4887     2599     19  28145.0000000  31698.0618319   11.21%     755
4903     2600     19  28145.0000000  31687.0204269   11.18%     760
4925     2604     19  28145.0000000  31669.7820869   11.13%     765
4939     2606     19  28145.0000000  31648.9375050   11.07%     770
4963     2610     19  28145.0000000  31631.7046279   11.02%     775
4981     2613     19  28145.0000000  31626.4375050   11.01%     780
4995     2614     19  28145.0000000  31617.4274150   10.98%     785
5011     2610     19  28145.0000000  31595.3750000   10.92%     790
5027     2607     19  28145.0000000  31583.1386032   10.89%     795
5049     2615     19  28145.0000000  31572.9536734   10.86%     800
5071     2621     19  28145.0000000  31563.1484250   10.83%     805
5091     2628     19  28145.0000000  31550.6579946   10.79%     810
5119     2637     19  28145.0000000  31528.4255216   10.73%     815
5141     2644     19  28145.0000000  31524.8163774   10.72%     820
5157     2648     19  28145.0000000  31515.8808935   10.70%     825
5177     2653     19  28145.0000000  31510.0701357   10.68%     830
5205     2656     19  28145.0000000  31495.2335537   10.64%     835
5229     2666     19  28145.0000000  31482.1550632   10.60%     840
5259     2675     19  28145.0000000  31474.1611535   10.58%     845
5285     2674     19  28145.0000000  31459.9711935   10.54%     850
5307     2678     19  28145.0000000  31450.6973137   10.51%     855
5331     2684     19  28145.0000000  31439.3899540   10.48%     860
5355     2692     19  28145.0000000  31427.8724723   10.45%     866
5369     2692     19  28145.0000000  31420.2296025   10.42%     870
5397     2712     19  28145.0000000  31417.5723207   10.42%     875
5419     2717     19  28145.0000000  31409.3234172   10.39%     880
5439     2721     19  28145.0000000  31401.0348559   10.37%     885
5469     2713     19  28145.0000000  31374.1174316   10.29%     890
5493     2720     19  28145.0000000  31369.8282021   10.28%     895
5521     2729     19  28145.0000000  31366.3042864   10.27%     900
5543     2734     19  28145.0000000  31360.8535707   10.25%     905
5567     2733     19  28145.0000000  31345.2435070   10.21%     910
5585     2738     19  28145.0000000  31339.6080647   10.19%     915
5601     2738     19  28145.0000000  31333.8557987   10.18%     920
5615     2734     19  28145.0000000  31316.3540995   10.13%     925
5643     2745     19  28145.0000000  31296.4060410   10.07%     930
5663     2748     19  28145.0000000  31282.7523445   10.03%     935
5683     2748     19  28145.0000000  31271.1466449   10.00%     940
5727     2760     19  28145.0000000  31261.7283824    9.97%     945
5743     2765     19  28145.0000000  31254.2031728    9.95%     950
5769     2779     19  28145.0000000  31250.9519986    9.94%     955
5793     2780     19  28145.0000000  31232.5456679    9.89%     960
5815     2786     19  28145.0000000  31218.5723207    9.85%     965
5835     2784     19  28145.0000000  31212.7482320    9.83%     970
5867     2788     19  28145.0000000  31206.3806783    9.81%     975
5887     2791     19  28145.0000000  31194.4738148    9.78%     980
5905     2791     19  28145.0000000  31183.9955597    9.75%     985
5929     2792     19  28145.0000000  31173.7205192    9.72%     990
NOTE: The Decomposition algorithm is used.
NOTE: The Decomposition algorithm time is 6.09 seconds.
5953     2796     19  28145.0000000  31170.3316371    9.71%     999
5954     2795     19  28145.0000000  31169.7528128    9.70%    1000
5973     2801     19  28145.0000000  31165.5756606    9.69%    1005
5993     2801     19  28145.0000000  31149.6939055    9.65%    1010
6009     2798     19  28145.0000000  31125.0996331    9.57%    1015
6031     2807     19  28145.0000000  31120.1368457    9.56%    1020
6053     2803     19  28145.0000000  31097.6382701    9.49%    1025
6075     2803     19  28145.0000000  31089.3954510    9.47%    1030
6103     2813     19  28145.0000000  31073.3288318    9.42%    1035
6129     2813     19  28145.0000000  31062.6350535    9.39%    1040
6153     2813     19  28145.0000000  31051.4001714    9.36%    1045
6187     2819     19  28145.0000000  31030.5413157    9.30%    1050
6209     2820     19  28145.0000000  31022.0072006    9.27%    1055
6241     2821     19  28145.0000000  31013.1995014    9.25%    1060
6257     2816     19  28145.0000000  31004.0686966    9.22%    1065
6291     2813     19  28145.0000000  30992.0996625    9.19%    1070
6310     2812     19  28145.0000000  30982.7909518    9.16%    1075
6341     2817     19  28145.0000000  30971.2494443    9.13%    1080
6365     2815     19  28145.0000000  30963.3444906    9.10%    1085
6383     2814     19  28145.0000000  30948.3672403    9.06%    1090
6407     2812     19  28145.0000000  30933.5900291    9.01%    1095
6435     2811     19  28145.0000000  30927.3063259    9.00%    1100
6457     2809     19  28145.0000000  30922.9934999    8.98%    1105
6488     2818     19  28145.0000000  30910.3972088    8.95%    1110
6510     2821     19  28145.0000000  30902.7438110    8.92%    1115
6527     2828     19  28145.0000000  30895.1233758    8.90%    1120
6547     2820     19  28145.0000000  30877.3744724    8.85%    1125
6573     2815     19  28145.0000000  30866.2296492    8.82%    1130
6593     2820     19  28145.0000000  30862.9113600    8.81%    1135
6621     2821     19  28145.0000000  30851.2137073    8.77%    1140
6637     2827     19  28145.0000000  30845.4350289    8.75%    1145
6659     2826     19  28145.0000000  30837.1310751    8.73%    1150
6673     2820     19  28145.0000000  30828.8800131    8.71%    1155
6691     2821     19  28145.0000000  30823.5307127    8.69%    1160
6711     2821     19  28145.0000000  30816.0734714    8.67%    1165
6733     2823     19  28145.0000000  30810.9673803    8.65%    1170
6759     2824     19  28145.0000000  30795.1803082    8.61%    1175
6783     2827     19  28145.0000000  30789.4754835    8.59%    1180
6815     2831     19  28145.0000000  30782.2124135    8.57%    1185
6837     2831     19  28145.0000000  30769.2381512    8.53%    1190
6861     2825     19  28145.0000000  30757.8096518    8.49%    1195
6889     2833     19  28145.0000000  30751.0472308    8.47%    1200
6919     2836     19  28145.0000000  30743.0137074    8.45%    1205
6939     2840     19  28145.0000000  30736.4381031    8.43%    1210
6965     2840     19  28145.0000000  30724.4140683    8.40%    1215
6983     2841     19  28145.0000000  30713.8457391    8.36%    1220
6997     2841     19  28145.0000000  30706.5867576    8.34%    1225
7023     2845     19  28145.0000000  30700.9131748    8.33%    1230
7049     2848     19  28145.0000000  30690.0879063    8.29%    1235
7075     2845     19  28145.0000000  30678.6715129    8.26%    1240
7101     2848     19  28145.0000000  30671.4591833    8.24%    1245
7131     2852     19  28145.0000000  30658.0418917    8.20%    1250
7153     2851     19  28145.0000000  30644.3265284    8.16%    1255
7179     2846     19  28145.0000000  30641.6251800    8.15%    1260
7197     2844     19  28145.0000000  30633.7700090    8.12%    1265
7221     2852     19  28145.0000000  30629.3380952    8.11%    1270
7265     2876     19  28145.0000000  30623.9881300    8.09%    1275
7285     2875     19  28145.0000000  30619.6653154    8.08%    1280
7307     2880     19  28145.0000000  30616.2939849    8.07%    1285
7325     2887     19  28145.0000000  30613.9028541    8.06%    1290
7391     2925     19  28145.0000000  30610.4819598    8.05%    1295
7411     2921     19  28145.0000000  30592.9903558    8.00%    1300
7429     2926     19  28145.0000000  30586.9428382    7.98%    1305
7449     2933     19  28145.0000000  30574.0227956    7.94%    1310
7471     2927     19  28145.0000000  30544.3898634    7.86%    1315
7494     2927     19  28145.0000000  30529.9787359    7.81%    1320
7518     2933     19  28145.0000000  30515.9473231    7.77%    1325
7548     2938     19  28145.0000000  30498.5796667    7.72%    1330
7583     2941     19  28145.0000000  30490.4009674    7.69%    1335
7609     2951     19  28145.0000000  30490.4009674    7.69%    1340
7649     2968     19  28145.0000000  30474.0243917    7.64%    1345
7667     2975     19  28145.0000000  30471.5436773    7.64%    1350
7689     2971     19  28145.0000000  30456.5423792    7.59%    1355
7717     2979     19  28145.0000000  30444.7566734    7.55%    1360
7747     2982     19  28145.0000000  30438.1062217    7.53%    1365
7763     2988     19  28145.0000000  30435.0773975    7.52%    1370
7787     2997     19  28145.0000000  30427.7082011    7.50%    1375
7817     3010     19  28145.0000000  30417.7673294    7.47%    1380
7843     3005     19  28145.0000000  30398.4820087    7.41%    1385
7867     3008     19  28145.0000000  30393.6528609    7.40%    1390
7885     3010     19  28145.0000000  30387.3341274    7.38%    1395
7909     3010     19  28145.0000000  30373.6975789    7.34%    1400
7929     3006     19  28145.0000000  30360.6256586    7.30%    1405
7954     2962     21  28377.0000000  30354.0070556    6.51%    1409
7979     2984     21  28377.0000000  30354.0048894    6.51%    1410
8005     2993     21  28377.0000000  30354.0048894    6.51%    1415
8031     2994     21  28377.0000000  30344.6311479    6.48%    1420
8069     3006     21  28377.0000000  30334.5430882    6.45%    1425
8089     3008     21  28377.0000000  30327.1260732    6.43%    1430
8115     3014     21  28377.0000000  30321.7074915    6.41%    1435
8135     3018     21  28377.0000000  30315.3680228    6.39%    1440
8161     3026     21  28377.0000000  30306.0815194    6.37%    1445
8185     3030     21  28377.0000000  30298.4067304    6.34%    1450
8215     3031     21  28377.0000000  30295.2604353    6.33%    1455
8241     3039     21  28377.0000000  30290.3159929    6.32%    1460
8269     3035     21  28377.0000000  30281.5839945    6.29%    1465
8301     3047     21  28377.0000000  30276.1252141    6.27%    1470
8335     3050     21  28377.0000000  30267.5917394    6.25%    1475
8353     3046     21  28377.0000000  30262.3587807    6.23%    1480
8375     3053     21  28377.0000000  30252.3875103    6.20%    1485
8411     3060     21  28377.0000000  30248.2755068    6.19%    1490
8465     3087     21  28377.0000000  30241.8392217    6.17%    1495
8507     3063     22  28377.0000000  30237.0630746    6.15%    1499
8533     3072     22  28377.0000000  30237.0630746    6.15%    1500
8555     3070     22  28377.0000000  30228.0285478    6.12%    1505
8573     3068     22  28377.0000000  30222.8339858    6.11%    1511
8593     3066     22  28377.0000000  30219.2588475    6.10%    1515
8619     3067     22  28377.0000000  30212.9012674    6.08%    1520
8643     3072     22  28377.0000000  30206.1541457    6.06%    1525
8661     3074     22  28377.0000000  30198.9176233    6.03%    1530
8701     3084     22  28377.0000000  30192.2384526    6.01%    1535
8727     3084     22  28377.0000000  30182.3342528    5.98%    1540
8755     3086     22  28377.0000000  30178.5561763    5.97%    1545
8787     3092     22  28377.0000000  30165.8875703    5.93%    1550
8809     3098     22  28377.0000000  30160.9893292    5.91%    1555
8825     3094     22  28377.0000000  30157.0704569    5.90%    1560
8861     3103     22  28377.0000000  30150.9040886    5.88%    1565
8927     3105     22  28377.0000000  30146.6909783    5.87%    1570
8948     3100     22  28377.0000000  30134.1816519    5.83%    1575
8972     3102     22  28377.0000000  30118.2164179    5.78%    1580
9000     3101     22  28377.0000000  30106.8965556    5.75%    1585
9028     3097     22  28377.0000000  30089.0535130    5.69%    1590
9050     3098     22  28377.0000000  30082.6140395    5.67%    1595
9076     3100     22  28377.0000000  30070.8339712    5.63%    1600
9110     3118     22  28377.0000000  30068.4625286    5.63%    1605
9136     3128     22  28377.0000000  30064.0152266    5.61%    1610
9166     3130     22  28377.0000000  30057.3074080    5.59%    1615
9190     3125     22  28377.0000000  30046.7148288    5.56%    1620
9220     3127     22  28377.0000000  30038.5209226    5.53%    1625
9244     3124     22  28377.0000000  30033.4427230    5.52%    1630
9264     3123     22  28377.0000000  30026.0430501    5.49%    1635
9286     3122     22  28377.0000000  30015.2208645    5.46%    1640
9310     3118     22  28377.0000000  30008.9018831    5.44%    1645
9356     3113     22  28377.0000000  30000.1439529    5.41%    1650
9386     3115     22  28377.0000000  29997.6628639    5.40%    1655
9412     3107     22  28377.0000000  29987.0964768    5.37%    1660
9466     3111     22  28377.0000000  29979.5803133    5.35%    1665
9502     3123     22  28377.0000000  29972.5427242    5.32%    1670
9544     3133     22  28377.0000000  29966.6017454    5.30%    1675
9572     3130     22  28377.0000000  29961.0120966    5.29%    1680
9626     3148     22  28377.0000000  29955.5175493    5.27%    1685
9656     3147     22  28377.0000000  29947.9108073    5.25%    1690
9684     3152     22  28377.0000000  29941.9013568    5.23%    1695
9720     3153     22  28377.0000000  29929.9327485    5.19%    1700
9754     3155     22  28377.0000000  29924.9978685    5.17%    1705
9780     3156     22  28377.0000000  29921.6843875    5.16%    1710
9808     3148     22  28377.0000000  29916.0586815    5.14%    1715
9830     3143     22  28377.0000000  29911.3219311    5.13%    1720
9860     3156     22  28377.0000000  29903.9830746    5.11%    1725
9884     3161     22  28377.0000000  29895.8908007    5.08%    1730
9944     3165     22  28377.0000000  29889.9725082    5.06%    1735
9972     3166     22  28377.0000000  29887.6555877    5.05%    1740
10012     3168     22  28377.0000000  29876.4164270    5.02%    1745
10036     3169     22  28377.0000000  29872.4218797    5.01%    1750
10102     3190     22  28377.0000000  29864.2968824    4.98%    1755
10160     3193     22  28377.0000000  29855.3481535    4.95%    1760
10202     3206     22  28377.0000000  29847.4413500    4.93%    1765
10270     3223     22  28377.0000000  29841.8555273    4.91%    1770
10322     3228     22  28377.0000000  29835.2716594    4.89%    1775
10358     3227     22  28377.0000000  29826.6479638    4.86%    1780
10408     3237     22  28377.0000000  29824.2035052    4.85%    1785
10534     3292     22  28377.0000000  29821.2997955    4.84%    1790
10594     3307     22  28377.0000000  29816.7022484    4.83%    1795
10632     3316     22  28377.0000000  29812.2366374    4.81%    1800
10660     3314     22  28377.0000000  29808.3335252    4.80%    1805
10678     3083     23  28728.0000000  29804.1681777    3.61%    1806
10728     3088     23  28728.0000000  29801.8040584    3.60%    1810
10760     3093     23  28728.0000000  29791.3621770    3.57%    1815
10810     3100     23  28728.0000000  29783.8158023    3.54%    1820
11060     2815     24  28728.0000000  29782.5918807    3.54%    1821
11253     2836     24  28728.0000000  29780.2506612    3.53%    1825
11322     2860     24  28728.0000000  29770.0602937    3.50%    1830
11356     2840     24  28728.0000000  29755.9749698    3.45%    1835
11378     2823     24  28728.0000000  29745.7540372    3.42%    1840
11424     2814     24  28728.0000000  29734.4411717    3.38%    1845
11468     2793     24  28728.0000000  29720.1231793    3.34%    1850
11526     2772     24  28728.0000000  29708.6215872    3.30%    1855
11562     2765     24  28728.0000000  29698.5250530    3.27%    1860
11618     2762     24  28728.0000000  29695.8530980    3.26%    1865
11680     2749     24  28728.0000000  29683.3684252    3.22%    1870
11740     2722     24  28728.0000000  29667.5425233    3.17%    1875
11780     2710     24  28728.0000000  29660.1468980    3.14%    1880
11836     2687     24  28728.0000000  29650.1926995    3.11%    1885
11884     2674     24  28728.0000000  29641.0000000    3.08%    1890
11932     2676     24  28728.0000000  29638.8348444    3.07%    1895
11986     2679     24  28728.0000000  29628.6606867    3.04%    1900
12050     2672     24  28728.0000000  29621.0000000    3.01%    1905
12088     2653     24  28728.0000000  29614.8340334    2.99%    1910
12136     2645     24  28728.0000000  29609.6975673    2.98%    1915
12200     2629     24  28728.0000000  29603.6667680    2.96%    1920
12258     2612     24  28728.0000000  29588.2417380    2.91%    1925
12298     2592     24  28728.0000000  29579.6011871    2.88%    1930
12350     2576     24  28728.0000000  29573.1199063    2.86%    1935
12408     2562     24  28728.0000000  29564.9908825    2.83%    1940
12500     2539     24  28728.0000000  29551.3895132    2.79%    1945
12544     2520     24  28728.0000000  29544.6055162    2.76%    1950
12600     2520     24  28728.0000000  29535.9013071    2.74%    1955
12664     2497     24  28728.0000000  29525.5990874    2.70%    1960
12724     2477     24  28728.0000000  29515.8503938    2.67%    1965
12774     2457     24  28728.0000000  29508.5738790    2.65%    1970
12824     2434     24  28728.0000000  29498.9581843    2.61%    1975
12997     2389     24  28728.0000000  29491.3229849    2.59%    1980
13064     2378     24  28728.0000000  29476.5402670    2.54%    1985
13135     2340     24  28728.0000000  29453.9988265    2.46%    1990
13177     2334     24  28728.0000000  29444.9581843    2.43%    1995
13237     2319     24  28728.0000000  29433.0000000    2.40%    2000
13285     2292     24  28728.0000000  29425.8976274    2.37%    2005
13341     2265     24  28728.0000000  29418.6191033    2.35%    2010
13391     2239     24  28728.0000000  29411.1673530    2.32%    2015
13507     2202     24  28728.0000000  29396.0754166    2.27%    2020
13567     2169     24  28728.0000000  29387.4877863    2.24%    2025
13631     2140     24  28728.0000000  29372.7131396    2.19%    2030
13709     2098     24  28728.0000000  29360.6669667    2.15%    2035
13807     2090     24  28728.0000000  29354.8755350    2.14%    2040
13869     2054     24  28728.0000000  29341.9604089    2.09%    2045
13937     2018     24  28728.0000000  29332.7765611    2.06%    2050
14013     1982     24  28728.0000000  29326.9321555    2.04%    2055
14103     1952     24  28728.0000000  29313.9473661    2.00%    2060
14165     1918     24  28728.0000000  29304.1666667    1.97%    2065
14245     1890     24  28728.0000000  29297.8756550    1.95%    2070
14305     1856     24  28728.0000000  29291.6165807    1.92%    2075
14377     1813     24  28728.0000000  29281.8447016    1.89%    2080
14441     1788     24  28728.0000000  29274.0210311    1.87%    2085
14521     1753     24  28728.0000000  29261.5465573    1.82%    2090
14655     1748     24  28728.0000000  29252.4308612    1.79%    2095
14737     1728     24  28728.0000000  29244.2792751    1.77%    2100
14807     1695     24  28728.0000000  29227.0326098    1.71%    2105
14889     1661     24  28728.0000000  29217.6737864    1.68%    2110
14967     1636     24  28728.0000000  29205.9933558    1.64%    2115
15041     1596     24  28728.0000000  29198.8633827    1.61%    2120
15174     1539     24  28728.0000000  29178.4475547    1.54%    2125
15256     1503     24  28728.0000000  29154.9924003    1.46%    2130
15338     1459     24  28728.0000000  29138.1806198    1.41%    2135
15422     1415     24  28728.0000000  29123.1117547    1.36%    2140
15514     1368     24  28728.0000000  29110.3114186    1.31%    2145
15606     1310     24  28728.0000000  29095.1257734    1.26%    2150
15720     1241     24  28728.0000000  29080.2155601    1.21%    2155
15854     1164     24  28728.0000000  29060.5870472    1.14%    2160
15972     1101     24  28728.0000000  29046.0726458    1.10%    2165
16090     1029     24  28728.0000000  29028.2805098    1.03%    2170
16256      981     24  28728.0000000  29004.6670039    0.95%    2175
16456      872     24  28728.0000000  28977.3254756    0.86%    2180
16622      757     24  28728.0000000  28949.2922417    0.76%    2185
17151      393     24  28728.0000000  28883.4169817    0.54%    2190
17558      107     24  28728.0000000  28763.4150965    0.12%    2195
17725        0     24  28728.0000000  28728.0000000    0.00%    2196
NOTE: Optimal.
NOTE: Objective = 28728.
124        create data work.OptimalSolution_&RoO from
SYMBOLGEN:  Macro variable ROO resolves to 2000
125        [station a e]={c in stations, <a,e> in orientations: CHI[c,a,e]>0.5} CHI;
NOTE: The data set WORK.OPTIMALSOLUTION_2000 has 8 observations and 4 variables.
126        quit;
NOTE: PROCEDURE OPTMODEL used (Total process time):
real time           37:19.12
user cpu time       1:12:08.86
system cpu time     7.98 seconds
memory              2530752.29k
OS Memory           2587444.00k
Timestamp           12/13/2021 03:58:51 PM
Step Count                        150  Switch Count  5417
Page Faults                       9
Page Reclaims                     927759
Page Swaps                        0
Voluntary Context Switches        2067173
Involuntary Context Switches      17601
Block Input Operations            20304
Block Output Operations           912

``````
10 REPLIES 10
SAS Super FREQ

## Re: Looking for ways to improve Optmodel execution times

For the station with a fixed orientation, you are introducing symmetry, which is usually bad news for a MILP solver.  I recommend using a FIX statement to fix the CHI[station,a,e] variable to 1 for that specific <station,a,e>.  Please rerun and show the new log.

Quartz | Level 8

## Re: Looking for ways to improve Optmodel execution times

Thanks, Rob, for your prompt response.  I implemented your suggestion (correctly, I hope) but a NOTE (at line131): indicates that "Constraint CHI_constraint[USL000] causes the problem to be infeasible.  The MILP presolver found this problem to be infeasible." The logfile is below.

Thanks for taking a look at this,

Gene

``````72         Proc Optmodel;
73         options fullstimer;
74         /* Read CoverageMatrix data into index sets*/
75         set <str> stations;
76         read data work.station_id into stations=[station];
NOTE: There were 8 observations read from the data set WORK.STATION_ID.
77
78         set Station_Pairs={<'US000S','US001R'>,<'US000V','US001Q'>};
79
80         set <str> ORIENTATION_STRING=/'45/35' '90/35' '135/35' '180/35' '225/35' '270/35' '315/35' '360/35' /;
81         set ORIENTATIONS = setof {s in orientation_string}
82         <input(scan(s,1,'/'),best.),input(scan(s,2,'/'),best.)>;
83         put orientations=;
ORIENTATIONS={<45,35>,<90,35>,<135,35>,<180,35>,<225,35>,<270,35>,<315,35>,<360,35>}
84
85
86
87         set <str> Targets;
88         read data work.targets into TARGETS=[target];
NOTE: There were 195228 observations read from the data set WORK.TARGETS.
89         num Matrix {stations, ORIENTATION_string, TARGETS};
90         read data work.RoO_Matrix into [station orientation_string target]
91         Matrix=k;
NOTE: There were 12494592 observations read from the data set WORK.ROO_MATRIX.
92
93         /* Set Constants*/
94         /* optimal number of cameras covering each target*/
95         %Let k=3;
96         num k=&k;
SYMBOLGEN:  Macro variable K resolves to 3
97
98         /*Declare Variables*/
99         var CHI {stations, ORIENTATIONS} binary;
100
101        var IsTriplyCovered {TARGETS} binary;
102        impvar XIT{target in TARGETS}=sum{station in stations, <a,e> in
103        orientations} matrix[station, a||'/'||e, target] *Chi[station,a,e];
104        fix CHI['USL000',45,35]=1;
105        fix CHI['USL000',90,35]=1;
106        fix CHI['USL000',135,35]=1;
107        fix CHI['USL000',180,35]=1;
108        fix CHI['USL000',225,35]=1;
109        fix CHI['USL000',270,35]=1;
110        fix CHI['USL000',315,35]=1;
111        fix CHI['USL000',360,35]=1;
112        /* Declare Model*/
113        max NumTriplyCovered=sum{t in TARGETS} IsTriplyCovered[t];
114
115        /*Subject to Following Constraints*/
116        con CHI_constraint {station in stations}:
117        sum{<a,e> in ORIENTATIONS}CHI[station,a,e] <=1;
118
119        con TriplyCoveredCon {t in TARGETS}: XIT[t] >=k * IsTriplyCovered[t];
120
121        set AZIMUTHS = setof {<a,e> in ORIENTATIONS} a;
122           put AZIMUTHS=;
AZIMUTHS={45,90,135,180,225,270,315,360}
123           set AZIMUTH_PAIRS = {a1 in AZIMUTHS, a2 in AZIMUTHS: mod(a1-a2+360,360) <= 45};
124           put AZIMUTH_PAIRS=;
AZIMUTH_PAIRS={<45,45>,<45,360>,<90,45>,<90,90>,<135,90>,<135,135>,<180,135>,<180,180>,<225,180>,<225,225>,<270,225>,<270,270>,<315,
270>,<315,315>,<360,315>,<360,360>}
125
126          con NotAdjacentAzimuths {<s1,s2> in STATION_PAIRS, <a1,a2> in AZIMUTH_PAIRS}:
127              sum {<a,e> in ORIENTATIONS: a in {a1,a2}} (CHI[s1,a,e] + CHI[s2,a,e]) <= 1;
128        /*    expand; */
129
130        /* Call Solver and Save Results:*/
131        solve with milp/ heuristics=2 presolver=3 relobjgap=0.0;
NOTE: Problem generation will use 2 threads.
NOTE: The problem has 195292 variables (0 free, 8 fixed).
NOTE: The problem uses 195228 implicit variables.
NOTE: The problem has 195292 binary and 0 integer variables.
NOTE: The problem has 195268 linear constraints (40 LE, 0 EQ, 195228 GE, 0 range).
NOTE: The problem has 1142932 linear constraint coefficients.
NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).
NOTE: The MILP presolver value AGGRESSIVE is applied.
NOTE: Constraint CHI_constraint[USL000] causes the problem to be infeasible.
NOTE: The MILP presolver found this problem to be infeasible.
132        create data work.OptimalSolution_&RoO from
_
22
WARNING: Apparent symbolic reference ROO not resolved.
132        create data work.OptimalSolution_&RoO from
_
200
ERROR 22-322: Syntax error, expecting one of the following: (, FROM.

ERROR 200-322: The symbol is not recognized and will be ignored.

132        create data work.OptimalSolution_&RoO from
___
525
ERROR 525-782: The symbol 'RoO' is unknown.

132        create data work.OptimalSolution_&RoO from
____
525
ERROR 525-782: The symbol 'from' is unknown.

133        [station a e]={c in stations, <a,e> in orientations: CHI[c,a,e]>0.5} CHI;
_                                                           ___
22                                                          79
202                                                         583
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, ',', -, .., /, <, <=, <>, =, >, ><, >=, AND, BY,
CROSS, DIFF, ELSE, IN, INTER, NOT, OR, SYMDIFF, TO, UNION, WITHIN, [, ], ^, ^=, |, ||, ~, ~=.

ERROR 79-322: Expecting a ].

ERROR 202-322: The option or parameter is not recognized and will be ignored.

ERROR 583-782: The implied subscript count does not match array 'CHI', 0 NE 3.

_______     _
525         599
ERROR 525-782: The symbol 'station' is unknown.

ERROR 599-782: The operand types for '=' are mismatched, found a number and a set.

133      ! [station a e]={c in stations, <a,e> in orientations: CHI[c,a,e]>0.5} CHI;
_
525
ERROR 525-782: The symbol 'e' is unknown.

134        quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE OPTMODEL used (Total process time):
real time           42.47 seconds
user cpu time       53.38 seconds
system cpu time     2.45 seconds
memory              2419788.07k
OS Memory           2577124.00k
Timestamp           12/13/2021 08:41:55 PM
Step Count                        73  Switch Count  56
Page Faults                       0
Page Reclaims                     743338
Page Swaps                        0
Voluntary Context Switches        6196
Involuntary Context Switches      144
Block Input Operations            0
Block Output Operations           40

135        /*Print Results*/
136

136      !       proc print data=work.optimalsolution_&RoO;
WARNING: Apparent symbolic reference ROO not resolved.
136        proc print data=work.optimalsolution_&RoO;
_
22
ERROR 22-322: Syntax error, expecting one of the following: ;, (, BLANKLINE, CONTENTS, DATA, DOUBLE, GRANDTOTAL_LABEL,
GRANDTOT_LABEL, GRAND_LABEL, GTOTAL_LABEL, GTOT_LABEL, HEADING, LABEL, N, NOOBS, NOSUMLABEL, OBS, ROUND, ROWS, SPLIT,
STYLE, SUMLABEL, UNIFORM, WIDTH.

136        proc print data=work.optimalsolution_&RoO;
_
200
ERROR 200-322: The symbol is not recognized and will be ignored.

WARNING: Apparent symbolic reference ROO not resolved.
ERROR: File WORK.OPTIMALSOLUTION_.DATA does not exist.
137        Title "Optimal Solution RoO=&RoO x &RoO km";
WARNING: Apparent symbolic reference ROO not resolved.
WARNING: Apparent symbolic reference ROO not resolved.
138        run;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time           0.00 seconds
user cpu time       0.00 seconds
system cpu time     0.00 seconds
memory              225.06k
OS Memory           77412.00k
Timestamp           12/13/2021 08:41:55 PM
Step Count                        74  Switch Count  1
Page Faults                       0
Page Reclaims                     31
Page Swaps                        0
Voluntary Context Switches        10
Involuntary Context Switches      0
Block Input Operations            0
Block Output Operations           0

139        /* Create Macro Variables for Station and Optimal Solution*/
140

140      !      data macrovariables;
141        set optimalsolution_&RoO;
_
22
200
WARNING: Apparent symbolic reference ROO not resolved.
ERROR: File WORK.OPTIMALSOLUTION_.DATA does not exist.
ERROR: File WORK.ROO.DATA does not exist.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY,
KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.

ERROR 200-322: The symbol is not recognized and will be ignored.

142        suffix=put(_n_,5.);
143        call symput (cats('Sta_Code',suffix),Station);
144        call symput (cats('Opt_Orientation',suffix),catx('/',a,e));
145        run;

NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
143:43
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.MACROVARIABLES may be incomplete.  When this step was stopped there were 0 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time           0.00 seconds
user cpu time       0.00 seconds
system cpu time     0.00 seconds
memory              649.50k
OS Memory           77672.00k
Timestamp           12/13/2021 08:41:55 PM
Step Count                        75  Switch Count  2
Page Faults                       0
Page Reclaims                     91
Page Swaps                        0
Voluntary Context Switches        11
Involuntary Context Switches      0
Block Input Operations            0
Block Output Operations           264

146
147        data plot;
148        set RoO_Matrix;
149        where k>=1;
150        x=input(scan(target,1,'/'),8.);
151        y=input(scan(target,2,'/'),8.);
152        z=input(scan(target,3,'/'),8.);
153        run;

NOTE: There were 947544 observations read from the data set WORK.ROO_MATRIX.
WHERE k>=1;
NOTE: The data set WORK.PLOT has 947544 observations and 7 variables.
NOTE: DATA statement used (Total process time):
real time           0.74 seconds
user cpu time       0.57 seconds
system cpu time     0.17 seconds
memory              3447.31k
OS Memory           80492.00k
Timestamp           12/13/2021 08:41:56 PM
Step Count                        76  Switch Count  5
Page Faults                       0
Page Reclaims                     543
Page Swaps                        0
Voluntary Context Switches        20
Involuntary Context Switches      158
Block Input Operations            0
Block Output Operations           133640

154        proc sort data=plot;
155        by z descending station orientation_string;
156        run;

NOTE: There were 947544 observations read from the data set WORK.PLOT.
NOTE: The data set WORK.PLOT has 947544 observations and 7 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time           0.38 seconds
user cpu time       0.64 seconds
system cpu time     0.18 seconds
memory              132041.67k
OS Memory           208648.00k
Timestamp           12/13/2021 08:41:56 PM
Step Count                        77  Switch Count  8
Page Faults                       0
Page Reclaims                     32131
Page Swaps                        0
Voluntary Context Switches        3296
Involuntary Context Switches      12
Block Input Operations            0
Block Output Operations           133640

157        ods graphics / reset width=6.4in height=6.4in;
158        proc sgplot data=plot aspect=1;
159        by z;
160        where ((station="&Sta_Code1" and orientation_string= "&Opt_Orientation1") or
WARNING: Apparent symbolic reference STA_CODE1 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION1 not resolved.
161        (station="&Sta_Code2" and orientation_string="&Opt_Orientation2") or
WARNING: Apparent symbolic reference STA_CODE2 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION2 not resolved.
162        (station="&Sta_Code3" and orientation_string="&Opt_Orientation3") or
WARNING: Apparent symbolic reference STA_CODE3 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION3 not resolved.
163        (station="&Sta_Code4" and orientation_string="&Opt_Orientation4") or
WARNING: Apparent symbolic reference STA_CODE4 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION4 not resolved.
164        (station="&Sta_Code5" and orientation_string="&Opt_Orientation5") or
WARNING: Apparent symbolic reference STA_CODE5 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION5 not resolved.
165        (station="&Sta_Code6" and orientation_string="&Opt_Orientation6") or
WARNING: Apparent symbolic reference STA_CODE6 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION6 not resolved.
166        (station="&Sta_Code7" and orientation_string="&Opt_Orientation7") or
WARNING: Apparent symbolic reference STA_CODE7 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION7 not resolved.
167        (station="&Sta_Code8" and orientation_string="&Opt_Orientation8") or
WARNING: Apparent symbolic reference STA_CODE8 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION8 not resolved.
168        (station="&Sta_Code9" and orientation_string="&Opt_Orientation9") or
WARNING: Apparent symbolic reference STA_CODE9 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION9 not resolved.
169        (station="&Sta_Code10" and orientation_string="&Opt_Orientation10") or
WARNING: Apparent symbolic reference STA_CODE10 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION10 not resolved.
170        (station="&Sta_Code11" and orientation_string="&Opt_Orientation11") or
WARNING: Apparent symbolic reference STA_CODE11 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION11 not resolved.
171        (station="&Sta_Code12" and orientation_string="&Opt_Orientation12") or
WARNING: Apparent symbolic reference STA_CODE12 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION12 not resolved.
172        (station="&Sta_Code13" and orientation_string="&Opt_Orientation13") or
WARNING: Apparent symbolic reference STA_CODE13 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION13 not resolved.
173        (station="&Sta_Code14" and orientation_string="&Opt_Orientation14") or
WARNING: Apparent symbolic reference STA_CODE14 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION14 not resolved.
174        (station="&Sta_Code15" and orientation_string="&Opt_Orientation15"));
WARNING: Apparent symbolic reference STA_CODE15 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION15 not resolved.
175
176        Title "New Azimuth (N),New Elevation Angles by Level";
177        scatter x=x y=y /group=station transparency=.85 markerattrs=(symbol=circlefilled);
178        xaxis grid min=-800 max=800;
179        yaxis grid min=-800 max=800;
180        run;

NOTE: There were 0 observations read from the data set WORK.PLOT.
WHERE 0 /* an obviously FALSE WHERE clause */ ;
NOTE: PROCEDURE SGPLOT used (Total process time):
real time           0.00 seconds
user cpu time       0.01 seconds
system cpu time     0.00 seconds
memory              1947.00k
OS Memory           79720.00k
Timestamp           12/13/2021 08:41:56 PM
Step Count                        78  Switch Count  1
Page Faults                       0
Page Reclaims                     312
Page Swaps                        0
Voluntary Context Switches        6
Involuntary Context Switches      0
Block Input Operations            0
Block Output Operations           8

181
182
183
184        OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
SYMBOLGEN:  Macro variable GRAPHTERM resolves to GOPTIONS NOACCESSIBLE;
194
User: u44673568
``````
SAS Super FREQ

## Re: Looking for ways to improve Optmodel execution times

You should be fixing that station USL000 to only one orientation (one FIX statement).  What you tried violates the CHI_constraint for that station.

Quartz | Level 8

## Re: Looking for ways to improve Optmodel execution times

Thanks, Rob, for pointing out my error.  I fixed it and ran the code.  Execution time was only a few seconds faster at 37 minutes and 10 seconds.  The logfile is below. Do you see anything else that can be improved for better performance?   Can you explain is happening under the hood when the Best Bound value creeps down at such small increments and so slowly?

Gene

``````72         Proc Optmodel;
73         options fullstimer;
74         /* Read CoverageMatrix data into index sets*/
75         set <str> stations;
76         read data work.station_id into stations=[station];
NOTE: There were 8 observations read from the data set WORK.STATION_ID.
77
78         set Station_Pairs={<'US000S','US001R'>,<'US000V','US001Q'>};
79
80         set <str> ORIENTATION_STRING=/'45/35' '90/35' '135/35' '180/35' '225/35' '270/35' '315/35' '360/35' /;
81         set ORIENTATIONS = setof {s in orientation_string}
82         <input(scan(s,1,'/'),best.),input(scan(s,2,'/'),best.)>;
83         put orientations=;
ORIENTATIONS={<45,35>,<90,35>,<135,35>,<180,35>,<225,35>,<270,35>,<315,35>,<360,35>}
84
85
86
87         set <str> Targets;
88         read data work.targets into TARGETS=[target];
NOTE: There were 195228 observations read from the data set WORK.TARGETS.
89         num Matrix {stations, ORIENTATION_string, TARGETS};
90         read data work.RoO_Matrix into [station orientation_string target]
91         Matrix=k;
NOTE: There were 12494592 observations read from the data set WORK.ROO_MATRIX.
92
93         /* Set Constants*/
94         /* optimal number of cameras covering each target*/
95         %Let k=3;
96         num k=&k;
SYMBOLGEN:  Macro variable K resolves to 3
97
98         /*Declare Variables*/
99         var CHI {stations, ORIENTATIONS} binary;
100
101        var IsTriplyCovered {TARGETS} binary;
102        impvar XIT{target in TARGETS}=sum{station in stations, <a,e> in
103        orientations} matrix[station, a||'/'||e, target] *Chi[station,a,e];
104
105        /*Rob Pratt suggestion to improve execution time*/
106        fix CHI['USL000',45,35]=1;
107
108        /* Declare Model*/
109        max NumTriplyCovered=sum{t in TARGETS} IsTriplyCovered[t];
110
111        /*Subject to Following Constraints*/
112        con CHI_constraint {station in stations}:
113        sum{<a,e> in ORIENTATIONS}CHI[station,a,e] <=1;
114
115        con TriplyCoveredCon {t in TARGETS}: XIT[t] >=k * IsTriplyCovered[t];
116
117        set AZIMUTHS = setof {<a,e> in ORIENTATIONS} a;
118           put AZIMUTHS=;
AZIMUTHS={45,90,135,180,225,270,315,360}
119           set AZIMUTH_PAIRS = {a1 in AZIMUTHS, a2 in AZIMUTHS: mod(a1-a2+360,360) <= 45};
120           put AZIMUTH_PAIRS=;
AZIMUTH_PAIRS={<45,45>,<45,360>,<90,45>,<90,90>,<135,90>,<135,135>,<180,135>,<180,180>,<225,180>,<225,225>,<270,225>,<270,270>,<315,
270>,<315,315>,<360,315>,<360,360>}
121
122          con NotAdjacentAzimuths {<s1,s2> in STATION_PAIRS, <a1,a2> in AZIMUTH_PAIRS}:
123              sum {<a,e> in ORIENTATIONS: a in {a1,a2}} (CHI[s1,a,e] + CHI[s2,a,e]) <= 1;
124        /*    expand; */
125
126        /* Call Solver and Save Results:*/
127        solve with milp/ heuristics=2 presolver=3 relobjgap=0.0;
NOTE: Problem generation will use 2 threads.
NOTE: The problem has 195292 variables (0 free, 1 fixed).
NOTE: The problem uses 195228 implicit variables.
NOTE: The problem has 195292 binary and 0 integer variables.
NOTE: The problem has 195268 linear constraints (40 LE, 0 EQ, 195228 GE, 0 range).
NOTE: The problem has 1142932 linear constraint coefficients.
NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).
NOTE: The MILP presolver value AGGRESSIVE is applied.
NOTE: The MILP presolver removed 192680 variables and 192689 constraints.
NOTE: The MILP presolver removed 1107728 constraint coefficients.
NOTE: The MILP presolver modified 801 constraint coefficients.
NOTE: The presolved problem has 2612 variables, 2579 constraints, and 35204 constraint coefficients.
NOTE: The MILP solver is called.
NOTE: The parallel Branch and Cut algorithm is used.
NOTE: The Branch and Cut algorithm is using up to 2 threads.
Node   Active   Sols    BestInteger      BestBound      Gap    Time
0        1      3  23990.0000000  61138.0000000   60.76%       9
0        1      3  23990.0000000  39312.0000000   38.98%       9
0        1      3  23990.0000000  38127.7801515   37.08%      11
0        1      3  23990.0000000  37130.9544114   35.39%      11
0        1      3  23990.0000000  36692.3216045   34.62%      12
0        1      3  23990.0000000  36504.1395405   34.28%      12
0        1      3  23990.0000000  36420.4284890   34.13%      12
0        1      3  23990.0000000  36356.7490045   34.02%      13
0        1      3  23990.0000000  36274.3886694   33.87%      13
0        1      3  23990.0000000  36204.5574512   33.74%      13
0        1      3  23990.0000000  36137.2290216   33.61%      14
0        1      3  23990.0000000  36123.2972914   33.59%      14
0        1      3  23990.0000000  36119.0474640   33.58%      14
0        1      3  23990.0000000  36106.1955179   33.56%      15
0        1      3  23990.0000000  36097.8491496   33.54%      15
0        1      3  23990.0000000  36092.0621002   33.53%      15
0        1      3  23990.0000000  36084.1711840   33.52%      15
0        1      3  23990.0000000  36080.1799044   33.51%      16
NOTE: The MILP solver added 785 cuts with 4461 cut coefficients at the root.
1        2      3  23990.0000000  36080.1799044   33.51%      16
92       84      3  23990.0000000  35678.8140111   32.76%      20
200      187      3  23990.0000000  35438.1099578   32.30%      25
307      287      4  24330.0000000  35317.9985736   31.11%      27
347      325      5  24436.0000000  35299.0728640   30.77%      28
376      353      5  24436.0000000  35270.9243489   30.72%      30
498      465      5  24436.0000000  35179.5881591   30.54%      35
622      582      5  24436.0000000  35156.6853080   30.49%      40
747        1      5  24436.0000000  35019.6880171   30.22%      47
819       69      6  24522.0000000  35019.6880171   29.98%      50
820       70      6  24522.0000000  35019.6880171   29.98%      50
925      170      9  27481.0000000  35019.6880171   21.53%      53
935      175      9  27481.0000000  35019.6880171   21.53%      55
1037      274      9  27481.0000000  35019.6880171   21.53%      60
NOTE: The Decomposition algorithm is used.
NOTE: The Decomposition algorithm time is 0.63 seconds.
1164      396      9  27481.0000000  34670.4366167   20.74%      65
1224      449      9  27481.0000000  34530.2041077   20.41%      70
1239      462     10  27492.0000000  34530.2041077   20.38%      71
1273      491     11  27500.0000000  34523.2661646   20.34%      73
1313      528     11  27500.0000000  34462.2905258   20.20%      75
1417      619     11  27500.0000000  34384.1242965   20.02%      80
1477      672     11  27500.0000000  34278.6085959   19.78%      85
1567      750     11  27500.0000000  34212.6188681   19.62%      90
1625      799     11  27500.0000000  34175.6139980   19.53%      95
1695      864     11  27500.0000000  34154.3283232   19.48%     100
1721      887     12  27503.0000000  34126.7849157   19.41%     100
1724      888     13  27505.0000000  34087.9161005   19.31%     100
1807      952     13  27505.0000000  33933.0291500   18.94%     105
1869     1002     13  27505.0000000  33881.4232385   18.82%     110
1927     1041     14  27512.0000000  33778.3581663   18.55%     114
1930     1043     14  27512.0000000  33762.8985315   18.51%     115
1975     1076     14  27512.0000000  33694.1238456   18.35%     120
2020     1107     14  27512.0000000  33640.0080999   18.22%     125
2021     1107     16  27545.0000000  33640.0080999   18.12%     125
2047     1125     16  27545.0000000  33606.3341194   18.04%     130
2073     1145     16  27545.0000000  33598.7736264   18.02%     135
2119     1182     16  27545.0000000  33566.4744542   17.94%     140
2163     1216     16  27545.0000000  33539.2577104   17.87%     145
2193     1240     16  27545.0000000  33527.8809774   17.84%     150
2221     1263     16  27545.0000000  33526.0634607   17.84%     155
2259     1291     16  27545.0000000  33457.3006099   17.67%     160
2291     1316     16  27545.0000000  33439.9249790   17.63%     165
2319     1336     17  27600.0000000  33401.0503735   17.37%     169
2321     1336     17  27600.0000000  33394.4530001   17.35%     171
2351     1361     17  27600.0000000  33369.3079313   17.29%     176
2383     1387     17  27600.0000000  33351.6920371   17.25%     180
2429     1418     19  28145.0000000  33318.7316262   15.53%     183
2463     1436     19  28145.0000000  33287.1613501   15.45%     185
2493     1453     19  28145.0000000  33196.4363181   15.22%     190
2528     1479     19  28145.0000000  33179.2226119   15.17%     195
2552     1497     19  28145.0000000  33138.2243498   15.07%     200
2580     1517     19  28145.0000000  33116.4226635   15.01%     205
2604     1524     19  28145.0000000  33078.0263628   14.91%     210
2630     1538     19  28145.0000000  33071.0639472   14.90%     215
2648     1547     19  28145.0000000  33057.6900363   14.86%     220
2684     1565     19  28145.0000000  33034.0598860   14.80%     225
2706     1581     19  28145.0000000  33018.3238359   14.76%     230
2736     1593     19  28145.0000000  32999.2147639   14.71%     235
2762     1616     19  28145.0000000  32991.2401113   14.69%     240
2786     1629     19  28145.0000000  32971.7655490   14.64%     245
2804     1640     19  28145.0000000  32954.8817894   14.60%     250
2828     1654     19  28145.0000000  32947.3818875   14.58%     255
2859     1675     19  28145.0000000  32937.1002699   14.55%     260
2885     1689     19  28145.0000000  32916.2067867   14.50%     265
2905     1696     19  28145.0000000  32886.9752917   14.42%     270
2935     1718     19  28145.0000000  32872.3261050   14.38%     275
2963     1737     19  28145.0000000  32862.0474192   14.35%     280
2991     1752     19  28145.0000000  32846.4084678   14.31%     285
3010     1767     19  28145.0000000  32833.6042658   14.28%     290
3032     1778     19  28145.0000000  32824.0539439   14.25%     295
3042     1778     19  28145.0000000  32812.0985895   14.22%     300
3070     1795     19  28145.0000000  32802.9313734   14.20%     305
3090     1796     19  28145.0000000  32776.4674619   14.13%     310
3116     1811     19  28145.0000000  32768.1291616   14.11%     315
3130     1818     19  28145.0000000  32765.6154429   14.10%     320
3144     1826     19  28145.0000000  32758.4546474   14.08%     325
3168     1839     19  28145.0000000  32738.1771688   14.03%     330
3186     1839     19  28145.0000000  32720.2593456   13.98%     335
3218     1860     19  28145.0000000  32703.9446058   13.94%     340
3244     1880     19  28145.0000000  32695.6508850   13.92%     345
3260     1883     19  28145.0000000  32681.5042359   13.88%     351
3273     1894     19  28145.0000000  32679.9761645   13.88%     355
3287     1897     19  28145.0000000  32664.5114888   13.84%     360
3313     1909     19  28145.0000000  32622.2162981   13.72%     365
3342     1935     19  28145.0000000  32606.8530471   13.68%     370
3354     1943     19  28145.0000000  32603.6748745   13.68%     375
3378     1962     19  28145.0000000  32594.4430060   13.65%     380
3392     1969     19  28145.0000000  32581.8484317   13.62%     385
3412     1976     19  28145.0000000  32570.4567912   13.59%     390
3440     1997     19  28145.0000000  32543.2918336   13.52%     395
3464     2005     19  28145.0000000  32529.5712123   13.48%     400
3480     2012     19  28145.0000000  32512.0159007   13.43%     406
3494     2014     19  28145.0000000  32498.1884249   13.40%     410
3508     2018     19  28145.0000000  32489.2116594   13.37%     415
3522     2018     19  28145.0000000  32472.6505570   13.33%     420
3548     2040     19  28145.0000000  32468.0946120   13.31%     425
3566     2046     19  28145.0000000  32453.9744347   13.28%     430
3584     2055     19  28145.0000000  32447.9099523   13.26%     435
3608     2064     19  28145.0000000  32429.8186704   13.21%     440
3624     2069     19  28145.0000000  32412.7257155   13.17%     445
3642     2077     19  28145.0000000  32399.0641145   13.13%     450
3660     2087     19  28145.0000000  32395.5001725   13.12%     455
3686     2103     19  28145.0000000  32381.8860548   13.08%     460
3710     2121     19  28145.0000000  32369.8393202   13.05%     465
3722     2127     19  28145.0000000  32362.2786409   13.03%     470
3742     2139     19  28145.0000000  32349.7596371   13.00%     475
3760     2141     19  28145.0000000  32323.3519976   12.93%     480
3774     2147     19  28145.0000000  32317.0238356   12.91%     485
3792     2155     19  28145.0000000  32304.2578449   12.88%     490
3808     2159     19  28145.0000000  32285.2578640   12.82%     495
3824     2168     19  28145.0000000  32281.3548247   12.81%     500
3846     2177     19  28145.0000000  32266.3143726   12.77%     505
3868     2187     19  28145.0000000  32253.2656199   12.74%     510
3888     2196     19  28145.0000000  32246.1066227   12.72%     515
3945     2224     19  28145.0000000  32210.8131186   12.62%     520
3967     2235     19  28145.0000000  32194.5390467   12.58%     525
3985     2240     19  28145.0000000  32180.8921155   12.54%     530
4011     2255     19  28145.0000000  32164.8927594   12.50%     535
4029     2258     19  28145.0000000  32133.1775338   12.41%     540
4048     2270     19  28145.0000000  32130.5662909   12.40%     545
4066     2273     19  28145.0000000  32124.7942211   12.39%     550
4089     2288     19  28145.0000000  32115.5910735   12.36%     555
4113     2300     19  28145.0000000  32110.6607619   12.35%     560
4137     2311     19  28145.0000000  32098.4243915   12.32%     565
4155     2315     19  28145.0000000  32080.6187936   12.27%     570
4181     2331     19  28145.0000000  32072.6683070   12.25%     575
4203     2342     19  28145.0000000  32063.4811472   12.22%     580
4217     2343     19  28145.0000000  32053.9412333   12.19%     585
4241     2357     19  28145.0000000  32051.8034044   12.19%     590
4257     2362     19  28145.0000000  32039.3685135   12.15%     595
4281     2371     19  28145.0000000  32032.3362767   12.14%     600
4301     2380     19  28145.0000000  32021.3018941   12.11%     605
4323     2386     19  28145.0000000  32007.5817268   12.07%     610
4345     2397     19  28145.0000000  31999.2190069   12.04%     615
4367     2410     19  28145.0000000  31998.7399175   12.04%     620
4391     2419     19  28145.0000000  31986.1735671   12.01%     625
4413     2435     19  28145.0000000  31979.9174940   11.99%     630
4427     2435     19  28145.0000000  31957.0406653   11.93%     635
4449     2445     19  28145.0000000  31944.5725237   11.89%     640
4465     2448     19  28145.0000000  31931.8700111   11.86%     645
4483     2450     19  28145.0000000  31917.3537133   11.82%     650
4497     2454     19  28145.0000000  31903.3508142   11.78%     655
4515     2458     19  28145.0000000  31898.5707476   11.77%     660
4533     2471     19  28145.0000000  31892.4111173   11.75%     665
4547     2475     19  28145.0000000  31876.6885913   11.71%     670
4583     2490     19  28145.0000000  31869.1311284   11.69%     675
4599     2499     19  28145.0000000  31862.7031547   11.67%     680
4617     2504     19  28145.0000000  31850.8973269   11.64%     685
4633     2511     19  28145.0000000  31843.6541359   11.62%     690
4651     2521     19  28145.0000000  31835.3270751   11.59%     695
4663     2525     19  28145.0000000  31817.6557916   11.54%     700
4685     2529     19  28145.0000000  31805.1312837   11.51%     705
4703     2530     19  28145.0000000  31794.8589187   11.48%     710
4723     2532     19  28145.0000000  31777.4954324   11.43%     715
4739     2540     19  28145.0000000  31775.4585865   11.43%     720
4751     2545     19  28145.0000000  31765.8162203   11.40%     725
4814     2572     19  28145.0000000  31761.6654875   11.39%     731
4827     2576     19  28145.0000000  31744.7172772   11.34%     735
4841     2584     19  28145.0000000  31742.6475725   11.33%     740
4861     2594     19  28145.0000000  31716.7215296   11.26%     745
4879     2595     19  28145.0000000  31703.7362426   11.22%     750
4899     2600     19  28145.0000000  31687.6507539   11.18%     755
4919     2605     19  28145.0000000  31681.4975952   11.16%     760
4933     2604     19  28145.0000000  31659.3953080   11.10%     765
4951     2608     19  28145.0000000  31641.0837646   11.05%     770
4977     2613     19  28145.0000000  31628.1407365   11.01%     775
4991     2613     19  28145.0000000  31617.4274150   10.98%     780
5003     2611     19  28145.0000000  31602.6621687   10.94%     785
5021     2608     19  28145.0000000  31585.7758024   10.89%     790
5039     2609     19  28145.0000000  31577.8457600   10.87%     795
5061     2619     19  28145.0000000  31566.7827296   10.84%     800
5081     2620     19  28145.0000000  31550.6579946   10.79%     805
5101     2627     19  28145.0000000  31535.7586141   10.75%     810
5131     2642     19  28145.0000000  31527.9858519   10.73%     815
5151     2646     19  28145.0000000  31521.2423383   10.71%     820
5169     2654     19  28145.0000000  31513.4690038   10.69%     825
5185     2654     19  28145.0000000  31507.8979001   10.67%     830
5215     2662     19  28145.0000000  31494.1198427   10.63%     835
5243     2671     19  28145.0000000  31478.5310731   10.59%     840
5269     2671     19  28145.0000000  31466.7105538   10.56%     845
5293     2672     19  28145.0000000  31452.8378365   10.52%     850
5315     2679     19  28145.0000000  31448.2860594   10.50%     856
5337     2686     19  28145.0000000  31434.3877225   10.46%     860
5357     2692     19  28145.0000000  31427.8724723   10.45%     865
5371     2693     19  28145.0000000  31419.5685490   10.42%     870
5399     2712     19  28145.0000000  31414.2272274   10.41%     875
5419     2717     19  28145.0000000  31409.3234172   10.39%     880
5439     2721     19  28145.0000000  31401.0348559   10.37%     885
5467     2712     19  28145.0000000  31376.9431268   10.30%     890
5493     2720     19  28145.0000000  31369.8282021   10.28%     895
5521     2729     19  28145.0000000  31366.3042864   10.27%     900
5545     2735     19  28145.0000000  31360.8535707   10.25%     905
5567     2733     19  28145.0000000  31345.2435070   10.21%     910
5585     2738     19  28145.0000000  31339.6080647   10.19%     915
5601     2738     19  28145.0000000  31333.8557987   10.18%     920
5617     2733     19  28145.0000000  31314.9885609   10.12%     925
5645     2746     19  28145.0000000  31295.8665007   10.07%     930
5667     2751     19  28145.0000000  31282.3228192   10.03%     935
5687     2749     19  28145.0000000  31270.9452029   10.00%     940
5731     2761     19  28145.0000000  31259.8266908    9.96%     945
5747     2765     19  28145.0000000  31253.9843707    9.95%     950
5773     2780     19  28145.0000000  31248.3476758    9.93%     955
5797     2780     19  28145.0000000  31229.4811517    9.88%     960
5821     2784     19  28145.0000000  31214.5203233    9.83%     965
5841     2785     19  28145.0000000  31212.7482320    9.83%     970
5875     2786     19  28145.0000000  31201.4393349    9.80%     975
5891     2788     19  28145.0000000  31192.3891289    9.77%     980
5911     2794     19  28145.0000000  31183.9955597    9.75%     985
5935     2791     19  28145.0000000  31172.6819452    9.71%     990
NOTE: The Decomposition algorithm is used.
NOTE: The Decomposition algorithm time is 6.12 seconds.
5953     2796     19  28145.0000000  31170.3316371    9.71%     998
5958     2794     19  28145.0000000  31166.5521082    9.69%    1000
5977     2801     19  28145.0000000  31164.6478209    9.69%    1005
5997     2802     19  28145.0000000  31141.8412000    9.62%    1010
6011     2798     19  28145.0000000  31124.8481648    9.57%    1015
6037     2807     19  28145.0000000  31112.8074947    9.54%    1020
6059     2802     19  28145.0000000  31096.6127767    9.49%    1025
6085     2805     19  28145.0000000  31080.4842099    9.44%    1030
6111     2813     19  28145.0000000  31066.0601894    9.40%    1035
6137     2811     19  28145.0000000  31058.7464523    9.38%    1040
6165     2811     19  28145.0000000  31039.4046010    9.32%    1045
6191     2820     19  28145.0000000  31030.5413157    9.30%    1050
6213     2820     19  28145.0000000  31021.2509000    9.27%    1055
6245     2820     19  28145.0000000  31012.2740504    9.25%    1060
6266     2810     19  28145.0000000  31000.8594295    9.21%    1065
6290     2813     19  28145.0000000  30994.7728396    9.19%    1070
6308     2813     19  28145.0000000  30984.8892906    9.17%    1075
6336     2815     19  28145.0000000  30972.2501307    9.13%    1080
6364     2816     19  28145.0000000  30963.8722442    9.10%    1085
6389     2814     19  28145.0000000  30944.8459094    9.05%    1090
6411     2812     19  28145.0000000  30932.8344722    9.01%    1095
6441     2811     19  28145.0000000  30926.6559000    8.99%    1100
6458     2808     19  28145.0000000  30922.9934999    8.98%    1105
6480     2818     19  28145.0000000  30919.7516612    8.97%    1110
6504     2818     19  28145.0000000  30903.1248843    8.93%    1115
6528     2828     19  28145.0000000  30895.1233758    8.90%    1120
6548     2819     19  28145.0000000  30877.3744724    8.85%    1125
6574     2815     19  28145.0000000  30866.2296492    8.82%    1130
6603     2824     19  28145.0000000  30861.5464463    8.80%    1135
6627     2822     19  28145.0000000  30850.2852980    8.77%    1140
6643     2826     19  28145.0000000  30840.5007980    8.74%    1145
6663     2824     19  28145.0000000  30833.1029509    8.72%    1150
6681     2822     19  28145.0000000  30828.1494559    8.70%    1155
6697     2822     19  28145.0000000  30818.1857308    8.67%    1160
6719     2820     19  28145.0000000  30813.0598031    8.66%    1165
6745     2825     19  28145.0000000  30803.9174413    8.63%    1170
6773     2827     19  28145.0000000  30793.3588747    8.60%    1175
6793     2832     19  28145.0000000  30784.4708480    8.57%    1180
6826     2832     19  28145.0000000  30774.1311543    8.54%    1185
6844     2830     19  28145.0000000  30767.8337438    8.52%    1190
6862     2826     19  28145.0000000  30757.8096518    8.49%    1195
6892     2832     19  28145.0000000  30749.6852959    8.47%    1200
6914     2834     19  28145.0000000  30743.0137074    8.45%    1205
6934     2838     19  28145.0000000  30737.2977784    8.43%    1210
6958     2840     19  28145.0000000  30726.0418917    8.40%    1215
6980     2841     19  28145.0000000  30718.0924440    8.38%    1220
7012     2840     19  28145.0000000  30702.9764014    8.33%    1225
7030     2849     19  28145.0000000  30698.8592256    8.32%    1230
7052     2848     19  28145.0000000  30689.0788373    8.29%    1235
7084     2846     19  28145.0000000  30676.6284907    8.25%    1240
7108     2848     19  28145.0000000  30666.9338475    8.22%    1245
7126     2851     19  28145.0000000  30661.3489667    8.21%    1250
7154     2850     19  28145.0000000  30644.3265284    8.16%    1255
7174     2848     19  28145.0000000  30642.2477406    8.15%    1260
7198     2845     19  28145.0000000  30633.7700090    8.12%    1265
7234     2863     19  28145.0000000  30629.2858955    8.11%    1270
7254     2871     19  28145.0000000  30628.8963563    8.11%    1275
7278     2881     19  28145.0000000  30622.3366267    8.09%    1280
7320     2882     19  28145.0000000  30613.9028541    8.06%    1285
7373     2919     19  28145.0000000  30610.6178408    8.05%    1290
7390     2926     19  28145.0000000  30610.6178408    8.05%    1295
7408     2921     19  28145.0000000  30592.9903558    8.00%    1300
7427     2924     19  28145.0000000  30586.9428382    7.98%    1305
7447     2933     19  28145.0000000  30577.6573871    7.96%    1310
7471     2927     19  28145.0000000  30544.3898634    7.86%    1315
7494     2927     19  28145.0000000  30529.9787359    7.81%    1320
7518     2933     19  28145.0000000  30515.9473231    7.77%    1325
7538     2936     19  28145.0000000  30498.5796667    7.72%    1330
7583     2941     19  28145.0000000  30490.4009674    7.69%    1335
7615     2951     19  28145.0000000  30488.1019600    7.69%    1340
7653     2970     19  28145.0000000  30472.9928319    7.64%    1345
7669     2973     19  28145.0000000  30469.7965994    7.63%    1350
7693     2972     19  28145.0000000  30455.9228844    7.59%    1355
7721     2979     19  28145.0000000  30442.4549949    7.55%    1360
7749     2980     19  28145.0000000  30437.6443100    7.53%    1365
7771     2993     19  28145.0000000  30435.0773975    7.52%    1370
7795     2998     19  28145.0000000  30421.0076316    7.48%    1375
7825     3008     19  28145.0000000  30414.8618932    7.46%    1380
7853     3009     19  28145.0000000  30396.9389585    7.41%    1385
7877     3008     19  28145.0000000  30391.2805630    7.39%    1390
7895     3014     19  28145.0000000  30383.4729311    7.37%    1395
7917     3008     19  28145.0000000  30368.5003877    7.32%    1400
7937     3008     19  28145.0000000  30358.5342152    7.29%    1405
7954     2962     21  28377.0000000  30354.0070556    6.51%    1406
7991     2987     21  28377.0000000  30354.0048894    6.51%    1410
8013     2991     21  28377.0000000  30351.7927868    6.51%    1415
8039     2999     21  28377.0000000  30342.1725099    6.48%    1420
8077     3002     21  28377.0000000  30330.4487051    6.44%    1425
8105     3013     21  28377.0000000  30325.6722299    6.43%    1430
8123     3016     21  28377.0000000  30320.2449097    6.41%    1435
8147     3020     21  28377.0000000  30312.3317362    6.38%    1440
8171     3029     21  28377.0000000  30305.5201294    6.36%    1445
8193     3027     21  28377.0000000  30296.4700729    6.34%    1450
8223     3028     21  28377.0000000  30291.5585268    6.32%    1455
8253     3037     21  28377.0000000  30286.1465708    6.30%    1460
8283     3039     21  28377.0000000  30280.0215661    6.28%    1465
8315     3045     21  28377.0000000  30271.4497257    6.26%    1470
8343     3046     21  28377.0000000  30264.5152269    6.24%    1475
8367     3050     21  28377.0000000  30257.0498289    6.21%    1480
8397     3059     21  28377.0000000  30252.0000000    6.20%    1485
8419     3058     21  28377.0000000  30245.7570556    6.18%    1490
8469     3086     21  28377.0000000  30241.5436886    6.17%    1495
8507     3063     22  28377.0000000  30237.0630746    6.15%    1498
8537     3069     22  28377.0000000  30235.6697504    6.15%    1500
8557     3070     22  28377.0000000  30226.8200666    6.12%    1505
8573     3068     22  28377.0000000  30222.8339858    6.11%    1510
8593     3066     22  28377.0000000  30219.2588475    6.10%    1515
8621     3068     22  28377.0000000  30212.9012674    6.08%    1520
8645     3072     22  28377.0000000  30206.1541457    6.06%    1525
8667     3077     22  28377.0000000  30194.8968702    6.02%    1530
8705     3084     22  28377.0000000  30190.4535675    6.01%    1535
8737     3086     22  28377.0000000  30181.7429467    5.98%    1540
8761     3088     22  28377.0000000  30171.8923568    5.95%    1545
8793     3093     22  28377.0000000  30163.9782447    5.92%    1550
8813     3098     22  28377.0000000  30160.8494613    5.91%    1555
8841     3102     22  28377.0000000  30155.7801709    5.90%    1560
8867     3105     22  28377.0000000  30150.6676462    5.88%    1565
8938     3102     22  28377.0000000  30140.9458552    5.85%    1570
8956     3098     22  28377.0000000  30128.6396839    5.81%    1575
8980     3104     22  28377.0000000  30118.2164179    5.78%    1580
9006     3104     22  28377.0000000  30106.8965556    5.75%    1585
9036     3094     22  28377.0000000  30087.2973898    5.68%    1590
9054     3097     22  28377.0000000  30079.8133177    5.66%    1595
9090     3110     22  28377.0000000  30069.2563903    5.63%    1600
9120     3124     22  28377.0000000  30066.2830850    5.62%    1605
9146     3132     22  28377.0000000  30064.0152266    5.61%    1610
9172     3128     22  28377.0000000  30050.9527505    5.57%    1615
9202     3123     22  28377.0000000  30042.9244245    5.55%    1620
9232     3125     22  28377.0000000  30034.4884381    5.52%    1625
9252     3129     22  28377.0000000  30033.0655236    5.51%    1630
9274     3120     22  28377.0000000  30020.8964914    5.48%    1635
9296     3121     22  28377.0000000  30013.5925953    5.45%    1640
9332     3121     22  28377.0000000  30005.2451889    5.43%    1645
9370     3116     22  28377.0000000  29999.1820676    5.41%    1650
9402     3113     22  28377.0000000  29990.4178324    5.38%    1655
9422     3106     22  28377.0000000  29984.1962100    5.36%    1660
9478     3114     22  28377.0000000  29975.4572087    5.33%    1665
9524     3133     22  28377.0000000  29972.3040264    5.32%    1670
9558     3132     22  28377.0000000  29961.7311017    5.29%    1675
9614     3144     22  28377.0000000  29957.3776101    5.28%    1680
9644     3148     22  28377.0000000  29950.9345510    5.26%    1685
9674     3151     22  28377.0000000  29946.0509856    5.24%    1690
9706     3150     22  28377.0000000  29931.7755385    5.19%    1695
9748     3151     22  28377.0000000  29925.0403993    5.17%    1700
9772     3161     22  28377.0000000  29923.6526635    5.17%    1705
9802     3152     22  28377.0000000  29916.8352793    5.15%    1710
9826     3141     22  28377.0000000  29911.7581999    5.13%    1715
9852     3153     22  28377.0000000  29906.0788805    5.11%    1720
9880     3159     22  28377.0000000  29897.1360596    5.08%    1725
9942     3165     22  28377.0000000  29890.6666667    5.06%    1730
9970     3166     22  28377.0000000  29888.3346767    5.06%    1735
10010     3169     22  28377.0000000  29877.0786772    5.02%    1740
10034     3168     22  28377.0000000  29872.4218797    5.01%    1745
10102     3190     22  28377.0000000  29864.2968824    4.98%    1750
10158     3195     22  28377.0000000  29858.2085053    4.96%    1755
10202     3206     22  28377.0000000  29847.4413500    4.93%    1760
10272     3222     22  28377.0000000  29841.8555273    4.91%    1765
10316     3230     22  28377.0000000  29835.9014957    4.89%    1770
10356     3227     22  28377.0000000  29826.6479638    4.86%    1775
10400     3236     22  28377.0000000  29825.1219495    4.86%    1780
10524     3291     22  28377.0000000  29821.2997955    4.84%    1785
10574     3299     22  28377.0000000  29819.0007001    4.84%    1790
10630     3317     22  28377.0000000  29812.3438103    4.81%    1795
10650     3316     22  28377.0000000  29808.8163340    4.80%    1800
10678     3083     23  28728.0000000  29804.1681777    3.61%    1802
10716     3092     23  28728.0000000  29802.4759818    3.61%    1805
10758     3091     23  28728.0000000  29791.3621770    3.57%    1810
10792     3097     23  28728.0000000  29787.2476143    3.56%    1815
11060     2815     24  28728.0000000  29782.5918807    3.54%    1818
11241     2841     24  28728.0000000  29782.5918807    3.54%    1820
11284     2842     24  28728.0000000  29772.3232094    3.51%    1825
11350     2845     24  28728.0000000  29759.7305700    3.47%    1830
11376     2825     24  28728.0000000  29748.9004354    3.43%    1835
11418     2815     24  28728.0000000  29735.9171870    3.39%    1840
11466     2793     24  28728.0000000  29720.1231793    3.34%    1845
11526     2772     24  28728.0000000  29708.6215872    3.30%    1850
11562     2765     24  28728.0000000  29698.5250530    3.27%    1855
11622     2762     24  28728.0000000  29695.8530980    3.26%    1860
11684     2748     24  28728.0000000  29683.0807308    3.22%    1865
11744     2720     24  28728.0000000  29667.5425233    3.17%    1870
11790     2705     24  28728.0000000  29657.1525424    3.13%    1875
11846     2683     24  28728.0000000  29647.0845950    3.10%    1880
11896     2677     24  28728.0000000  29641.0000000    3.08%    1885
11954     2676     24  28728.0000000  29636.9848583    3.07%    1890
12012     2688     24  28728.0000000  29627.0618021    3.03%    1895
12068     2664     24  28728.0000000  29619.0999480    3.01%    1900
12102     2652     24  28728.0000000  29613.7731180    2.99%    1905
12164     2638     24  28728.0000000  29607.9448883    2.97%    1910
12218     2622     24  28728.0000000  29600.5000000    2.95%    1915
12286     2600     24  28728.0000000  29582.6748812    2.89%    1920
12332     2579     24  28728.0000000  29574.5611908    2.86%    1925
12380     2573     24  28728.0000000  29572.0470733    2.85%    1930
12446     2569     24  28728.0000000  29564.4011081    2.83%    1935
12522     2527     24  28728.0000000  29546.8138214    2.77%    1940
12562     2521     24  28728.0000000  29543.5071197    2.76%    1945
12614     2521     24  28728.0000000  29535.6896410    2.73%    1950
12684     2489     24  28728.0000000  29524.3076373    2.70%    1955
12740     2469     24  28728.0000000  29513.6161313    2.66%    1960
12788     2450     24  28728.0000000  29505.7223740    2.64%    1965
12842     2424     24  28728.0000000  29496.9771391    2.61%    1970
13024     2391     24  28728.0000000  29486.0426655    2.57%    1975
13088     2365     24  28728.0000000  29468.4576828    2.51%    1980
13151     2336     24  28728.0000000  29450.9021422    2.45%    1985
13193     2337     24  28728.0000000  29444.7923228    2.43%    1990
13255     2309     24  28728.0000000  29429.7050835    2.38%    1995
13309     2281     24  28728.0000000  29421.9782962    2.36%    2000
13357     2260     24  28728.0000000  29417.4588644    2.34%    2005
13437     2227     24  28728.0000000  29405.6666667    2.30%    2010
13525     2192     24  28728.0000000  29394.0339554    2.27%    2015
13587     2164     24  28728.0000000  29384.5008160    2.23%    2020
13655     2125     24  28728.0000000  29366.9237864    2.18%    2025
13723     2094     24  28728.0000000  29359.5000000    2.15%    2030
13823     2079     24  28728.0000000  29349.3640544    2.12%    2035
13887     2040     24  28728.0000000  29338.9432000    2.08%    2040
13953     2008     24  28728.0000000  29330.7875741    2.06%    2045
14027     1979     24  28728.0000000  29324.7076088    2.03%    2050
14123     1943     24  28728.0000000  29310.1735849    1.99%    2055
14189     1909     24  28728.0000000  29302.7318949    1.96%    2060
14255     1885     24  28728.0000000  29295.8783018    1.94%    2065
14319     1846     24  28728.0000000  29288.1592745    1.91%    2070
14391     1812     24  28728.0000000  29280.7650301    1.89%    2075
14467     1777     24  28728.0000000  29270.5145139    1.85%    2080
14543     1743     24  28728.0000000  29258.6263086    1.81%    2085
14683     1741     24  28728.0000000  29249.3342602    1.78%    2090
14759     1727     24  28728.0000000  29239.5422417    1.75%    2095
14845     1683     24  28728.0000000  29221.6677585    1.69%    2100
14927     1650     24  28728.0000000  29208.2091632    1.64%    2105
15009     1615     24  28728.0000000  29202.5593769    1.63%    2110
15138     1546     24  28728.0000000  29188.1966017    1.58%    2115
15228     1519     24  28728.0000000  29165.9825052    1.50%    2120
15308     1472     24  28728.0000000  29142.0147221    1.42%    2125
15386     1433     24  28728.0000000  29127.4904247    1.37%    2130
15474     1385     24  28728.0000000  29115.0188169    1.33%    2135
15564     1338     24  28728.0000000  29100.9765660    1.28%    2140
15678     1267     24  28728.0000000  29084.5000000    1.23%    2145
15816     1191     24  28728.0000000  29064.0778424    1.16%    2150
15934     1123     24  28728.0000000  29050.7382513    1.11%    2155
16046     1055     24  28728.0000000  29033.5009201    1.05%    2160
16194     1011     24  28728.0000000  29011.1774004    0.98%    2165
16396      911     24  28728.0000000  28986.3993874    0.89%    2170
16586      784     24  28728.0000000  28955.4497516    0.79%    2175
17097      433     24  28728.0000000  28903.6666667    0.61%    2180
17478      160     24  28728.0000000  28780.5771932    0.18%    2185
17725        0     24  28728.0000000  28728.0000000    0.00%    2186
NOTE: Optimal.
NOTE: Objective = 28728.
128        create data work.OptimalSolution from
129        [station a e]={c in stations, <a,e> in orientations: CHI[c,a,e]>0.5} CHI;
NOTE: The data set WORK.OPTIMALSOLUTION has 8 observations and 4 variables.
130        quit;
NOTE: PROCEDURE OPTMODEL used (Total process time):
real time           37:09.96
user cpu time       1:11:59.03
system cpu time     8.45 seconds
memory              2530550.54k
OS Memory           2587700.00k
Timestamp           12/13/2021 10:22:22 PM
Step Count                        78  Switch Count  5408
Page Faults                       0
Page Reclaims                     943191
Page Swaps                        0
Voluntary Context Switches        1971953
Involuntary Context Switches      9604
Block Input Operations            0
Block Output Operations           896``````
SAS Super FREQ

## Re: Looking for ways to improve Optmodel execution times

OK, it looks like the MILP presolver was already doing something like the fixing of that variable.  In both cases, you get:

`` NOTE: The presolved problem has 2612 variables, 2579 constraints, and 35204 constraint coefficients.``

The small changes in the BestBound value are typical of the branch-and-cut algorithm, which improves the linear programming bound by branching and adding cutting planes.

The MILP solver also has a decomposition algorithm that can sometimes yield dramatic performance improvements over branch-and-cut.  The simplest invocation involves just adding the DECOMP keyword to the SOLVE WITH MILP statement options.

If you can provide the code and data, I'll see if I can recommend anything else.

Quartz | Level 8

## Re: Looking for ways to improve Optmodel execution times

Rob,

I tried the DECOMP option but it didn't help.  I can post the code here but what's the best way for me to send the dataset to you?  It has 4.25 million observations and is 200MB.

Thanks for your offer to help,

Gene

SAS Super FREQ

## Re: Looking for ways to improve Optmodel execution times

For the RoO_Matrix data set, only the nonzero observations are needed.

Quartz | Level 8

## Re: Looking for ways to improve Optmodel execution times

Rob,

The dataset of non-zero observations is 950,000 observations and 44MB.  Much larger than the 5MB attachment limit.  Is there another way to send it to you?

Gene

SAS Super FREQ

## Re: Looking for ways to improve Optmodel execution times

I will have Technical Support contact you with instructions for sending the data sets.

SAS Employee

## Re: Looking for ways to improve Optmodel execution times

Hi, please check your private messages under your SAS Profile for details regarding opening a track with Technical Support so that you may upload your data.  Thank you.

Discussion stats
• 10 replies
• 1056 views
• 1 like
• 3 in conversation