Algorithm: maximize sum of increasing functions

In summary, the Downhill Simplex method is a guaranteed to find the optimum solution to the given problem.
  • #1
Pereskia
15
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
  • #2
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.
 
  • #3
Hi!

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

Regards
David
 
  • #5
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
 

FAQ: Algorithm: maximize sum of increasing functions

1. What is an algorithm for maximizing the sum of increasing functions?

An efficient algorithm for maximizing the sum of increasing functions can be achieved by using dynamic programming. This involves breaking down the problem into smaller subproblems and storing the solutions to these subproblems in a table. By utilizing the stored solutions, the algorithm can efficiently compute the maximum sum of increasing functions.

2. How does dynamic programming help in maximizing the sum of increasing functions?

Dynamic programming helps in maximizing the sum of increasing functions by avoiding repeated computations and improving the time complexity of the algorithm. By storing the solutions to subproblems, the algorithm can quickly retrieve and utilize these solutions instead of recomputing them, making it more efficient.

3. Can the algorithm for maximizing the sum of increasing functions handle negative numbers?

Yes, the algorithm can handle negative numbers as long as they are within the given range of the inputs. The algorithm works by considering the maximum sum of increasing functions up to a certain point, so it can handle both positive and negative numbers in the input.

4. How does the input size affect the performance of the algorithm for maximizing the sum of increasing functions?

The performance of the algorithm for maximizing the sum of increasing functions is directly affected by the input size. As the input size increases, the time and space complexity of the algorithm also increase. This means that the algorithm may take longer to compute and require more memory for larger inputs.

5. Are there any other approaches for maximizing the sum of increasing functions?

Yes, there are other approaches for maximizing the sum of increasing functions such as greedy algorithms or divide and conquer algorithms. However, dynamic programming is often the most efficient approach for this problem as it avoids repeated computations and improves the overall time complexity.

Similar threads

Back
Top