linear programming in python?

2019-01-30 08:37发布

I need to make a linear programming model. Here are the inequalities I'm using (for example):

6x + 4y <= 24
x + 2y <= 6
-x + y <= 1
y <= 2

I need to find the area described by these inequalities, and shade it in a graph, as well as keep track of the vertices of the bounding lines of this area, and draw the bounding line in a different color. See the graph below for an example of what I'm looking for.

image of the points of intersection.

I'm using Python 3.2, numpy, and matplotlib. Are there better modules for linear programming in Python?

7条回答
Explosion°爆炸
2楼-- · 2019-01-30 09:22

lpsolve is the easiest to me. No need to install separate solver. It comes with in the package.

查看更多
登录 后发表回答