# Questions tagged [pulp]

Questions relevant to the PuLP modelling framework in Python

76 questions
Filter by
Sorted by
Tagged with
820 views

### How do I turn off preprocessing in pulp?

There is an inbuilt preprocessing in CBC solver which affects the optimality of my solution. I get the optimal output by turning this off at the command prompt. How do I turn this off using pulp?
35 views

### Binary variable taking floating values in multi trip VRP with TW

I am trying to solve a multi trip VRP with time windows in pulp (minimizing total distance travelled). The code is providing optimal results for multi trip VRP without time window constraints (however ...
94 views

### How to write conditional constraints and sum the result in Linear Programming in Python?

I want to use the sum of a series of linear expressions as objective and constraints. These linear expressions are chosen to be included or not based on some conditions. I can achieve it in Excel ...
58 views

### Need help for the python scheduling code

I'm working on a Python application using PuLP for optimization, and I'm having trouble ensuring that only one material is produced on a given day. The constraint prob += pulp.lpSum(production_flag[m][...
108 views

### Ensure complete cycle in binary succession matrix LP [PuLP]

I have a set of orders N, for which i have to determine an optimal sequence. I wrap this decision within a binary matrix x[i][j], meaning whether i is succeeded by j. For example [[0 1 0 0] [0 0 1 0] [...
78 views

### PULP: Optimization Assignment of Bicycle production per month

Q1. If bicycles of types A and H are produced, then bicycles of type C can be produced with 20% shorter working hours, while selling profit of bicycles type H can be 20% higher. Q2: If bicycles of ...
117 views

### Extracting a sequence as a decision variable from a matrix (PuLP)

I am solving a sequencing problem x[i][j], i.e. a binary matrix indicating that product i is followed by ...
1 vote
134 views

### Unique values constraint in Pulp

Can we directly model following constraint in pulp x != y as following: ...
74 views

### Issue with Mathematical Model Using PuLP Library

I'm working on a pulp python code for the MS-RCPSP (multi-skilled resource-constrained project scheduling problem), I need to update the code to address a specific scenario: when an activity requires ...
33 views

### Shipment Allocation using Pulp

I am trying to create a model where each shipment must be allocated to a route to minimize the freight cost. I am a complete newbie at LP Optimization. Explanation of dataset: Every destination (D1,...
92 views

### Pulp Optimization with Decision Variable as Boundary

I am currently working on a linear programming problem using the Pulp library in Python. The problem involves optimizing the capacity of a battery, which is represented as a decision variable in my ...
194 views

### Detect presolve status in pulp model

I am running a model using pulp CBC and have few constraints in the model that may make the model infeasible if wrong input is given to the model. I can see while my model runs that in case of ...
259 views

### PuLP is ignoring constraints, and setting everything to 0 for minimization problem

I have a multi-objective optimization problem I am trying to solve with competing objectives. I am trying to model a network of industrial businesses which can share wastewater rather than sending it ...
1 vote
301 views

### Creating a decision variable that is the sum of other variables in PuLP

I'm trying to represent the following problem with PuLP: A car factory needs to maximize profit with an X amount of car models. Each car model has an individual profit and a manufacturing limit, and ...
369 views

### Warm starting a LP problem with PuLP and Gurobi

I have a set of many similar linear programs (LP). All these LPs have the same objective function, and almost all constraints are the same. The only difference is for one linear constraint $f(x)=a_{i}$...
1 vote
591 views

### PuLp is ignoring all of the constraints given to it

I am trying to solve a portfolio optimization problem using PuLP where given a dictionary of stock tickers and their returns for the day, returns a set of weights for each stock such that portfolio ...
182 views

### applying a piecewise linearized equation in pulp

The background is I'm building a toy rent vs. buy mortgage calculator. I am an experienced software engineer but my math skills are 20 years behind me and I admit to being very lost. I've been using ...
291 views

### Binary Integer Programming Problem - Enforce Zeros on Certain Groups

I'm working on a binary integer programming problem using pulp. I have a vector X = [x_1, x_2, x_3, . . . , x_n]. I have enforced a number of simple constraints. I ...
225 views

### Assignment Problem - Students and teachers

I ran across this problem at work and I'm sure that we can optimize it with OR. I have $n(T) = 4$ teachers and $n(S) = 7$ students that should have a weekly individual class. If a student $s$ has a ...
125 views

### How to linearize the multiplication by a binary decision variable?

I am currently optimizing a hydrogen production chain. I am optimizing the production regime, and the size of the required wind, solar and the electrolyser. For every hour of the year, the production ...
1 vote
259 views

### Efficient ways to do pairwise/multiplicative variables in integer linear programming on PuLP / Python

I'm trying to formulate an LP that is in essence a variant of the sudoku problem, and I've repurposed the code from https://coin-or.github.io/pulp/CaseStudies/a_sudoku_problem.html. The differences ...
243 views

955 views

### Python "Coffee Shop Scheduling Problem" - Scheduling Lunches/Breaks

I'm working on an employee scheduling program in python. Having never done this before, I've been researching different libraries that can be used to accomplish the task. Unfortunately, none of the ...
704 views

### Designing a multi-commodity network flow optimizer

I'm trying to solve multi commodity multi source network flow optimization problem using Python-PuLP. Here is how my problem looks like: The numbers on the arcs represent the order of priority a ...
788 views

### Python Pulp - LpMinimize Not Returning Expected Output - Scheduling Problem

I'm working on my first pulp model and something isn't going quite right. It looks like it's close, but for some reason it is not respecting one of my constraints... It's a scheduling problem and I am ...
1 vote
2k views

### Pulp Python - How to define a constraint with different indexes of variables

I am new to modeling LP with Pulp in Python and I need some help with defining a constraint with multiple variables with different indexes. Please see below. The constraint is defined on A, B, C ...
711 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 ...