def my_lp_solver(c1=c1):
    c = matrix([float(c1), -5.0])
G = matrix([[2.0, 1.0, -1.0, 0.0], [1.0, 2.0, 0.0, -1.0]])
h = matrix([3.0, 3.0, 0.0, 0.0])
sol = solvers.lp(c, G, h)
Стохастическая оптимизация в Python