Hi Kaushik, You can do this with the Augmented Lagrangian algorithm. One way to do constraint #2 is like (x_i-.00) * (x_i-.01) * … * (x_i-1.00) = 0. This may suffer from instability. An alternative would be min(|x_i-.00|,|x_i-.01|,…,|x_i-1|) = 0. This is more stable but may perform worse.
Best, Grey > On May 15, 2017, at 2:13 PM, Kaushik Matia <[email protected]> wrote: > > Hi, > > I have optimization as follows: > > v = minimize sum_i sum_j x_i * x_j A_ij > > I have the following constraints: > > 1> sum_i x_i = 100% > > 2> x_i are rounded to the integer percents, e.g. 27.3% will become 27% > > My question is there a way to implement the rounding constraints. > > Thanks in advance. > > Best > > _______________________________________________ > NLopt-discuss mailing list > [email protected] > http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss _______________________________________________ NLopt-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss
