I am working on a programming (using Python) problem where I have to solve the following type of linear equation in 3 variables:
x, y, z are all integers.
Equation example: 2x + 5y + 8z = 14
Condition: Minimize x + y + z
I have been trying to search for an algorithm for finding a solution to this, in an optimum way. If anybody has any idea please guide me through algorithm or code-sources.
I am just curious, what can be done if this problem is extrapolated to n variables?
I don't want to use hit & trial loops to keep checking for values. Also, there may be a scenario that equation has no solution.
UPDATE
Adding lower bounds condition:
x, y, z >= 0
x, y, z are natural