2

I want to find whether a given equation like $2x + 5y = 27$ (tow variable linear equation) have integer solution for $x$ and $y$, $x\geq 0, y\geq 0$.

If yes how to find it?

And In my actual question i have to find a solution such that $x+y$ is minimized.

Is there a particular method for this or we have to check for all value?

Gerry Myerson
  • 179,216

1 Answers1

1

Try this link: How to find solutions of linear Diophantine ax + by = c? The mathematical answer to your question lies there, although I suspect it will be somewhat more complicated to efficiently implement this in code.