Pulp provides an easy-to-use syntax and interface for formulating and solving LP problems, including support for a wide range of problem types and solvers. It is widely used in operations research, supply chain management, logistics, and other industries for making optimization decisions.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from pulp import *

# Use CBC solver
prob.solve(PULP_CBC_CMD(msg=True, timeLimit=1, options=["startalg",
"barrier"]))

# Use cplex solver
prob.solve(
CPLEX_CMD(msg=True,
timeLimit=1,
# interactive cmd
options=["set emphasis mip 3", "set barrier algorithm 3"]))

# Use gurobi solver
prob.solve(
GUROBI_CMD(msg=True,
timeLimit=1,
threads=4,
options=[("Method", 2), ("MIPGap", 0.2)]))

# Use scip solver, latest version of pulp only
# support single thread only
prob.solve(SCIP_CMD(msg=True, timeLimit=1, options=["branching/clamp=0.4"]))