Varun Sharma
Varun Sharma

Reputation: 2758

Algorithm - Minimizing Equation

If we are given an equation say 3x + 2y <= 10, we want to find the value of x and y such that x + y = maximum and 10 - 3x - 2y is minimized. How can this be done? I am thinking of it as a dynamic programming problem ! but not sure if I am right.

In the above x = 0 and y = 5 will be the answer.

Thanks.

Upvotes: 0

Views: 142

Answers (1)

Gene
Gene

Reputation: 46960

There is an immense mathematical literature on this problem. If the equations are all linear, then the answer, if there is a unique one, has to lie on a vertex of the polytope described by the constraints. Look up linear programming. The Simplex algorithm is the classical method for searching along edges of the polytope to find a vertex that satisfies the minimization.

Upvotes: 5

Related Questions