Questions tagged [pulp]

PuLP is a linear programming module for Python.

PuLP is a linear programming module, written in Python.

Further reading

661 questions
5
votes
1 answer

Binary integer programming with PULP using vector syntax for variables?

New to the python library PULP and I'm finding the documentation somewhat unhelpful, as it does not include examples using lists of variables. I've tried to create an absolutely minimalist example below to illustrate my confusion. import…
Peter Cotton
  • 1,013
  • 8
  • 11
4
votes
2 answers

pulp.pulpTestAll() :has no attribute 'pulpTestAll'

I just installed pulp and followed instructions here: https://www.coin-or.org/PuLP/main/installing_pulp_at_home.html#testing-your-pulp-installation however it shows the following message: AttributeError: module 'pulp' has no attribute…
minichloe
  • 41
  • 4
4
votes
1 answer

How can I write an IF condition for my decision variable for Mixed Integer Linear Programming (MILP) using PuLP GLPK on Python?

I am trying to solve an optimization problem using mixed integer linear programming on PuLP with GLPK solver on Python. So far I have been successful solving basic optimization problems with constraints, such as: prob = LpProblem("MILP",…
4
votes
1 answer

How to fix a code with different results for a linear optimization problem with Pulp Gekko & Scipy package?

I'm setting up a new linear optimization code with Python. Unfortunately, I don't have the same results with Pulp, Scipy and Gekko packages. I tried to implement code with different packages for Linear Optimization in Python. OPTIMIZATION WITH…
4
votes
1 answer

Retrieving multiple optimal solutions with Pulp

I am interested in using Pulp to get multiple optimal solutions if they exist. Much of the literature out there leads me to believe that this is not possible with a programming package, but I did find this promising example. Here is the…
Matt Cremeens
  • 4,641
  • 6
  • 29
  • 59
4
votes
1 answer

Speeding up integer linear optimisation with Pulp

I am trying to solve a massive linear integer optimisation problem (MILP) having more than 45.000 binary variables and ~350.000 constraints. I am using Pulp for solving the problem, but I cannot find the solution in a reasonable amount of time.…
aprospero
  • 354
  • 1
  • 9
4
votes
1 answer

Solving a Maximum weight bipartite b-matching

My question is regarding the Maximum Weight B-Matching problem. Bipartite matching problems pair two sets of vertices in a bipartite graph. A maximum weighted bipartite matching (MWM) is defined as a matching where the sum of the values of the…
Sina
  • 167
  • 2
  • 10
4
votes
2 answers

Time limit for mixed integer programming with Python PuLP

I've been using PuLP to solve a particular mixed integer linear program (MIP) I am interested in. However, as the problem size grows, PuLP is taking too long. I want to be able to run the solver for some time and terminate it prematurely if its…
eepperly16
  • 141
  • 3
  • 4
4
votes
1 answer

Converting Excel Solver Solution to Python Pulp

I am finding it hard to convert an Excel Solver model into python pulp syntax. In my model, I am optimizing the HC and OT variables for each department, with an objective of minimizing the sum of the OT variables. The constraints require that the HC…
4
votes
1 answer

PuLP - How to specify the solver's accuracy

I will try to keep my question short and simple. If you need any further information, please let me know. I have an MIP, implemented in Python with the package PuLP. (Roughly 100 variables and constraints) The mathematical formulation of the problem…
Axel
  • 1,603
  • 2
  • 13
  • 27
4
votes
1 answer

Understanding fragments of a Python/PuLP code

I have to adopt an existing script where they used the PuLP package. I need to know how the result of the following line looks like: unit = ["one", "two", "three"] time = range(10) status=LpVariable.dicts("status",[(f,g) for f in unit for g in…
Matias
  • 521
  • 1
  • 4
  • 12
4
votes
2 answers

How to use a variable as a divisor in PuLP

I was trying to resolve a LP problem with a constraint that is calculated by dividing variable A by variable B. The simple version of the problem is as below: The product is made by two materials (A and B) % of A should be greater than 50% % of…
killua8p
  • 304
  • 2
  • 10
4
votes
1 answer

Linear Programming (Simplex LP) PuLP?

In Python only, and using data from a Pandas dataframe, how can I use PuLP to solve linear programming problems the same way I can in Excel? How much budget should be allocated to each Channel under the New Budget column so we maximize the total…
Jarad
  • 12,183
  • 14
  • 71
  • 112
4
votes
1 answer

pickle not playing nice with PuLP

I'm working in Python 2.7 and using the PuLP library to setup a problem. Once the variables, objective and constraints are defined, I pickle my LpProblem object to send off to a Solver elsewhere. Upon un-pickling my problem, I notice that all of the…
Mike
  • 5,433
  • 3
  • 22
  • 46
4
votes
1 answer

Migrating from PuLP to Scipy

Im using PuLP to solve some minimization problems with constraints, uper and low bounds. It is very easy and clean. But im needing to use only the Scipy and Numpy modules. I was…
1
2
3
44 45