Questions tagged [pulp]

PuLP is a linear programming module for Python.

PuLP is a linear programming module, written in Python.

Further reading

661 questions
4
votes
1 answer

How to simplify repetitive Python PuLP syntax?

How can I simplify the following Python PuLP statements into something more Pythonic, manageable and correct: import pulp as lp #delare variables #Note that I have to model a 100 year period! year_1 = lp.LpVariable("2011", 0, None, lp.LpInteger) …
dassouki
  • 5,921
  • 7
  • 47
  • 79
3
votes
1 answer

Implementing specific constraint in Pulp

I have successfully implemented a program where I allocate N truck drivers to M gathering hubs for each one of the days of the week. The constraints I have implemented are: A driver cannot work more than 6 days, i.e. 1 day to rest A driver…
azal
  • 1,055
  • 2
  • 17
  • 35
3
votes
1 answer

Pulp Killer sudoku - check choices are distinct for choice of variables

I am trying to solve killer Sudoku using Python linear optimization library, Pulp. https://en.wikipedia.org/wiki/Killer_sudoku Here is my attempt so far, adding a constraint that each row must add up to 45. import pulp prob = pulp.LpProblem("Sudoku…
oli5679
  • 1,149
  • 1
  • 10
  • 27
3
votes
1 answer

"int object is not callable" error using PuLP code

I'm just learning how the PuLP library works, which is a linear programming solver. The code I'm using was found here: LINK. It solves the following optimization problem (in this case, using binary variables x_{ij}): This is the code from the…
3
votes
2 answers

How to configure PuLP to call GLPK solver

I am using the PuLP library in Python to solve an MILP problem. I have run my problem successfully with the default solver (CBC). Now I would like to use PuLP with another solver (GLPK). How do I set up PuLP with GLPK? I have done some research…
johnwolf1987
  • 4,797
  • 3
  • 10
  • 13
3
votes
1 answer

Is there a way to see progress of pulp cbc solver on jupyter notebook?

I would like to see the progress of pulp cbc solver on a jupyter notebook. I am trying to solve a very large lp problem with pulp cbc solver, and as it takes hours and even days to find an optimal answer, I would like to know how far the solver has…
Kevin Lee
  • 63
  • 5
3
votes
1 answer

When using pulp cbc solver, can I set priorities for constraints?

I am trying to calculate an optimal answer to a set of binary variables with lots of constraints. I would like to set priorities for the constraints. ex) constraint 1, 2, 3 has priority 100 (highest) and constraint 4, 5, 6 has priority 1 (lowest) I…
Kevin Lee
  • 63
  • 5
3
votes
2 answers

PuLP and OR-Tools Alternatives

I currently have a MIP model formulated in Gurobi's python API, but recently I've been looking into tools such as PuLP and OR-Tools that allow me to build a model and feed it to multiple different optimizers. One feature of Gurobi used extensively…
jacob
  • 147
  • 2
  • 10
3
votes
1 answer

How to set Gurobi parameter in Pulp

I am using Pulp with Python to specify an LP problem. I want to solve this using Gurobi. The following does work: prob.solve(pulp.GUROBI_CMD()) However, now I want to specify a MIP Gap. This should be a parameter of the Gurobi solver according to…
Jordi
  • 329
  • 3
  • 12
3
votes
2 answers

MILP model with Python PuLP performance issue - solver is very slow

I've been getting into linear programming in Python latetly, and I created my first optimization alrogithm with PuLP. I am dealing with a scheduling problem for a production process. The goal is to minimize production cost per day, by creating an…
3
votes
1 answer

How to add GLPK solver on pulp, python

I'd like to know how to add GLPK solver step by step on pulp, python. I have installed python (v=3.6.5), pulp (v=1.6.8). I get the result as below when I executed pulp.pulpTestAll(). Testing zero subtraction Testing inconsistant lp solution …
mhiro216
  • 71
  • 1
  • 6
3
votes
2 answers

Error disallowing the optimal solution using Python Pulp

I have the following optimization problem: subject to where = {0,1} (binary variables). When I implement this in Pulp as: from pulp import * x1 = pulp.LpVariable('x1', cat=LpBinary) x2 = pulp.LpVariable('x2', cat=LpBinary) x3 =…
RobinHood
  • 337
  • 1
  • 16
3
votes
1 answer

How to show the dual of a (primal) linear program defined in pulp

First question on Stack overflow... love this website... I am using PuLP on Python. Based on inputting variables, an objective function, and constraints, I am trying to view the dual variables/values that are associated with the optimal solution of…
3
votes
1 answer

AttributeError: 'module' object has no attribute 'DefaultRoutingSearchParameters'

I have installed the ortools exactly as mentioned in this link. After that, I copied vehicle routing problem from the documentation and tried to execute.I am using python 2.7.12 in my system. I ended up with the below error: >>python or_test.py …
Neelesh I
  • 185
  • 1
  • 2
  • 13
3
votes
1 answer

Python PuLP "Overwriting previously set objective." and __dummy = None

I have built a pretty complex MIP in Python PuLP. Obviously a bit too complex for me. When I run it it gives the following Warning: UserWarning: Overwriting previously set objective. warnings.warn("Overwriting previously set objective.") The…
Axel
  • 1,603
  • 2
  • 13
  • 27
1 2
3
44 45