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
0
votes
1 answer

How can I run PuLP simulation for a finite time?

I am running a facility location problem on python and want to run it for only 10 minutes as it will take more than 2 hours for complete solution. How can I do that?
0
votes
1 answer

Zero multiplier for the value in objective function doesn't give the most feasible solution

I'm using Pulp to solve a linear program (also getting the same result with scipy). So something wrong with my linear program formulation, or I don't know some tricky details on how simplex algorithm works. Here is objective function for…
Rusty Robot
  • 1,305
  • 1
  • 12
  • 18
0
votes
1 answer

Distribution network linear programming constraints

I'm trying to write a linear program in Python with the Pulp framework - donation clinics provide blood which is sent to a distribution center, and the onto a hospital for use. The difficulty is in creating constraints to decide whether a…
0
votes
1 answer

Solve GLPK from .mod file in Python Pulp

Its possible to solve a problem from a .mod file using Pulp? In the documentation there's nothing about it. is initiated like this: prob = LpProblem("linearProblem", LpMinimize) I want something like this: prob =…
Lucas Rodrigues
  • 139
  • 3
  • 13
0
votes
0 answers

number of inferred invalid tuples by existing constraints

I have been dealing with this problem for days but still no solution. Let me explain it on a simple example. Assume there is an array of integers with length 8. Every cell can take certain values. First 4 cells can take 0 or 1 and the other half…
genclik27
  • 323
  • 1
  • 7
  • 18
0
votes
1 answer

Python running but exe not. AttributeError

This is the error I got: Traceback (most recent call last): File "C:\Python34\lib\tkinter\__init__.py", line 1487, in __call__ return self.func(*args) File "interface.py", line 231, in testsubmit File "interface.py", line 202, in…
Dubar Alam
  • 79
  • 1
  • 10
0
votes
0 answers

pulp installation testing didn't work

I have started following the 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 type from pulp import * it gave the following…
Dubar Alam
  • 79
  • 1
  • 10
0
votes
1 answer

pulp shadow price difference with gurobi

I am comparing the values for shadow price (pi) calculated with gurobi and pulp. I get different values for the same input and I am not sure how to do it with pulp. Here is the lp file that I use: Minimize x[0] + x[1] + x[2] + x[3] Subject To …
darpet
  • 3,073
  • 3
  • 33
  • 40
0
votes
1 answer

Rglpk_solve_lp and glpsol(internally used by pulp glpk solver) return different values for same LP

The lp problem can be found at Portfolio Optimization Problem. The problem is based on cvar optimization in guy yollins presentation R Tools for Portfolio Optimization. When I read the lp file in R and execute it, optimal solution is found. Whereas…
livinston
  • 1,218
  • 2
  • 12
  • 18
0
votes
0 answers

problems with pulp (python)

I have a problem with pulp, I'm trying to convert this constraint ∑_iϵN Xijkz+Vjkz+Ujkz = nsjk*sjz ∀ j ϵ J , ∀ z ϵ S , ∀ k ϵ K . for i in N: prob += lpSum(X[(i,j,k,z) ]+V[(j,k,z)]+U[(j,k,z)] for j in J for k in…
0
votes
2 answers

Allowing User to Input Variables (Python)

I am working on a project using PuLP and I am trying to create a terminal prompt to allow users to input their data and then my Python program will change the input to code readable by PuLP. To do this I must allow users to input: 2*a + 3*b <=…
-1
votes
1 answer

how to create this linear program in PULP

How can I create the following linear program using PuLP? The structure is as follows. A list of orders must be processed in the order they came in, and has a list of items that can be made by a set of different machines. Each machine can only…
J. Doe
  • 165
  • 5
  • 16
-1
votes
1 answer

Minimum magnitude values OR 0 in PuLP?

In Python, I'm using the PuLP library to maximize values of side_1 and side_2. They have a constraint: The values of side_1 and side_2 must be equal and opposite to each other. I would like to set a minimum absolute value of side_1 and side_2. If…
-1
votes
1 answer

What exactly a None type is?

Here is the function that I receive the warning from (when v.varValue >= 1, it says "'>=' not supported between instances of 'NoneType' and 'int') def print_prob(prob, timelimit): for v in prob.variables(): if (v.varValue >= 1): …
-1
votes
1 answer

Creating a conditional constraint for a specific Python Pulp Maximization problem

I can't manage to find a way to create a constraint that sounds like this: for example I have 2 variables, one is a regular product and the other one is a super rare product. In order to have a super rare product, you will need to have already 25 of…
Paul C
  • 27
  • 6