标签:官方文档 pre fun function des 函数 pytho one desc
python工具包scipy linprog
函数格式
scipy.optimize.
linprog
(c, A_ub=None, b_ub=None, A_eq=None, b_eq=None, bounds=None, method=‘simplex‘, callback=None, options=None)import numpy as np import matplotlib.pyplot as mpl from scipy import optimize c=np.array([-7,7,-2,-1,-6,0]) a=np.array([[3,-1,1,-2,0,0],[2,1,0,1,1,0],[-1,3,0,-3,0,1]]) b=np.array([-3,4,12]) res=optimize.linprog(c,A_eq=a,b_eq=b,bounds=((0,None),(0,None),(0,None),(0,None),(0,None),(0,None))) print (res.x) print (res.fun)
glpk求解
答案一致。
标签:官方文档 pre fun function des 函数 pytho one desc
原文地址:http://www.cnblogs.com/cuilulu/p/7994092.html