Cloud Stack Ninja

import pulp as p
import numpy as np
a1=np.array([1000,2000,3000,7000,8000,13000,223000,32000,35000,369000,38000,3885000])

x=p.LpVariable('x', lowBound=5000, cat='Continuous')
y=p.LpVariable('y', lowBound=8000,cat='Continuous')

Lp_prob=(((y-x)*1.3+x)*0.014428)+((a1-y)*1.5*0.014428)
Lp_prob.solve()

I try to do linear programming in pulp. But I have 'LpAffineExpression' object has no attribute 'solve' error.

How can I fix it? Thanks.



Read more here: https://stackoverflow.com/questions/64405352/lpaffineexpression-object-has-no-attribute-solve-in-pulp-lp-problem-optimiz

Content Attribution

This content was originally published by mehmetliburak at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: