MHB Algorithm: maximize sum of increasing functions

AI Thread Summary
The discussion centers on finding an algorithm to maximize the sum of increasing functions under a constraint on their inputs. The user, David, seeks to determine values \( n_i \) for multiple increasing functions such that the sum of these values does not exceed a specified limit \( N \), typically around 500. For two functions, exhaustive search is feasible, but the complexity increases with more functions. A suggested solution is the Downhill Simplex method (Nelder-Mead), which David plans to incorporate into a larger optimization framework. The conversation highlights the challenge of integrating heuristic solutions for subproblems within this optimization context.
Pereskia
Messages
15
Reaction score
2
Hi!

(Not sure which forum to pick for this question. This looked like the best one. I apologies if it is not)

I have a number of functions (say m functions) with integer domain. All functions are increasing. (Increasing in the sense not decreasing, $f(n+1) \ge f(n)$.) I want an algorithm to find $n_i$ for $1 \le i \le m$ such that $\sum_i^m n_i \le N$ that maximizes $\sum_i^m f(n_i)$.

$m$ is usually small (2 or 3) but can be larger as well and $m$ = 2 can be solved reasonably fast by exhaustive search, $m\ge3$ takes more time. Typically $N\approx 500$.

Is there any known algorithm?

Regards
David
 
Mathematics news on Phys.org
Pereskia said:
Hi!

(Not sure which forum to pick for this question. This looked like the best one. I apologies if it is not)

I have a number of functions (say m functions) with integer domain. All functions are increasing. (Increasing in the sense not decreasing, $f(n+1) \ge f(n)$.) I want an algorithm to find $n_i$ for $1 \le i \le m$ such that $\sum_i^m n_i \le N$ that maximizes $\sum_i^m f(n_i)$.

$m$ is usually small (2 or 3) but can be larger as well and $m$ = 2 can be solved reasonably fast by exhaustive search, $m\ge3$ takes more time. Typically $N\approx 500$.

Is there any known algorithm?

Regards
David

Hi Pereskia! Welcome to MHB! (Wave)

How do the different functions tie in?
I only see the single $f$, so we seem to have $m$ numbers instead of $m$ functions.
 
Hi!

Sorry, I want to maximize $\sum_{i=1}^m f_i(n_i)$. I lost the index $i$.

Regards
David
 
I like Serena said:
Then I think you are looking for the Downhill Simplex method (Nelder-Mead), which is also called the Amoeba method.

Thank you. I will add this method to my tool box.

I will however need the optimum in this case. It will be one part of a larger optimization algorithm. I don't know how the other parts will work with heuristic solutions to the subproblems.

Regards
David
 
Seemingly by some mathematical coincidence, a hexagon of sides 2,2,7,7, 11, and 11 can be inscribed in a circle of radius 7. The other day I saw a math problem on line, which they said came from a Polish Olympiad, where you compute the length x of the 3rd side which is the same as the radius, so that the sides of length 2,x, and 11 are inscribed on the arc of a semi-circle. The law of cosines applied twice gives the answer for x of exactly 7, but the arithmetic is so complex that the...
Back
Top