So this seems like a very simple problem but I am having trouble figuring out the best approach. I may also be formulating the problem incorrectly with additional constraints I'm forgetting to explicitly state.
I need to do the following (2 variables but would like to be able to easily extend to 3 or 4 variables as well):
Minimize $$ J=T_c - N_1∗x-N_2∗y $$ with the following constraints $$ J, x,y \ge0 \\ T_c, N_1, N_2, x,y \in \mathbb{Z} $$
In other words, I'd like to minimize the function J where $T_c,N_1,N_2$ are known quantities by selecting the appropriate values for $x$ and $y$ which are non-negative integers.
I understand there can be multiple solutions. (e.g. one solution for $T_c = 60, N_1 = 6, N_2 = 12$ is $x = 10, y=0$ resulting in J = 0. Another solution is $x = 0, y=5$ resulting in J = 0 again.
After getting all the possible solutions of (x,y), I'd like to take the minimum x+y as well which is obvious after having x and y but if there is a way to integrate that into the original problem that would be convenient as well.
What's the best approach to this?