PuLP is a Python-based LP modeler software that provides effective solutions for optimizing linear programming problems.
To create new variables using PuLP, the LpVariable() function is used. For example, x = LpVariable("x", 0, 3) is used to create a variable 0 <= x <= 3. To create a new problem, the LpProblem() function is used, as in prob = LpProblem("myProblem", LpMinimize).
Users can combine variables to create expressions and constraints that can be added to the problem using the "+=" operator. For instance, prob += x + y <= 2 adds a constraint to the problem. If an expression is added instead of a constraint (e.g., prob += 4*z + w), it will become the objective of the problem.
After defining the problem, users can choose a solver and solve the problem using the solve() method. For example, prob.solve(GLPK()) will solve the problem using GLPK as the solver. The value of the variables can be obtained using the value() function, as in value(x).
PuLP provides a set of exported classes and functions that allow users to manipulate linear programming problems, including LpProblem, LpVariable, LpConstraint, LpConstraintVar, value(), lpSum(), and lpDot().
Version 1.4.1: N/A