Questions tagged [pulp]

PuLP is a linear programming module for Python.

PuLP is a linear programming module, written in Python.

Further reading

661 questions
18
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
  • 369
  • 1
  • 2
  • 12
17
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
  • 8,881
  • 14
  • 75
  • 133
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
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
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
  • 3,849
  • 4
  • 23
  • 47
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
  • 6,690
  • 7
  • 46
  • 79
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
  • 556
  • 1
  • 9
  • 29
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
  • 4,549
  • 1
  • 12
  • 28
7
votes
8 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
  • 343
  • 2
  • 4
  • 11
6
votes
2 answers

testing pulp installation fails

Following instructions from http://www.coin-or.org/PuLP/main/installing_pulp_at_home.html#installation , I installed PuLP using "Windows Installation from source" When I tried to run the test on the page ( Instructions on the page : "To test that…
Sriram Samynathan
  • 141
  • 1
  • 2
  • 3
6
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
  • 52,075
  • 130
  • 401
  • 707
6
votes
1 answer

How to get the optimal optimization variables in Pulp with Python?

I am using Pulp with Python to solve an optimization problem. I am using import pulp # code pulp.prob.objective.value() Now, I would like to access the optimization variables. How to do this? In the documentation of Pulp, I found something like…
1-approximation
  • 321
  • 3
  • 12
6
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…
5
votes
1 answer

Defining the Linear Programming Model for Traveling Salesman in Python

Using Python and PuLP library, how can we create the linear programming model to solve the Traveling Salesman Problem (TSP)? From Wikipedia, the objective function and constraints are Problem: Here is my partial attempt where I am stuck. I did…
Nyxynyx
  • 52,075
  • 130
  • 401
  • 707
1
2 3
44 45