Questions tagged [pulp]

PuLP is a linear programming module for Python.

PuLP is a linear programming module, written in Python. PuLP supports multiple open-source (e.g. the Coin-OR suite) and commercial solvers (e.g. Gurobi, CPLEX).

The Coin-OR suite with the integer solver CBC is included with the Python package.

Further reading

913 questions
26
votes
3 answers

Can't find package on Anaconda Navigator. What to do next?

I am trying to install "pulp" module in Anaconda Navigator's Environment tabs. But when I search in "All" packages I can't find it. It happened with other packages too. Is there any way to install my package to the desired environment? I tried to…
dimrizo
  • 479
  • 1
  • 5
  • 14
19
votes
2 answers

Python Pulp using with Matrices

I am still very new to Python, after years and years of Matlab. I am trying to use Pulp to set up an integer linear program. Given an array of numbers: {P[i]:i=1...N} I want to maximize: sum( x_i P_i ) subject to the constraints A x <= b A_eq x =…
15
votes
2 answers

What does PuLP LpStatus=Undefined actually mean?

When I add a particular constraint to my problem, the LpStatus of the problem after solving changes to "Undefined" (without this constraint, it was "Optimal"). At the top of this page, the possibilities of the return status are shown, but it doesn't…
David Doria
  • 9,873
  • 17
  • 85
  • 147
9
votes
2 answers

Multiple solutions when doing ILP

Currently I'm using PuLP to solve a maximization problem. It works fine, but I'd like to be able to get the N-best solutions instead of just one. Is there a way to do this in PuLP or any other free/Python solution? I toyed with the idea of just…
FuriousGeorge
  • 4,561
  • 5
  • 29
  • 52
9
votes
1 answer

How Can an Elastic SubProblem in PuLP be used as a Constraint?

In Python PuLP, a linear programming constraint can be turned into an elastic subproblem. http://www.coin-or.org/PuLP/pulp.html?highlight=lpsum#elastic-constraints Solving the subproblem optimizes the distance from the target value. Of course, the…
8
votes
3 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
  • 181
  • 1
  • 3
  • 4
8
votes
1 answer

Speed of CPLEX vs CPLEX using SCIP

I am new to LP and have only briefly used PuLP in Python. Why is there a speed difference between SCIP 3.2.1 - CPLEX 12.63 and CPLEX 12.6.3? Doesn't SCIP still use CPLEX for solving? Why will someone use SCIP with CPLEX solver, instead of using…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
8
votes
1 answer

How to disable the output messages in CPLEX solver?

I am using Pulp modeler with python to solve an integer programming problem. I am using IBM CPLEX as a solver. When I run my Python program, I have a lot of output messages in the console like: The CPLEX Optimizers will solve problems up to 1000…
Learning
  • 183
  • 6
8
votes
9 answers

puLP solver error

I am trying to solve MILP in puLP (Python), and I keep getting the following error: Traceback (most recent call last): File "main_lp.py", line 63, in ans = solve_lp(C) File…
anar
  • 463
  • 2
  • 7
  • 11
8
votes
2 answers

PuLP very slow when adding many constraints

I'm trying to use PuLP, but it is taking 50 seconds to add 4000 constraints (with 67 variables). Solving the problem only takes a fraction of a second. We want to use PuLP to easily test several solvers on a large set of problems. Should it be…
jmilloy
  • 7,875
  • 11
  • 53
  • 86
8
votes
3 answers

Writing COIN-OR CBC Log File

I'm using COIN-OR's CBC solver to solve some numerical optimization problems. I'm structuring the optimization problem in Python via PuLP. I've noticed that solvers like GUROBI and CPLEX create log files, but I can't seem to figure out how to get…
7
votes
2 answers

Determine allocation of values - Python

I am trying to create an optimal shift schedule where employees are assigned to shift times. The output should aim to spend the least amount of money. The tricky part is I need to account for specific constraints. These being: 1) At any given time…
jonboy
  • 415
  • 4
  • 14
  • 45
7
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
  • 209
  • 1
  • 3
  • 11
7
votes
2 answers

How to set MIP start (initial solution) with Gurobi solver from PuLP?

I'm using the PuLP module in Python to formulate a mixed integer program. I am trying to work out how to set a MIP start (i.e. a feasible solution for the program to start from) via the PuLP interface. Details on how to set MIP start are given…
kabdulla
  • 5,199
  • 3
  • 17
  • 30
7
votes
3 answers

How to disable the calculations log of pulp

I am using "pulp" in python together with GUROBI to solve some optimization problems. For example, the calculations log for GUROBI is: Optimize a model with 12 rows, 25 columns and 39 nonzeros Coefficient statistics: Matrix range [1e+00,…
m0_as
  • 451
  • 1
  • 5
  • 13
1
2 3
60 61