Skip to content
UPEEC

PuLP and Pyomo

Model linear and mixed-integer optimisation problems in Python and hand them to solvers.

Intermediate
Comments 0
import pulp
m = pulp.LpProblem("plan", pulp.LpMaximize)
x = pulp.LpVariable("x", 0); y = pulp.LpVariable("y", 0)
m += 3 * x + 2 * y; m += x + y <= 4; m += x + 3 * y <= 6
m.solve(); x.value(), y.value()

Pyomo also handles non-linear and dynamic models (e.g. power-system dispatch).

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.