3 ms·
It's throwaway code written for a blog post, and could certainly be cleaned up. However, Python code to solve the same problem would probably look very similar
by yummyfajitas 14y ago
It's throwaway code written for a blog post, and could certainly be cleaned up.
However, Python code to solve the same problem would probably look very similar to the Haskell code. The initial example given in that presentation has only 4 variables and 4 constraints (slide 5), I have 15 and 27.
Once you get to bigger problems, python code winds up looking similarly ugly. See lines 14-15 in that presentation. As the problems get bigger, your code isn't representing the LP problem. It's translating a small problem specification into a much bigger LP problem.