'Find solution of x1+x2+x3(x4+x5) without using BruteForceSearch

Hi i have a optimization question, for example

I need to minimize the function

minimize x1+x2+x3(x4+x5)

And the requirement is

60/x1+ 30/x2+ 6/x3 * [80/x4 + 150/x5] < 750
x1+x2+x3(x4+x5) < 7

x1, x2, x3, x4, x5 are integers and greater than 0

How to find the solution of x1, x2, x3, x4, x5 ?

Is there any optimized method instead of BruteForceSearch ?

Thank you



Solution 1:[1]

Under the constraints above, and noting that x1, x2, x3, x4, x5 are integers and greater than 0, A solution does not exist.

A general form of solving this kind of optimization problems (minimizing a function subject to a constraint) can be done using Lagrange multipliers. [Read more on Lagrange multipliers here][1].

In your problem, the Lagrange multiplier will take the form of

L(x1,x2,x3,x4,x5,lambda) =  1/(x1+x2+x3(x4+x5)) - lambda * (60/x1+ 30/x2+ 6/x3 * [80/x4 + 150/x5] - 750)

Note that the Lagrange multipliers method is used to maximize a function, therefore, the original function to maximize was set to the power of -1, making it a maximization problem.

Taking the partial derivative of the Lagrange multiplier L(x1,x2,x3,x4,x5,lambda) w.r.t each of the 6 variables and trying to zero out the gradient will result in 6 equations with 6 variables, which can be solved to find a general solution (a solution will not be found in this specific problem though)

[1]: https://en.wikipedia.org/wiki/Lagrange_multiplier#:~:text=In%20mathematical%20optimization%2C%20the%20method,chosen%20values%20of%20the%20variables).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1