non-linear mixed integer programming question - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-24T03:01:49Z http://mathoverflow.net/feeds/question/27636 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/27636/non-linear-mixed-integer-programming-question non-linear mixed integer programming question Mark 2010-06-10T02:59:44Z 2010-06-11T14:03:02Z <p>I tried this question over in the algorithms section of stackoverflow and never really got a handle on the problem. I know it concerns non-linear mixed integer programming. </p> <p>[In the following, 1...n and k are subscripts. n will be relatively small - like say 5-20, or something like that. No more than a second or two to solve computationally, but I can cut it off after some time limit.]</p> <p>Say you have C1...Cn, and some some positive integer M. (C1...Cn are positive constants and need not be integers. M will incidentally always be 127.) Can you find a postive scaling factor s and a group of integers t1...tn each less than or equal to M (and greater than 0) such that the following objective function is minimized:</p> <p>summation[for k=1 to n] of (abs(tk*s - Ck)).</p> <p>Sort of akin to some variant of the knapsack problem or something else maybe? I don't know. Haven't really done non-linear programming before.</p> http://mathoverflow.net/questions/27636/non-linear-mixed-integer-programming-question/27791#27791 Answer by Mark for non-linear mixed integer programming question Mark 2010-06-11T06:11:09Z 2010-06-11T06:11:09Z <p>FWIW, I ended up just brute-forcing it, but using the solution provided in the first comment by Jules in the OP for finding optimal t1...tn when s is given. I just iterate through s .0001 at at a time from 0 to 20 (s will never be higher than that) and it takes about a second and well worth it. Its far preferable to the results obtained by just using s = max(C)/M.</p> http://mathoverflow.net/questions/27636/non-linear-mixed-integer-programming-question/27809#27809 Answer by Gerhard Paseman for non-linear mixed integer programming question Gerhard Paseman 2010-06-11T12:06:00Z 2010-06-11T12:06:00Z <p>To support Mark's and Jules' observation that max(Ci)/M is a good starting point, I mention the following. Suppose an initial value r was chosen in an attempt to find s. If the Ci were all less than (M+1)r, the total error would be at most n*r, since one could find positive integers ui with (ui-1)r &lt;= Ci &lt;= ui*r, and one of ui, ui-1 would be in the range 1 to M. So smaller r means smaller worst case error.</p> <p>Also, if one has a trial r and computes ui based on r, then looking at sum ui*ei, where ei is the sign of the error ui*r - Ci, one has an indication of which direction to tweak r to reduce the amount of sum abs(ui*r - Ci), while keeping the same values ui.</p> <p>Gerhard "Ask Me About System Design" Paseman, 2010.06.11</p> http://mathoverflow.net/questions/27636/non-linear-mixed-integer-programming-question/27815#27815 Answer by Mark for non-linear mixed integer programming question Mark 2010-06-11T13:46:04Z 2010-06-11T14:03:02Z <p>(This is in response to Gerhard Paseman's answer.)</p> <pre><code> .0001 .001 maxC/M 2.528183 2.528183 calculated s 4.459300 8.917000 total error 2.703720 2.718460 </code></pre> <p>The above represents two runs - one incrementing by .0001 and the other .001 (from 0 to 20 in both cases). One trend is that the difference in total error between .001 and .0001 is absolutely consistent with the above, regardless of the data. The total error is in this case divided between 6 elements, each element averaging about 200 in size. If maxC/M were used as s, the total error would have been something like 7 or higher.)</p> <p>But as to your observation regarding maxC/M being a good starting point for finding s, you can see above what s turned out to be. When using .001 as the increment, s was often much higher than with .0001, (with a consistent reduction in the size of the values for t). So maybe with increasing precision in the search, s converges towards the vicinity of maxC/m, but the example above has thus far seemed to be fairly typical. Haven't completely digested your remarks above yet. Thanks for letting a non-mathematician like me crash the party here.</p>