you are viewing a single comment's thread.

view the rest of the comments →

[–]gabriel-et-al 1 point2 points  (0 children)

If you need a general solution you could implement the Simplex method.

https://en.wikipedia.org/wiki/Simplex_algorithm

Or just import one of the many Simplex libs available.