Computing optimal crop mix

When it comes to finding the optimal crops to support a family, there are a number of factors to consider: how much space is available, how many people are being supported, what are their daily calorie requirements, what vitamins and minerals does each crop provide... There's a lot to consider. And it's not like I can pick just one “best” mix and build a one-size-fits-all system around that. I need to figure out the optimal mix for my own scenario while allowing other fountaineers to figure out the right mix for theirs . Sounds complicated, right?


Well, if I were coming at this problem cold, it would definitely be a challenge, but this is where life chose to play the irony card on me. There was one course in my undergraduate math degree (35 years ago) that I had to take three times in order to master its dark mysteries: Linear Programming. And it just so happens that solving this crop problem is a classic example of a multivariate optimization problem. Care to guess which undergraduate class deals with those?

Fortunately, I won't have to do the math myself. (Whew!) I just needed to remember enough of that class to recognize the problem type and recall a few key terms to search in Google. And that led me to the linear programming tools in Python's SciPy module.

I even found a decent article outlining how to use the module to solve multivariate problems. Hopefully I'll be able to just build a little script and let Python do the math for me.

Comments