Questions tagged [pulp]
Questions relevant to the PuLP modelling framework in Python
23
questions
3
votes
0answers
30 views
PuLP Python: How to linearize an inequality involving an integer variable
I am working on a Copper payables problem where the objective function is to maximise the sum of copper payable over a time period, T.
The total amount of payable tonnes i.e. what the customer will ...
4
votes
1answer
65 views
How to convert static variables into arrays for use with PuLP
I have the following code in Python and PuLP which uses static variables. I want to know how to solve the problem by converting all of the LpVariable parts into an array, as well as the constraints. ...
0
votes
2answers
188 views
How to generate multiple solutions to linear program in Python?
I recently posted a question here where I had written some Pyomo code to solve a simple linear program, however I feel the Operations Research platform is perhaps a better fit for this question. My ...
1
vote
1answer
75 views
How can I formulate an objective function that minimises the number of items required to solve a problem
I am currently trying to solve a problem where I need to minimise transport cost through the choice of vehicle (and how many of each choice) subject to a given demand.
The problem:
There are currently ...
1
vote
0answers
32 views
How can I see the engine log when solving a LP using pulp (python)?
I wonder which command should I use to see how the steps the pulp solver is doing when solving a linear program.
2
votes
1answer
55 views
How can I assign an initial value to a variable in PuLP?
I am trying to solve a production problem and right now I need to assign an initial value to the inventory, and that value is given.
This is my definition of the inventory variable:
...
4
votes
1answer
80 views
CBC stalling after approximately 10 seconds
I'm using CBC with PuLP to solve a small unit commitment problem. I'm finding that with certain combinations of input parameters, CBC simply stalls. With other input parameters, it solves, usually ...
-2
votes
1answer
170 views
Optimized Production Planning & Scheduling
I want to create an optimized schedule and production to meet demand of four different buyers. I am starting with Pulp but not able to account for continuous production variable and discrete dispatch ...
0
votes
0answers
113 views
Resource constrained LP problem
I am working on Diet Allocation problem. Where we need to provide food piece for protein deficiency. The data is as below:
...
4
votes
2answers
195 views
Output of binary variable greater than one
I am working on a shipping demurrage problem that uses a binary variable to denote the date a specific vessel can be loaded (I have been kindly helped by Wesley on OR before with this).
I am confident ...
2
votes
1answer
125 views
Representing Date Variables in Pulp
I am working on an optimisation problem that involves minimising shipping demurrage. I am struggling to model how to represent the difference, (x-y) between dates where the ship is ready to be loaded ...
1
vote
1answer
128 views
Pulp Python: How to formulate a time-based variable for shipping demurrage
I am working on a shipping optimisation problem that aims to minimise demurrage charges as a result of low/insufficient inventory.
I have daily vessel requirement (sales) data in the format ...
1
vote
2answers
227 views
Pulp: slack variable to identify & measure extent infeasible in supply problem
I am currently modelling a supply problem that attempts to optimise a rail schedule which moves products from a production plant, to a warehouse to satisfy sales.
The model is working fine (thanks in ...
3
votes
0answers
33 views
Constraint equivalence in PuLP
I'm working on an optimization problem in PuLP and I have to enforce a daily minimum of shifts and a daily maximum of assigned shifts. I have the following constraints to ensure each day has a minimum ...
4
votes
1answer
254 views
How to set these constraints in a linear optimization problem (PuLP)?
I am trying to implement an employee (nurse) scheduling problem and seek some advice on how to implement a specific constraint.The problem is as follows: There is a set of employees and days (both ...
2
votes
1answer
145 views
How to enforce this specific constraint in PuLP?
I am trying to implement an employee (nurse) scheduling problem and seek some advice on how to implement a specific constraint.The problem is as follows: There is a set of employees and days (both ...
12
votes
2answers
308 views
“Out of the box” Mixed Integer Programming Heuristics
I currently have a complex Mixed Integer Program (a sort of vehicle routing problem variant, with multiple vehicle types and without assigned pickup -> delivery routes, among other complications) ...
4
votes
1answer
226 views
PuLP Transport Problem - How to add outcomes of decision variables together
I am working on a rail scheduling problem that moves product from a production plant to a storage facility to satisfy demand. I am new to PuLP so finding this difficult to understand why this isn't ...
6
votes
1answer
212 views
Advanced Heuristics for MIP vehicle routing problem in PuLP
I am currently trying to speed up an MIP. An approach I was considering was to implement a cut callback heuristic with PuLP (one which rounds relaxed integer variables greater than .9 to 1). ...
7
votes
0answers
68 views
Why does PuLP call copy for addition and how can I avoid it?
Using a for loop to append terms to an expression seems to be much faster than summing a group of terms all at once. Constructing the expression using a for loop uses __iadd__, which does not include ...
11
votes
1answer
450 views
Change coefficient in PuLP
Once a model is implemented in PuLP, how do you change a coefficient (e.g., $a_{ij}$, $b_i$ or $c_j$) of a program of the from $\min\{c^{\top}x: Ax=b, x\geq0\}$?
Specifically:
How to update ...
8
votes
1answer
590 views
Read an LP/MPS file in the PuLP
I was trying to read a MPS file by using the PuLP package in the Python, but I can't find any related documents on it. Does ...
9
votes
1answer
5k views
How do I access the value of a variable in PuLP?
In Python's PuLP package, how can I get the value of a decision variable?
For example, if I declare a variableā
...