in reply to optimization problem

First, I don't think it would be trivial with whole numbers.

Second, it is relatively easy to solve such a problem for a (very) small number of weights, but it is known to be a very difficult problem when the number of weights grows larger. In fact, most computer scientists believe that there is probably no workable solution for just a few hundred random values (brute force would probably take billions of years to calculate because of an exponential explosion). In other words, the ability to solve such a problem depends very much on your input data, especially on the number of weights that you have (and also on the data shape). Please provide as much detailed information on the input data as you can (especially the maximum number of values).

Replies are listed 'Best First'.
Re^2: optimization problem
by LanX (Saint) on Jun 11, 2018 at 10:02 UTC
    It depends if the OP needs an optimal or just a somehow "good" solution.

    He didn't provide much details.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      Yes, granted, it depends on that, as well as on a number of other factors. I was really saying that a general solution with a large random data set can be extremely difficult or even next to impossible. But, depending on the data, there may be ways to considerably reduce the complexity, for example if it is possible to discard early a large proportion of the would-be solutions. But we need much more information to be able to decide on whether it is possible to work out such a strategy.